Data query method and device based on large language model, equipment and medium

By using a data query method based on a large language model, combined with business intelligence (BI) tools and chart data mapping models, the complexity of data query in the financial and medical fields is solved, and efficient and accurate multimodal data analysis and decision support are achieved.

CN120670629APending Publication Date: 2025-09-19PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510714410.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

In existing technologies, data queries in the financial and medical fields are highly complex, have long query delays, and consume large resources. It is difficult to effectively process semantic associations and fusion analysis between multimodal data, resulting in low query efficiency and accuracy, making it difficult to meet real-time data analysis and decision-making needs.

Method used

A data query method based on a large language model is adopted to obtain key query information through natural language analysis. Business intelligence (BI) tools are used to query target data in a multimodal fusion database, and the data is converted into a chart form for visual display. The chart data mapping model is combined to improve data utilization efficiency.

Benefits of technology

It improves the accuracy and efficiency of data queries, ensures the accuracy and completeness of query results, simplifies the integration and analysis of multimodal data, and supports more efficient data decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670629A_ABST
    Figure CN120670629A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, can be applied to the fields of medical treatment and finance, and discloses a data query method, device and equipment based on a large language model and a medium, a natural language query request is rapidly analyzed through the large language model and converted into executable query key information, the query request understanding precision is improved, and the query efficiency is improved. And the query result accuracy is improved. High-correlation target data is screened out from a multi-modal fusion database fusing various types of data through a business intelligence BI tool, data of different sources and types are integrated, and the accuracy and integrity of a query result are ensured. The target data obtained through query is converted into a visual chart form through a chart data mapping model, so that the complex data relation and trend are clear, the decision support effect of the multi-modal data in the fields of financial risk assessment, medical diagnosis analysis and the like is fully played, a user can quickly understand a data analysis result, and the user experience is improved. Therefore, decisions based on the multi-modal data can be made more efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology and can be applied to the medical and financial fields, and in particular to a data query method, device, equipment and medium based on a large language model. Background Art

[0002] With the rapid development of artificial intelligence (AI), the integration of natural language processing (NLP) and data analysis has become a core driver for improving corporate decision-making efficiency. This integrated technology has shown great application potential and value, especially in the financial and medical fields.

[0003] In the financial field, by analyzing large amounts of transaction records, market trend data, and customer behavior information, companies can more accurately predict market dynamics, formulate reasonable investment strategies, and optimize risk management.

[0004] In the medical field, natural language processing technology can process unstructured data such as electronic medical records and medical literature, and combine it with structured data such as clinical data and genetic data to provide strong support for disease diagnosis, treatment plan recommendations and medical research.

[0005] However, the relevant data collected by the front-end comes from a variety of sources, and the data types generated in different scenarios are also different. In existing technologies, data of different modalities is stored in different systems, lacking a unified management and integration mechanism. This requires switching between multiple systems when querying data, increasing query complexity and time costs. It also makes it difficult to effectively handle the semantic associations and fusion analysis between multimodal data, resulting in high query latency and high resource usage. This results in low efficiency and accuracy in data query, making it difficult to meet the needs of real-time data analysis and decision-making. Summary of the Invention

[0006] The present invention provides a data query method, device, computer equipment and medium based on a large language model to solve the technical problem of inaccurate business allocation leading to low business efficiency.

[0007] In a first aspect, a data query method based on a large language model is provided, comprising:

[0008] Based on the large language model, natural language analysis is performed on data query requests initiated by users through the client to obtain key query information;

[0009] Based on the business intelligence (BI) tool, the target data matching the key query information is searched in the preset multimodal fusion database;

[0010] Based on the chart data mapping model, the target data is converted into a data display format of a target chart type to generate a visual data query result.

[0011] In a second aspect, a data query device based on a large language model is provided, comprising:

[0012] The request analysis module is used to perform natural language analysis on data query requests initiated by users through the client based on a large language model to obtain key query information;

[0013] A target data query module is used to query target data matching the key query information in a preset multimodal fusion database based on a business intelligence (BI) tool;

[0014] The data display module is used to convert the target data into a data display format of a target chart type based on a chart data mapping model, and generate a visual data query result.

[0015] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned data query method based on a large language model are implemented.

[0016] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned data query method based on a large language model are implemented.

[0017] In the solution implemented by the above-mentioned data query method, device, computer equipment and storage medium based on the large language model, the large language model is used to quickly parse natural language query requests and convert them into executable query key information, thereby improving the accuracy of query request understanding and thus improving the accuracy of query results. By multimodal data fusion, various types of data are integrated, and highly relevant target data are screened out from the multimodal fusion database through business intelligence BI tools, data from different sources and types are integrated to ensure the accuracy and completeness of query results. The target data obtained by the query is converted into an intuitive chart form through a chart data mapping model, further improving the efficiency of data utilization, giving full play to the role of data in decision support, clarifying complex data relationships and trends, and facilitating users to quickly understand data analysis results, thereby making data-based decisions more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1This is a schematic diagram of an application environment of a data query method based on a large language model in one embodiment of the present invention;

[0020] Figure 2 A schematic diagram of a flow chart of a first embodiment of a data query method based on a large language model provided by an embodiment of the present invention;

[0021] Figure 3 A schematic flow chart of a second embodiment of a data query method based on a large language model provided by an embodiment of the present invention;

[0022] Figure 4 A flowchart of a third embodiment of a data query method based on a large language model provided by an embodiment of the present invention;

[0023] Figure 5 This is a structural diagram of a data query device based on a large language model in one embodiment of the present invention;

[0024] Figure 6 is a structural diagram of a computer device in one embodiment of the present invention;

[0025] Figure 7 FIG. 2 is another structural diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0027] The data query method based on the large language model provided by the embodiment of the present invention can be applied in the following situations: Figure 1 In an application environment, a client communicates with a server via a network. When a user initiates a data query request to the server through the client, the server performs natural language analysis on the request based on a large language model to obtain key query information. Using a business intelligence (BI) tool, the server searches a pre-set multimodal fusion database for target data that matches the key query information. Based on a chart data mapping model, the server converts the target data into a data display format of a target chart type to generate a visual data query result.

[0028] In the present invention, in order to address the existing technical problems of low efficiency and accuracy of data queries in scenarios in the financial and medical fields, a large language model can be used to quickly parse natural language query requests and convert them into executable query key information, thereby improving the accuracy of query request understanding and thus improving the accuracy of query results. By multimodal fusion data, various types of data are fused, and highly relevant target data are screened out from the multimodal fusion database through business intelligence BI tools, and data from different sources and types are integrated to ensure the accuracy and completeness of query results. The target data obtained by the query is converted into an intuitive chart form through a chart data mapping model, further improving the efficiency of data utilization, giving full play to the role of data in decision support, clarifying complex data relationships and trends, and facilitating users to quickly understand data analysis results, thereby making data-based decisions more efficient.

[0029] The client can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server can be implemented as an independent server or a server cluster consisting of multiple servers.

[0030] The present invention is described in detail below through specific examples.

[0031] In one embodiment, the present application embodiment takes the ChatBI system as an example to illustrate the process of the data query method based on the large language model.

[0032] The ChatBI system is a chat-based business intelligence (BI) system that allows users to communicate with it through natural language to obtain data analysis results, reports, and other information, helping them make data decisions and gain business insights more conveniently. The ChatBI system aims to achieve accurate analysis and insights from natural language using the Large Language Model (LLM). It also leverages business intelligence (BI) technology to transform analysis results into intuitive charts, providing users with efficient and intelligent data analysis services.

[0033] Generally, the ChatBI system workflow consists of three core phases: natural language processing, data query and analysis, and visualization generation. After a user enters a data query request in natural language, the system uses a large language model to perform semantic analysis of the query, extracting key information and user intent. Subsequently, data retrieval and analysis operations are performed in the database based on the analysis results. Finally, the analysis results are presented to the user through BI tools in the form of various visualizations, such as charts.

[0034] See also Figure 2 As shown, Figure 2 A flowchart of a first embodiment of a data query method based on a large language model provided by an embodiment of the present invention includes the following steps:

[0035] S101: Based on the large language model, natural language analysis is performed on the data query request initiated by the user through the client to obtain key query information;

[0036] In one embodiment, a user can communicate with the ChatBI system deployed on the server through the client and input a data query request in natural language. The ChatBI system uses a large language model to perform natural language analysis on the data query request and extract key query information.

[0037] The Big Language Model is a deep learning language model trained on large amounts of text data, with powerful language understanding and generation capabilities. By learning from large amounts of text, the Big Language Model can parse human natural language input, understand its semantics and intent, and generate corresponding natural language output, providing fundamental support for various natural language processing tasks.

[0038] In one embodiment, when using the ChatBI system to query data, users can use multiple input methods, such as voice input and text input. For example, if a user says "I want to know the sales performance ranking of each region last quarter" through voice on the mobile client, the system will automatically convert the voice into text and analyze it using a large language model.

[0039] During the conversation, MCP (Model Context Protocol) can be introduced to maintain the context information of the model, ensuring that the model can accurately understand and process the user's continuous queries and multi-round conversations, and provide coherent responses that meet the user's expectations.

[0040] Among them, MCP is responsible for recording information such as conversation history, user preferences, and current conversation status.

[0041] For example, when a user repeatedly issues related queries, MCP passes the previous query intent and results as context to the large language model, helping it better understand the current query. For example, a user in the financial sector might first request "last year's total sales of each product," then "sales by category." MCP would pass the "last year" timeframe as context to the large language model, allowing it to understand that the second query is also based on last year's data, allowing it to generate more accurate analysis instructions.

[0042] In addition to recording conversation history, user preferences, and the current conversation status, MCP dynamically adjusts the weight of contextual information based on user feedback and behavior. For example, if a user repeatedly modifies or supplements a query result, MCP will increase the weight of the query-related information in the context, allowing subsequent queries to more accurately meet the user's needs.

[0043] S102: Based on a business intelligence (BI) tool, searching a preset multimodal fusion database for target data that matches the key query information;

[0044] In one embodiment, in a business intelligence (BI) tool, a pre-set multimodal fusion database is its core data source. A multimodal fusion database is a database that integrates and stores data in multiple different modalities (such as text, images, audio, video, numerical values, etc.) and establishes a collection of interrelated data. This is intended to more comprehensively and accurately reflect business scenarios and various information in the real world, break the isolation between different data modalities, achieve collaborative data utilization, and provide richer materials for in-depth data analysis and mining, thereby enabling the extraction of more valuable information and insights.

[0045] This multimodal fusion database integrates data from different channels and in different forms, such as structured data (tabular data in relational databases), semi-structured data (data in JSON, XML and other formats) and unstructured data (text, images, audio, video, etc.).

[0046] For example, for an e-commerce company, a multimodal fusion database may contain detailed information (text descriptions, pictures, video displays) of products (such as financial products, medical supplies, etc.), sales records (structured transaction data), user reviews (feedback in text form), and customer service communication recordings (audio data).

[0047] Specifically, when a user initiates a data query request through the ChatBI system, the ChatBI system extracts key query information through natural language analysis. The business intelligence BI tool will then accurately locate the target data that matches the key query information in the multimodal fusion database based on preset query rules and data mapping relationships.

[0048] For example, if the key query is "sales trends of a certain electronic product in a certain region over the past three months," the BI tool will first locate the sales data table (structured data) for the corresponding electronic product in the database, filter out relevant records for that region, and extract the data for the past three months by time. It can also combine information about the product's promotional activities in that region (text data) with market feedback (such as relevant mentions in user reviews) to conduct a comprehensive analysis and generate a sales trend report.

[0049] Understandably, in BI tools, data mapping refers to the correspondence between key information in a user's natural language query and specific data tables, fields, and data records in a multimodal fusion database. It forms the basis for accurate data querying and is typically established through predefined data models, metadata management, and semantic association rules. For example, mapping "product name" in natural language to the "product_name" field in the corresponding product information table in the database, and mapping "sales" to the "sales_amount" field in the sales record table, etc., allows BI tools to accurately extract data from the database that meets the query requirements based on the mapping relationship.

[0050] In one embodiment, to improve query efficiency and accuracy, BI tools can preprocess and index data in a multimodal fusion database. For example, text data can be segmented, keyword extracted, and semantic vectorized to facilitate rapid retrieval of content relevant to the query semantics. Image and video data can also be indexed using computer vision techniques to extract features such as object outlines, color distribution, and scene categories. This allows for rapid matching of images and video data when users query content related to product appearance, usage scenarios, and other content.

[0051] Furthermore, based on the self-attention mechanism algorithm of the business intelligence BI tool, the query language input by the user is semantically parsed to generate query semantics and statement query instructions; based on the statement query instructions, target data matching the query semantics is queried from the multimodal fusion database.

[0052] In one embodiment, a hierarchical collaborative architecture of a large language model and BI tools can be established. The large language model layer uses a language model with a Transformer architecture (such as GPT-3) to understand, parse, and generate semantics for natural language queries input by users through a self-attention mechanism algorithm.

[0053] Among them, the self-attention mechanism algorithm is an algorithm used to process sequence data (such as natural language text). It dynamically determines the importance and attention level of each element in the current task by calculating the correlation between elements at different positions in the sequence.

[0054] The self-attention mechanism enables the model to focus on the relationships and importance between different words in a sentence when processing query language, thereby more accurately understanding the user's query intent. For example, when a user enters "show sales comparison of each product in the first quarter of last year and the first quarter of this year," the self-attention mechanism algorithm will focus on key information such as "last year's first quarter," "this year's first quarter," "each product," and "sales comparison," understanding the relationship between them and generating the corresponding query semantics and sentence query instructions, ensuring that the target data is accurately retrieved from the multimodal fusion database.

[0055] Specifically, the calculation formula of the self-attention mechanism is:

[0056]

[0057] Among them, Q (query matrix), K (key matrix), and V (value matrix) are obtained by linear transformation of the input sequence. k is the dimension of the key vector, and T represents the transpose operation of the matrix.

[0058] In one embodiment, a statement query instruction refers to a series of instructions or commands for guiding data query operations generated based on the query language input by the user. The statement query instruction may include key information, conditions, scope, and characteristics of the target data of the data query.

[0059] In one embodiment, after receiving the semantic query instruction, the BI tool can construct query conditions that match the multimodal fusion database based on the key information in the statement query instruction and the adaptation of different data types and data storage structures.

[0060] For example, for structured data, query conditions that conform to relational database query syntax (such as SQL) can be generated; for semi-structured data and unstructured data, query conditions suitable for NoSQL databases or other storage systems can be generated.

[0061] In a multimodal fusion database, the BI tool library retrieves target data that matches the query intent from data of different modalities (structured, semi-structured, and unstructured data) based on given query conditions and query semantics, analyzes and calculates the extracted target data, and uses the chart library to present the results in the form of visual charts, such as using a bar chart to show the sales comparison of each region.

[0062] In another embodiment, multiple data display chart patterns can be pre-built based on the data display patterns used by different data types in historical user query processes. The data types and data display chart patterns can then be associated to form a chart template library. When a user performs a data query, the BI tool can directly convert the target data into a chart associated with the data type in the chart template library based on the data type of the user's query data, and display it. If multiple chart patterns are available, the user can choose one.

[0063] In one embodiment, at least one historical query data type corresponding to the historical query data and at least one data display chart mode corresponding to the historical query data are obtained; based on the correspondence between each of the historical query data types and each of the data display chart modes corresponding to the historical query data, at least one chart template corresponding to each of the historical query data types is determined; and based on the at least one chart template corresponding to each of the historical query data types, a chart template library is constructed.

[0064] The historical query data type refers to the type of data involved in the historical query records. This can include structured data types (such as sales order data and inventory data), semi-structured data types (such as user behavior data in JSON format), and unstructured data types (such as text comments and image descriptions).

[0065] Data display chart mode refers to the type and style of chart used to display data. Specifically, data display chart mode can include line charts, bar charts, pie charts, scatter plots, heat maps, etc.

[0066] A chart template is a pre-designed chart framework that maps specific data types to chart patterns. It defines the chart's basic structure, layout, style, and the mapping rules between data and chart elements.

[0067] In one embodiment, a library of chart templates can be designed, with each template associated with a specific data structure and query pattern. For example, a pie chart template can be used for market share analysis queries. A market data database table records market share data for each product or business segment. When the system receives a market share analysis query, it extracts data from this table based on the pie chart template rules and organizes it according to the Echarts pie chart data format.

[0068] Specifically, when building a chart template library, we can analyze historical query data to uncover user preferences for displaying different types of data. For example, for time series data, users may prefer to use line charts to display data trends; for categorical data, users may prefer to use bar charts or pie charts to compare differences between different categories.

[0069] By analyzing the correspondence between different data types and display chart modes in historical query data, we can determine the multiple chart templates that correspond to each historical query data type. For example, in addition to the common line charts, bar charts, and pie charts, we can also include other chart modes suitable for that data type, such as stacked area charts and radar charts.

[0070] In one embodiment, to improve the accuracy and practicality of the chart template library, a machine learning algorithm can be used to perform cluster analysis on historical query data. Queries with similar data types and display chart patterns are grouped together, and then corresponding chart templates are generated for each cluster. For example, queries related to sales data can be divided into different clusters, such as sales volume analysis, sales volume analysis, and sales trend analysis, with each cluster corresponding to a different set of chart templates.

[0071] Once the chart template library is built, when users perform data queries, the BI tool can automatically search for the corresponding chart template in the library based on the data type of the query data. If multiple chart templates exist, the BI tool provides an intuitive chart selection interface, showing a preview of each chart template and its applicable scenarios.

[0072] Furthermore, after the business intelligence BI tool performs semantic parsing on the query language input by the user and generates query semantics and statement query instructions, it also includes: determining the target data type of the user query data based on the query semantics; searching for a target chart template that matches the target data type in a preset chart template library; determining the target data based on the target chart template and the target data type; and querying the target data from the multimodal fusion database based on the statement query instructions.

[0073] Specifically, based on the query language obtained by semantically parsing the query language input by the user through the BI tool, the target data type of the user's query data is determined, including time series data (used to represent the time range of this quarter), regional classification data (used to represent different regions) and numerical sales data.

[0074] The preset chart template library contains a variety of chart templates that match different data types. For example, for a combination of time series data and numerical data (such as sales data for each region this quarter), you can include line chart templates, bar chart templates, and area chart templates. These chart templates define how data is mapped to chart elements such as axes, data points, and lines.

[0075] The BI tool searches the chart template library for a matching target chart template based on the target data type of the user's query. For example, based on the user's historical preferences or default settings, a bar chart template might be preferred to display sales comparisons by region because it clearly shows the sales differences between different regions.

[0076] After determining the target chart template and data type, BI tools can further refine the scope and structure of the target data. For example, for a bar chart, BI tools can specify which specific data fields to retrieve from the multimodal fusion database, such as the region name, the current quarter's sales figures, and the corresponding time field (used to verify whether the data belongs to the current quarter).

[0077] Based on the target data scope, structure, format, and granularity determined above, the BI tool can generate query conditions that match the multimodal fusion database. Based on the query conditions, it generates statement query instructions, executes the corresponding query operations, and extracts target data from the multimodal fusion database that matches the query semantics. For example, it can extract sales data for each region for the current quarter from the sales database and format it into a data structure that meets the requirements of a chart template.

[0078] This embodiment builds a chart template library to determine the association between query data types and chart templates. It can accurately determine the target data type based on the user query semantics, select the appropriate chart template, and obtain the target data from the multimodal fusion database, providing a solid foundation for subsequent data visualization.

[0079] In one embodiment, a two-way feedback mechanism can be designed between the large language model and the BI tool. When the BI tool detects data anomalies (such as missing data in a certain region) or unclear instructions during the execution of data analysis instructions, it will provide feedback to the large language model.

[0080] Specifically, when the BI tool executes data analysis instructions, the integrity of the data and the clarity of the instructions will be checked in real time.

[0081] Data integrity checks are based on predefined data quality rules and business logic. For example, they check whether key data fields contain null values, whether data is within a reasonable range, and whether regional data is updated as expected. If missing data is found for a region, for example, when analyzing regional sales comparisons for the current quarter, it is discovered that sales data for 'XX region' is not entered as expected or contains a large number of missing values, a feedback mechanism is triggered, generating feedback information. The feedback type is "Data anomaly" and the detailed description is "Missing data for region 'XX region'". The original query that triggered the feedback, "Analyze regional sales comparisons for the current quarter," is also recorded.

[0082] The BI module determines unclear instructions based on its understanding of the query semantics and the degree of data mapping matching. If the query semantic analysis results are ambiguous or the matching dataset and analysis method cannot be accurately determined, for example, if a user queries "analyze sales" but does not specify whether to analyze sales volume, sales volume, or sales profit, as well as the time range and dimensions of the analysis, the feedback type will be "unclear instruction", with a detailed description of the ambiguity and a record of the original query.

[0083] After receiving feedback from the BI tool, the large language model reparses and optimizes the query based on the feedback, adjusting the query based on the specific data anomaly. For example, if the query "Analyze this quarter's sales comparison by region" receives feedback due to missing data for 'XX region', the large language model will optimize the query to "Analyze this quarter's sales comparison by region excluding XX region" based on business logic and data analysis feasibility, and then resend it to the BI tool for execution.

[0084] If the instruction feedback is unclear, the big model will ask the user to clarify the question, such as "Do you want to analyze the sales situation in the specific dimension of sales, sales volume or sales profit? Please clarify", or try to reasonably complete and optimize the instruction based on the user's historical query records and common query patterns.

[0085] In one embodiment, when there is no target data matching the key query information in the multimodal fusion database, the user's historical query data is obtained; based on an association rule mining algorithm, the historical query data is analyzed to determine the user's data query preference information; based on the data query preference information and the key query information, the user's current query intention is determined; based on the BI tool, the multimodal fusion database is searched for target data matching the current query intention.

[0086] In one embodiment, all past user query requests can be obtained from the query log, including information such as query time, query content, data type used, and query results. The collected historical query data is cleaned and formatted to remove duplicate and invalid query records and unify the data format for subsequent analysis.

[0087] For example, a suitable association rule mining algorithm, such as the Apriori algorithm, can be used to set parameters such as minimum support and minimum confidence, and then run the association rule mining algorithm.

[0088] Among them, support represents the frequency of an item set appearing in all queries, and confidence represents the probability that a query containing a certain item also contains another item.

[0089] Specifically, the large language model analyzes the user's historical query data and uses association rule mining algorithms (such as the Apriori algorithm) to mine user query patterns and preferences. The core step of the Apriori algorithm is to generate association rules through frequent item sets. Let I = {i1, i2, ..., i n} is the set of all items, transaction database D = {t1, t2, ..., t m}, frequent item set L k is a k-itemset C that satisfies the minimum support threshold (i.e., appears in at least a certain proportion of queries) k The set is generated by iterative layer-by-layer.

[0090] Specifically, I is the set of all possible items, and D is the actual user query data used to calculate the support of each item set. k It is composed of items in I and determines which candidate item sets belong to L by scanning D to calculate the support. k , L k From C k In summary, I and D are the basis of Apriori algorithm, providing the project set and actual transaction data respectively; candidate item set C k By merging L k-1 The itemsets in L are generated; k From C k The frequent itemsets whose support satisfies the threshold are filtered out.

[0091] For example, historical user query data is analyzed, treating user query records as transactions in a transaction database. The keywords, query type (e.g., sales query, sales trend query), and dimensions involved (e.g., region, product, time), etc. in each query are treated as items. Using the Apriori algorithm, the query history database is first scanned to calculate the support of each item (e.g., "sales," "region A," "this quarter," etc.), filtering out frequent item sets. For example, if a user frequently queries for a combination of "this quarter," "sales," and "region," and the support for this combination exceeds a set minimum support threshold, it is considered a frequent item set. Association rules are then generated based on the frequent item sets, such as "When a user queries 'this quarter's sales,' there is a high probability that they will also query 'sales comparison by region.'" By mining these association rules, large models can better understand user query patterns and preferences.

[0092] By analyzing the mined frequent itemsets and association rules, we can understand users' preferences and habits when querying data. Based on the analysis results, we can build a user's data query profile, including information such as the user's frequently used data types, query topics, query frequency, and query time patterns. We can also combine the user's historical query preferences with the current key query information to infer the user's current query intent.

[0093] For example, the user is currently searching for "sales this quarter". Combined with the user's historical query preferences for sales performance indicators and the fact that they frequently searched for "sales comparison by region", we can further infer that the user may want to know the sales figures for each region this quarter, or how they compare with the sales figures for the previous quarter.

[0094] In one embodiment, the inferred query intent can be verified and refined by sending a confirmation message to the user or providing some possible query options. For example, a confirmation message can be sent to the user asking, "Do you want to query the sales by region for this quarter, or how it compares to last quarter?" The query intent can be further clarified based on the user's feedback.

[0095] The large language model feeds the mined results back to the BI tool. Based on the current query intent, the BI tool constructs query conditions that match the multimodal fusion database. For example, if the user's current query intent is to obtain sales figures for each region this quarter, a query condition can be constructed to extract sales data for each region from the sales database. The BI tool executes the query, retrieves the target data that matches the current query intent from the multimodal fusion database, and presents it to the user in an appropriate chart or report format.

[0096] In this embodiment, the two-way feedback mechanism can achieve close collaboration between the large language model and the BI tool, continuously optimize the data analysis and query process, improve the accuracy and efficiency of data processing, and provide users with a personalized data analysis experience.

[0097] S103: Based on the chart data mapping model, the target data is converted into a data display format of a target chart type to generate a visual data query result.

[0098] In one embodiment, a chart data mapping model is a model or set of rules for converting data into a specific chart type display format. The chart data mapping model defines how to associate and map different types of data (e.g., numerical values, time series, categories, etc.) with various chart elements (e.g., axes, data points, lines, colors, etc.) to achieve a visual display of the data. Using the chart data mapping model, complex data structures can be converted into intuitive and easy-to-understand chart formats, helping users better understand and analyze the data.

[0099] Specifically, after the large language model parses the user query to determine the chart type (such as a bar chart, line chart, etc.), the ChatBI system extracts the corresponding data from the database based on the chart type and user query intent, and performs real-time conversion and mapping through the chart data mapping model.

[0100] In a chart, the x-axis and y-axis represent different data dimensions. For example, in a line chart, the x-axis can represent discrete or continuous dimensions like time and category, while the y-axis can represent numerical metrics or indicators.

[0101] For example, when a user queries "monthly product sales changes in the past year", the system will recognize that the time dimension (month) and sales data are key information, and extract the time series T = {t1, t2, ..., t 12} and sales sequence S={s1,s2,…,s 12 Map the time series T to the x-axis data of the line chart, and map the sales series S to the y-axis data of the line chart. Specifically, each scale on the x-axis represents a specific month t i (i = 1 to 12), the corresponding y-axis data point is the sales volume s of that month i In this way, the original sales data is converted into the x-axis and y-axis data structure required for the line chart, thereby intuitively showing the changing trend of product sales per month over the past year.

[0102] This embodiment can employ a dynamic chart data mapping model to perform real-time data conversion and mapping based on the user's query intent, chart type, and data changes. It can automatically adjust mapping rules and chart parameters based on different query scenarios and data characteristics to generate the most appropriate visual data query results, allowing users to access dynamically updated charts in real time that promptly reflect data changes and trends.

[0103] As can be seen, in the above solution, natural language query requests are quickly parsed through a large language model and converted into executable query key information, thereby improving the accuracy of query request understanding and, in turn, the accuracy of query results. Multimodal data fusion is used to fuse multiple types of data, and business intelligence (BI) tools are used to filter out highly relevant target data from the multimodal fusion database, integrating data from different sources and types to ensure the accuracy and completeness of query results. The target data obtained from the query is converted into an intuitive chart form through a chart data mapping model, further improving the efficiency of data utilization, giving full play to the role of data in decision support, clarifying complex data relationships and trends, and facilitating users to quickly understand data analysis results, thereby making data-based decisions more efficient.

[0104] In one embodiment, reinforcement learning may be used to drive the model evolution and action decision-making of the ChatBI system.

[0105] Specifically, information such as conversation history, user's current query, current parsing results of the ChatBI system's model, and system resource status (such as database load, computing resource occupancy, etc.) is used as the state space S of reinforcement learning.

[0106] For example, the state s t It can be expressed as s t =[h t ,q t ,r t ,r sys ], where h t is the conversation history up to time t, q t is the current user query, r t is the current parsing result of the model for the query, r sys Is the system resource status.

[0107] Define the action space A, including different ways of parsing user queries, generating different types of analysis instructions, selecting different data query strategies, and adjusting the chart generation style. For example, action a t It could be "adjusting query parsing to pay more attention to the time dimension", "adding cache optimization strategies when generating SQL queries", etc.

[0108] Define the reward function R(s t ,a t ,s t+1 The reward is used to evaluate the effectiveness of a model's actions. Rewards are primarily based on factors such as user satisfaction, query result accuracy, and system efficiency. If the model generates a chart that accurately meets user needs and the system responds quickly, a higher reward is given; if parsing errors occur or system performance degrades, a lower reward is given. For example, if a user is satisfied with the generated chart and continues to perform a related query, the reward is +10; if a model parsing error causes the query to fail, the reward is -5.

[0109] Using reinforcement learning algorithms (such as deep Q network DQN, policy gradient algorithm, etc.), the model is trained based on the state space, action space and reward function. In each dialogue interaction, the model is trained based on the current state s t Select action a t , enter the new state s after executing the action t+1 and receive rewards tThrough continuous iterative training, the model learns the optimal action strategy for different states, enabling autonomous evolution. For example, through multiple dialogue training sessions, the model gradually learns to proactively ask users for more accurate information when their queries are ambiguous, thereby improving the accuracy of query results and user satisfaction.

[0110] See also Figure 3 As shown, Figure 3 A flowchart of a third embodiment of a data query method based on a large language model provided by an embodiment of the present invention.

[0111] like Figure 3 As shown, based on the above Figure 2 In the embodiment shown, before step S101, the following steps are further included:

[0112] S201: When storing the data to be stored in the multimodal fusion database, performing semantic analysis on the data to be stored based on a natural language processing algorithm to obtain a semantic label for the data to be stored;

[0113] Among them, semantic labels are labels that mark the semantic meaning of data, which can accurately express the entities, concepts or attributes represented by the data.

[0114] When data to be stored is entered into the database, natural language processing technology combined with domain ontology knowledge is used to add semantic tags to the data to be stored. This gives the data to be stored richer semantic information, allowing it to be more accurately understood and used during query and analysis.

[0115] For example, for the "product_name" field in the sales data, the named-entity recognition (NER) algorithm is used to identify the product name entity, and then combined with the product domain ontology library, its semantic label is determined to be "product name".

[0116] Among them, the NER algorithm is a natural language processing technology that identifies entities with specific meanings (such as names of people, places, organizations, product names, etc.) from text.

[0117] The NER algorithm can adopt the conditional random field (CRF) model, and its objective function is:

[0118]

[0119] Where x is the input sequence (such as sales data record text); y is the output label sequence; P(y|x) is the conditional probability, which represents the probability of outputting the label sequence y given the input sequence x. Z(x) is the normalization factor used to ensure that the sum of the probabilities is 1; t kis the transition feature function, which is used to capture the transition relationship between labels, k is the index of the transition feature function, which is used to traverse all defined transition feature functions; l is the state feature function, which is used to capture the relationship between the label and the input sequence. l is the index of the state feature function, which is used to traverse all defined state feature functions. k and u l are the weight parameters for the transition feature and state feature, respectively; n is the length of the input sequence. i represents the position index in the input sequence x, which is used to iterate the calculation for each position in the sequence in the formula. Indicates that for each position i, the transition characteristic function t is calculated k The value of , considering the current label y i and the previous label y i-1 The relationship between them. Indicates that for each position i, the state characteristic function s is calculated l The value of , considering the current label y i and the relationship between the input sequence x at position i.

[0120] After generating semantic tags for the data to be stored, the semantic tags can be stored in the metadata associated with the data to be stored. When the large language model parses natural language queries, relevant data can be quickly matched based on the semantic tags, thereby improving query efficiency and accuracy.

[0121] S202: Generating a data label for the data to be stored based on the storage location information of the data to be stored in the multimodal fusion database and the semantic label;

[0122] In one embodiment, after determining the semantic label of the data to be stored, a complete data label can be generated in combination with the storage location information of the data in the multimodal fusion database.

[0123] The storage location information includes the sub-database name, table name (for structured data), collection name (for semi-structured data), and file path (for unstructured data) where the data is stored.

[0124] For example, for a sales record, its storage location information may be "sub-database: sales database; table name: sales order table; row number: 1001". Combined with its semantic label "product name: smart watch; sales date: 2025-05-14; sales amount: 2999 yuan", etc., the generated data label will fully describe the content and storage location of the data.

[0125] S203: Constructing a data association index structure of the multimodal fusion database based on association relationships between data to be stored of different data types in the multimodal fusion database and data labels of the data to be stored.

[0126] In one embodiment, in order to implement fast association query between data of different modalities, a data association index structure based on an inverted index may be constructed.

[0127] Among them, the inverted index is a data structure used for fast text retrieval, which records the keywords and their location information that appear in the document.

[0128] For example, suppose you want to associate sales order data (structured) with product description data (semi-structured). For keywords in the product description (such as "smart watch"), create an inverted index:

[0129] InvertedIndex(keyword)={(document_id,position_list)}

[0130] Among them, document_id is the document identifier containing the keyword (such as product_id of a product description document), and position_list records the position list of the keyword in the document.

[0131] Through this inverted index structure, when querying sales records related to "smart watches" in structured sales order data, it is possible to quickly locate documents containing the keyword "smart watches" in semi-structured product description data and obtain their detailed description information, thereby realizing fast association queries between different data modalities.

[0132] Through the data association index structure based on the inverted index, semi-structured descriptive information related to products in structured data can be quickly located, which not only improves the efficiency of data query, but also provides strong support for data analysis across data types.

[0133] This embodiment effectively improves the efficiency and accuracy of data queries by applying natural language processing algorithms and domain ontology knowledge to add semantic labels to data during data storage, generates complete data labels in combination with storage location information, and constructs a data association index structure based on an inverted index. At the same time, it provides strong support for association queries and comprehensive analysis of cross-modal data, and helps to achieve rapid positioning, accurate retrieval, and efficient utilization of data.

[0134] See also Figure 4 As shown, Figure 4 A flowchart of a third embodiment of a data query method based on a large language model provided by an embodiment of the present invention.

[0135] like Figure 4 As shown, based on the above Figure 3 In the illustrated embodiment, before step S201, the following steps are further included:

[0136] S301: When acquiring the data to be stored, dividing the data to be stored into at least one data subset based on at least one data type corresponding to the data to be stored;

[0137] In one embodiment, the data generated by the front end is diverse, and different users may also have different data query requirements. Therefore, a multimodal fusion database can be used to store and manage different types of data to be stored.

[0138] Exemplarily, the data types of the data to be stored may include structured data types, semi-structured data types, and unstructured data types.

[0139] A data subset is a collection of data that is created by dividing the original data to be stored according to certain rules (such as data type, data source, business attributes, etc.). Each data subset contains data with similar characteristics or correlations, making it easier to adopt different storage strategies and management methods for different data subsets.

[0140] In one embodiment, in addition to dividing data subsets based on data type, further subdivision can be performed based on multiple factors such as data source, usage, and relevance. For example, for data in the financial sector, in addition to dividing structured data such as sales order data and purchase order data into a data subset, further subdivision can be performed based on different business departments (such as retail finance department, corporate finance department, etc.) or different business products (such as credit card business, loan business, etc.) to enable more accurate data storage and query.

[0141] At the same time, during the data division process, the data can be preprocessed to a certain extent, such as removing duplicate data, verifying data integrity, etc., to ensure the quality and consistency of the data.

[0142] S302: storing each of the data subsets based on the sub-database corresponding to each of the data types in the multimodal fusion database;

[0143] In order to realize the data fusion storage of structured data types, semi-structured data types and unstructured data types, a multimodal fusion database can be constructed, in which sub-databases corresponding to different data types are set up to store the data to be stored of each data type.

[0144] In a multimodal fusion database, a sub-database is a database instance or data partition designed specifically to store a specific type of data. Each sub-database utilizes a different database management system (e.g., a relational database management system for structured data, or a NoSQL database management system for semi-structured and unstructured data) and storage structure based on the type of data it stores, enabling efficient storage, querying, and management of that data. While independent from one another, the sub-databases can collaborate within the overall architecture of the multimodal fusion database.

[0145] For example, for structured data (such as sales order data, purchase order data, etc. in the financial / medical fields), a relational database (such as MySQL) can be used for storage, and its mature transaction processing capabilities and SQL query language can be used to achieve efficient data retrieval.

[0146] For semi-structured data (such as configuration files in JSON format) and unstructured data (such as text reports and image descriptions), NoSQL databases (such as MongoDB) are used for storage.

[0147] In one embodiment, in addition to using relational databases and NoSQL databases to store structured data and semi-structured and unstructured data, a tiered storage strategy may also be adopted based on factors such as data access frequency and storage cost.

[0148] For example, frequently accessed hot data can be stored in high-performance solid-state drive (SSD) storage devices, and a relational database or high-end NoSQL database can be used to ensure fast read and write speeds. For less frequently accessed cold data, it can be stored in lower-cost tape libraries or cold storage areas of cloud storage, but the security and recoverability of the data still need to be ensured.

[0149] S303: Based on the storage location of each data subset of the to-be-stored data in each sub-database, obtain storage location information corresponding to the data subset of the to-be-stored data.

[0150] In one embodiment, the multimodal database can establish a global data index and data management module to record the storage location information of each data subset in the sub-database, including database name, table name (for relational databases), collection name (for MongoDB in NoSQL databases, etc.), file path (for unstructured data stored in files), and other detailed information.

[0151] The storage location information refers to the detailed information describing the specific storage location of the data in the database or storage system.

[0152] For example, for structured data stored in a relational database, the storage location information may include the database server address, database name, table name, field name, etc.; for semi-structured data stored in a NoSQL database such as MongoDB, the storage location information may include the MongoDB instance address, database name, collection name, etc.; for unstructured data stored in a file system, the storage location information may include the file server address, file path, file name, etc.

[0153] In addition, the data indexing and data management modules can also record other relevant data information, such as data creation time, modification time, data size, and data owner, to facilitate data management and auditing. When users query data, the data indexing and data management modules first quickly locate the corresponding sub-database and data subset, and then extract data from the sub-database, improving data query efficiency.

[0154] This embodiment reasonably divides data subsets, adopts a multimodal fusion database and combines different database management systems to store different types of data, and at the same time establishes a global data index and management module to record storage location and other information, thereby effectively improving the organization and management efficiency of data storage, ensuring fast and accurate data query, and improving the performance and reliability of data processing, providing a strong guarantee for efficient data analysis and decision support.

[0155] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0156] In one embodiment, a data query device based on a large language model is provided, and the data query device based on a large language model corresponds one-to-one to the data query method based on a large language model in the above embodiment. Figure 5 As shown, the data query device based on the large language model includes: a request analysis module 401, a target data query module 402 and a data display module 403. The functional modules are described in detail as follows:

[0157] The request analysis module 401 is used to perform natural language analysis on the data query request initiated by the user through the client based on the large language model to obtain key query information;

[0158] The target data query module 402 is used to query the target data matching the key query information in a preset multimodal fusion database based on a business intelligence (BI) tool;

[0159] The data display module 403 is used to convert the target data into a data display format of a target chart type based on a chart data mapping model, and generate a visual data query result.

[0160] In one embodiment, the data query device based on the large language model further includes an index structure construction module, including:

[0161] A semantic analysis unit is configured to perform semantic analysis on the data to be stored based on a natural language processing algorithm when storing the data to be stored in the multimodal fusion database, so as to obtain a semantic label for the data to be stored;

[0162] a data label generating unit, configured to generate a data label for the data to be stored based on the storage location information of the data to be stored in the multimodal fusion database and the semantic label;

[0163] The index structure construction unit is used to construct a data association index structure of the multimodal fusion database based on the association relationship between the to-be-stored data of different data types in the multimodal fusion database and the data labels of the to-be-stored data.

[0164] In one embodiment, the data query device based on the large language model further includes a data storage module, including:

[0165] a data partitioning unit, configured to, when acquiring the data to be stored, partition the data to be stored into at least one data subset based on at least one data type corresponding to the data to be stored;

[0166] A data storage unit, configured to store each of the data subsets based on a sub-database corresponding to each of the data types in the multimodal fusion database;

[0167] The storage location information obtaining unit is configured to obtain the storage location information corresponding to the data subset of the data to be stored based on the storage location of each data subset of the data to be stored in each sub-database.

[0168] In one embodiment, the target data query module 402 includes:

[0169] A semantic parsing unit, configured to perform semantic parsing on the query language input by the user based on the self-attention mechanism algorithm of the business intelligence (BI) tool, and generate query semantics and statement query instructions;

[0170] The first target data query unit is used to query target data matching the query semantics from the multimodal fusion database based on the statement query instruction.

[0171] In one embodiment, the target data query module 402 further includes:

[0172] a data type determining unit, configured to determine a target data type of user query data based on the query semantics;

[0173] An icon template query unit, configured to query a preset chart template library for a target chart template that matches the target data type;

[0174] a target data determining unit, configured to determine the target data based on the target chart template and the target data type;

[0175] The target data query second unit is used to query the target data from the multimodal fusion database based on the statement query instruction.

[0176] In one embodiment, the data query device based on the large language model further includes a chart template library construction module, including:

[0177] A historical data acquisition unit, configured to acquire at least one historical query data type corresponding to the historical query data, and at least one data display chart mode corresponding to the historical query data;

[0178] a chart template determining unit, configured to determine at least one chart template corresponding to each of the historical query data types based on a correspondence between each of the historical query data types corresponding to the historical query data and each of the data display chart modes;

[0179] The chart template library construction unit is configured to construct a chart template library based on at least one of the chart templates corresponding to each of the historical query data types.

[0180] In one embodiment, the target data query module 402 further includes:

[0181] a historical query data acquisition unit, configured to acquire the user's historical query data when there is no target data matching the key query information in the multimodal fusion database;

[0182] a query preference information determining unit, configured to analyze the historical query data based on an association rule mining algorithm to determine the user's data query preference information;

[0183] a current query intention determining unit, configured to determine the user's current query intention based on the data query preference information and the key query information;

[0184] The target data query third unit is used to query the target data matching the current query intention in the multimodal fusion database based on the BI tool.

[0185] The present invention provides a data query device based on a large language model, which quickly parses natural language query requests through the large language model and converts them into executable query key information, thereby improving the accuracy of query request understanding and further improving the accuracy of query results. By multimodal data fusion, multiple types of data are fused, and highly relevant target data are screened out from the multimodal fusion database through business intelligence BI tools, integrating data from different sources and types to ensure the accuracy and completeness of query results. The target data obtained by the query is converted into an intuitive chart form through a chart data mapping model, further improving the efficiency of data utilization, giving full play to the role of data in decision support, clarifying complex data relationships and trends, and facilitating users to quickly understand data analysis results, thereby making data-based decisions more efficiently.

[0186] For the specific definition of the data query device based on the large language model, please refer to the definition of the data query method based on the large language model above, which will not be repeated here. The various modules in the above-mentioned data query device based on the large language model can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0187] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it realizes the functions or steps on the server side of a data query method based on a large language model.

[0188] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, memory, network interface, display screen and input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it realizes the functions or steps of the client side of a data query method based on a large language model.

[0189] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:

[0190] Based on the large language model, natural language analysis is performed on data query requests initiated by users through the client to obtain key query information;

[0191] Based on the business intelligence (BI) tool, the target data matching the key query information is searched in the preset multimodal fusion database;

[0192] Based on the chart data mapping model, the target data is converted into a data display format of a target chart type to generate a visual data query result.

[0193] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0194] Based on the large language model, natural language analysis is performed on data query requests initiated by users through the client to obtain key query information;

[0195] Based on the business intelligence (BI) tool, the preset multimodal fusion database is searched for target data that matches the key query information;

[0196] Based on the chart data mapping model, the target data is converted into a data display format of a target chart type to generate a visual data query result.

[0197] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can be found in the relevant descriptions of the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.

[0198] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0199] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0200] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A data query method based on a large language model, characterized in that: The method comprises: Based on the large language model, natural language analysis is performed on data query requests initiated by users through the client to obtain key query information; Based on the business intelligence (BI) tool, the target data matching the key query information is searched in the preset multimodal fusion database; Based on the chart data mapping model, the target data is converted into a data display format of a target chart type to generate a visual data query result.

2. The data query method based on a large language model according to claim 1, characterized in that: The method of performing natural language analysis on a data query request initiated by a user through a client based on a large language model to obtain key query information further includes: When storing the data to be stored in the multimodal fusion database, performing semantic analysis on the data to be stored based on a natural language processing algorithm to obtain a semantic label for the data to be stored; generating a data label for the data to be stored based on the storage location information of the data to be stored in the multimodal fusion database and the semantic label; Based on the association relationship between the to-be-stored data of different data types in the multimodal fusion database and the data labels of the to-be-stored data, a data association index structure of the multimodal fusion database is constructed.

3. The data query method based on a large language model according to claim 2, characterized in that: When storing the data to be stored in the multimodal fusion database, performing semantic analysis on the data to be stored based on a natural language processing algorithm and obtaining a semantic label for the data to be stored, the method further includes: When acquiring the data to be stored, dividing the data to be stored into at least one data subset based on at least one data type corresponding to the data to be stored; Based on the sub-database corresponding to each of the data types in the multimodal fusion database, storing each of the data subsets respectively; Based on the storage location of each data subset of the data to be stored in each sub-database, storage location information corresponding to the data subset of the data to be stored is obtained.

4. The data query method based on a large language model according to claim 1, characterized in that: The method of searching for target data matching the key query information in a preset multimodal fusion database based on a business intelligence (BI) tool includes: Based on the self-attention mechanism algorithm of the business intelligence BI tool, the query language input by the user is semantically parsed to generate query semantics and statement query instructions; Based on the statement query instruction, target data matching the query semantics is searched from the multimodal fusion database.

5. The data query method based on a large language model according to claim 4, characterized in that: The self-attention mechanism algorithm based on the business intelligence (BI) tool performs semantic parsing on the query language input by the user to generate query semantics and statement query instructions, and further includes: Determining the target data type of the user query data based on the query semantics; Searching a preset chart template library for a target chart template that matches the target data type; determining the target data based on the target chart template and the target data type; Based on the statement query instruction, the target data is queried from the multimodal fusion database.

6. The data query method based on a large language model according to claim 5, characterized in that: Before searching for a target chart template matching the target data type in a preset chart template library, the method further includes: Obtaining at least one historical query data type corresponding to the historical query data, and at least one data display chart mode corresponding to the historical query data; Determining at least one chart template corresponding to each of the historical query data types based on a correspondence between each of the historical query data types and each of the data display chart modes; A chart template library is constructed based on at least one of the chart templates corresponding to each of the historical query data types.

7. The data query method based on a large language model according to claim 1, characterized in that: After searching for target data matching the key query information in a preset multimodal fusion database based on the business intelligence (BI) tool, the method further includes: When there is no target data matching the key query information in the multimodal fusion database, obtaining historical query data of the user; Analyze the historical query data based on the association rule mining algorithm to determine the user's data query preference information; Determining the user's current query intention based on the data query preference information and the key query information; Based on the BI tool, the multimodal fusion database is searched for target data that matches the current query intention.

8. A data query device based on a large language model, characterized in that: The data query device based on the large language model includes: The request analysis module is used to perform natural language analysis on data query requests initiated by users through the client based on a large language model to obtain key query information; A target data query module is used to query target data matching the key query information in a preset multimodal fusion database based on a business intelligence (BI) tool; The data display module is used to convert the target data into a data display format of a target chart type based on a chart data mapping model, and generate a visual data query result.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the data query method based on a large language model as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the data query method based on a large language model as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Data management method and device, equipment and storage medium

    CN121636508A