Large Language Model Conversational BI Data Query and Visualization Methods
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-01
- Publication Date
- 2026-08-14
AI Technical Summary
首先,用户输入往往是业务化表达,例如收益、趋势、按医院查看、使用率变化等,这些表达与底层业务统计字段之间并不存在稳定的一一对应关系,部分指标还需要按照预置业务口径由多个统计字段组合得到,如果直接从自然语言生成查询语句,容易出现指标口径误判、维度字段选择错误、时间范围理解不一致等问题
针对上述问题,本发明提供了大语言模型对话式BI数据查询与可视化方法,通过构建连续的语义传递与执行生成链路,有效解决了现有对话式BI技术中指标口径误判、查询字段与业务口径不一致及查询结果与图表结构割裂的问题。本发明利用大语言模型仅进行语义识别与结构化抽取,不直接生成查询语句,并结合预置业务配置进行规范化,将模糊业务表达稳定映射为确定的指标口径与统计维度,避免了自然语言直接转换的语义偏差与越权风险。同时,在生成数据查询对象时引入多维度候选路径综合评分机制,统筹考量语义继承、字段实现、统计粒度、可视化结构与路径复杂度,确保查询路径同时满足业务口径与图表展示需求。最后,通过执行统一的数据查询对象生成结果表与可视化结果,保证了底层数据与图表展示的高度一致性,提升了复杂业务场景下系统的准确性、安全性与工程可实施性。
Smart Images

Figure CN122570520A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer data processing and artificial intelligence technology, and in particular relates to a method for large language model-based conversational BI data query and visualization. Background Technology
[0002] As enterprise operational and equipment management data accumulates, business personnel increasingly prefer to directly query and visualize BI data through conversational interfaces. For example, in medical device leasing and equipment operation scenarios, users might ask questions such as viewing the revenue trends of a particular type of equipment leased by various institutions this year, comparing the usage of different equipment categories, or statistically analyzing maintenance cost changes over a specific timeframe. Existing conversational BI technologies typically handle these needs in two ways: one is by using large language models to directly convert natural language questions into database queries; the other is by generating query results and charts based on preset templates, field mapping tables, and chart recommendation rules. While these methods can automate certain aspects of scenarios with fixed fields, simple indicators, and clear query structures, they still have significant shortcomings in practical engineering applications. First, user input is often business-oriented, such as revenue, trends, viewing by hospital, and usage rate changes. These expressions do not have a stable one-to-one correspondence with the underlying business statistical fields. Some indicators also need to be combined from multiple statistical fields according to preset business definitions. If queries are directly generated from natural language, problems such as misjudgment of indicator definitions, incorrect selection of dimension fields, and inconsistent understanding of time ranges can easily occur. Secondly, BI queries differ from ordinary question-and-answer sessions. The final result needs to not only accurately retrieve business statistics but also generate suitable chart structures for display. Existing solutions often handle natural language parsing, query field generation, and chart generation separately. This results in queries that, while executable, may not have a structure that supports the target chart, or the chart display may not fully align with the user's initial analytical intent. Thirdly, in medical device leasing, equipment usage statistics, and system integration, data typically exists in the form of anonymized or aggregated statistical fields such as institution codes, equipment categories, time codes, revenue values, cost values, and usage frequency. Business personnel are unfamiliar with these fields and statistical granularities. The system needs to establish a continuous conversion relationship between user natural language, business indicator definitions, statistical data views, and visualization structures. Therefore, existing technologies still require a method to progressively convert the natural language BI intent recognized by the large language model into standardized execution definitions, executable data query objects, and visualized BI results. This would enable conversational BI systems to maintain consistency in semantic understanding, data querying, and chart display in complex business statistical scenarios. Summary of the Invention
[0003] This invention discloses a large language model-based conversational BI data query and visualization method to solve the above-mentioned problems in the prior art.
[0004] To achieve the above objectives, this invention provides a method for conversational BI data query and visualization using a large language model, the method comprising: It receives natural language questions, performs semantic recognition and structured extraction based on a large language model, and obtains business indicator expressions, business dimension expressions, time expressions and visualization intent expressions, forming a set of BI semantic objects and entity vectors; The BI semantic object and the entity vector set are matched with the preset business indicator configuration data. The business indicator expression is converted into a standard indicator standard, the business dimension expression is converted into a standard dimension code, and the time expression is converted into a specific time range to obtain the aggregation method and visualization type code, thus forming a standardized BI execution object. Based on the standardized BI execution object, candidate query paths are generated from the pre-set business statistics data view and field mapping configuration. The candidate query paths include the statistics data view identifier, query fields, calculated fields, grouping fields, time conditions, and result field structure. The candidate query paths are comprehensively scored, taking into account semantic inheritance score, field implementation relationship, statistical granularity consistency, visualization result structure, and path complexity. The candidate query path with the highest comprehensive score is selected to generate a data query object. The data query object is executed to obtain a query result table, and a visual BI result is generated based on the result field structure.
[0005] Furthermore, the semantic recognition and structured extraction based on the large language model includes: The natural language problem is segmented and business entity identified using a multi-layer Transformer model, which includes a word embedding layer, a context encoding layer, and an attention aggregation layer. The word embedding layer maps the identified entities into fixed-dimensional vectors; the context encoding layer captures the dependencies between entities through bidirectional self-attention; and the attention aggregation layer generates weights based on the semantic importance of entities in the sentence and the priority of business metrics. The entity vectors are aggregated into a unified semantic vector by weighted summation, and the unified semantic vector is mapped to the BI semantic object.
[0006] Furthermore, the matching of BI semantic objects and entity vector sets with pre-configured business indicator data includes: The business entities in the BI semantic object are matched with the standard items in the pre-set business indicator configuration data. The matching score is calculated based on the cosine similarity in the vector space model, and the entity weights and business rule matching items in the entity vector set are introduced. Set a minimum matching score threshold and a candidate gap threshold. When the highest matching score is lower than the minimum matching score threshold, or the score difference between the first two candidate criteria is less than the preset gap threshold, return a clarification question to the user.
[0007] Furthermore, the conversion of the time expression into a specific time range includes: The time expression is converted into a specific time range according to the system date and preset time conversion rules; When the user does not provide a time range, the default time range in the metric configuration will be used. When the time representation does not match the data granularity, it will be automatically adjusted to the granularity allowed by the configuration.
[0008] Furthermore, before generating candidate query paths, the method further includes: Filter accessible data views based on current user permissions, data anonymization rules, and business domain; Eliminate candidate query paths that require access to institutional scope, equipment category, or statistical fields that the user does not have permission to access.
[0009] Furthermore, in the comprehensive scoring of the candidate query paths: The semantic inheritance score is obtained by averaging the matching scores of the standard indicators, standard dimensions and visualization intents covered by the candidate query path in the normalized BI execution object. The relationship between the fields is determined by the field mapping configuration; The consistency of statistical granularity is determined by the statistical granularity of the pre-set business statistics data view and the aggregation method in the standardized BI execution object; The structure of the visualization results is determined by the adaptation relationship between the result fields of the candidate query path and the visualization type encoding; The path complexity is calculated by the number of statistical views, fields, and calculated items that the candidate query path needs to access.
[0010] Furthermore, the step of selecting the candidate query path with the highest comprehensive score to generate the data query object includes: When the overall score is lower than the minimum path score threshold, no candidate query path is selected; When the score difference between at least two candidate query paths is less than the preset tie threshold, the candidate query path with more complete field granularity, a result field structure that is more suitable for the chart, and a narrower permission range is selected first.
[0011] Furthermore, the execution data query object obtains a query result table, including: Before execution, verify the query data view identifier, fields, time conditions, permission flags, and query cost limits of the data query object; When the configuration version is invalid, the statistical data view is unavailable, user permissions have changed, the expected amount of returned data exceeds the upper limit, or the query timeout limit cannot be met, a configuration invalidation prompt, a permission change prompt, or a query range too large prompt will be returned. After verification, requests are only sent to read-only statistical views or read-only data service interfaces. The query is executed according to the query data view identifier, query fields, calculated fields, grouping fields, time conditions, filtering conditions, aggregation methods and sorting rules of the data query object record, and the query result table is formed.
[0012] Furthermore, before generating the visualized BI results, the method also includes: Calculate the overall adaptation score between the query result table and the visualization structure. The overall adaptation score is obtained by weighted summation of field completeness, time coverage continuity and display structure adaptability. When the overall adaptation score is lower than the preset visual adaptation threshold, a statistical table and the reason for the structural mismatch are returned.
[0013] Furthermore, the generation of visualized BI results based on the result field structure includes: When a specific month in the query results table is missing statistical records, the horizontal time axis is supplemented according to the time conditions in the data query object, and marked as empty or no statistical records in the corresponding position. When the number of groups exceeds the preset display range, the groups are sorted according to the summary results of the indicators, the main groups are displayed separately, and the groups other than the main groups are merged into a summary group.
[0014] The beneficial technical effects of the present invention are at least as follows: To address the aforementioned issues, this invention provides a large language model-based conversational BI data query and visualization method. By constructing a continuous semantic transmission and execution generation chain, it effectively solves the problems of misjudgment of indicator definitions, inconsistency between query fields and business definitions, and disconnect between query results and chart structures in existing conversational BI technologies. This invention utilizes a large language model for semantic recognition and structured extraction only, without directly generating query statements. It also standardizes the data using pre-configured business settings, stably mapping ambiguous business expressions to defined indicator definitions and statistical dimensions, avoiding semantic bias and overreach risks associated with direct conversion from natural language. Simultaneously, a multi-dimensional candidate path comprehensive scoring mechanism is introduced when generating data query objects, comprehensively considering semantic inheritance, field implementation, statistical granularity, visualization structure, and path complexity to ensure that the query path simultaneously meets both business definitions and chart display requirements. Finally, by executing a unified data query object to generate result tables and visualization results, a high degree of consistency between the underlying data and chart display is guaranteed, improving the accuracy, security, and engineering feasibility of the system in complex business scenarios. Attached Figure Description
[0015] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.
[0016] Figure 1 This is a scene diagram of the conversational BI data query and visualization system in an embodiment of the present invention.
[0017] Figure 2 This is a flowchart illustrating the overall process of the large language model-based conversational BI data query and visualization method in this embodiment of the invention.
[0018] Figure 3 This is a schematic diagram of a large language model-based conversational BI data query and visualization device. Detailed Implementation
[0019] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0020] With the continuous accumulation of enterprise operational and equipment operation data, business personnel increasingly prefer to directly query and visualize business intelligence (BI) data through dialogue. For example, in the medical device leasing and equipment operation scenarios, users may ask questions such as viewing the revenue trend of a certain type of equipment leasing in various institutions this year, comparing the usage of different equipment categories, and statistically analyzing the changes in maintenance costs over a certain time period.
[0021] Existing conversational BI technologies have at least the following problems: 1. User input is often a business-oriented expression, such as revenue, trend, viewing by hospital, usage rate changes, etc. There is no stable one-to-one correspondence between these expressions and the underlying business statistical fields. Some indicators need to be obtained by combining multiple statistical fields according to the preset business criteria. If the query statement is generated directly from natural language, it is easy to have problems such as misjudgment of indicator criteria, incorrect selection of dimension fields, and inconsistent understanding of time range.
[0022] 2. BI queries differ from ordinary Q&A. The final result needs to be able to accurately query business statistics and form a chart structure suitable for display. However, existing solutions often handle natural language parsing, query field generation, and chart generation separately. This results in the query being able to be executed, but the result field structure may not support the target chart, or the chart display may not be completely consistent with the user's original analysis intent.
[0023] 3. In medical device leasing, equipment usage statistics, and system integration, data is usually presented in the form of statistical fields such as de-identified or aggregated institution codes, equipment categories, time codes, revenue values, cost values, and usage frequency. Business personnel are not familiar with these fields and statistical granularity. The system needs to establish a continuous conversion relationship between user natural language, business indicator definitions, statistical data views, and visualization structures.
[0024] To address at least one or more of the aforementioned problems, at least one embodiment of this disclosure provides a large language model conversational BI data query and visualization method. The entire process is designed as a continuous semantic transmission and execution generation chain, enabling the conversational BI system to maintain consistency in semantic understanding, data query, and chart display in complex business statistical scenarios.
[0025] Figure 1 A scenario diagram of a conversational BI data query and visualization system according to at least one embodiment of the present disclosure is shown.
[0026] like Figure 1As shown, business personnel input natural language questions through a dialog interface, such as "Please display the rental revenue trend of patient monitors in various hospitals this year and draw a line chart by month." After receiving the natural language question, the system performs semantic recognition and structured extraction using a large language model to form a set of BI semantic objects and entity vectors. Subsequently, it performs normalization processing based on pre-configured business indicator data to generate normalized BI execution objects. Then, it generates data query objects based on the normalized BI execution objects. Finally, it executes the data query objects to obtain the query result table and generates a visualized BI result, which is returned to the business personnel. Throughout the process, the role of the large language model is focused on natural language BI intent recognition, while subsequent indicator normalization, query object generation, and chart generation are all driven by explicit business configurations, field mappings, and structured objects.
[0027] Figure 2 A general flowchart of a large language model conversational BI data query and visualization method according to at least one embodiment of the present disclosure is shown.
[0028] The method includes the following steps: In step 201, a natural language question is received, and semantic recognition and structured extraction are performed based on a large language model to obtain business indicator expressions, business dimension expressions, time expressions, and visualization intent expressions, forming a set of BI semantic objects and entity vectors.
[0029] In step 202, the BI semantic objects and entity vector sets are matched with the pre-set business indicator configuration data, the business indicator expressions are converted into standard indicator standards, the business dimension expressions are converted into standard dimension codes, and the time expressions are converted into specific time ranges to obtain the aggregation method and visualization type codes, thus forming a standardized BI execution object.
[0030] In step 203, based on the standardized BI execution object, candidate query paths are generated from the preset business statistics data view and field mapping configuration. The candidate query paths are comprehensively scored, and the candidate query path with the highest comprehensive score is selected to generate a data query object.
[0031] In step 204, the data query object is executed to obtain the query result table, and a visual BI result is generated based on the result field structure.
[0032] In step 201, specifically, the large language model is only used for semantic recognition and structured extraction of the user's natural language questions. It does not directly generate executable database query statements or directly access the business database. Before receiving user input, the system first obtains the user ID, role permissions, and accessible business domains of the currently logged-in user, and uses these as context constraints for this conversational BI request. If the user is not logged in, permission information is missing, or the current business domain does not have a configured statistical data view, the system will not call the subsequent query process, but will return a message indicating no permission or missing configuration. With this limitation, the semantic objects output by the large language model are only used as input for subsequent normalization processing; the actual query fields, statistical definitions, and visualization structures are still determined by the system configuration and permission rules.
[0033] The system receives natural language questions input by users through a dialog interface, such as "Please display the rental revenue trend of patient monitors in various hospitals this year, and draw a line graph by month," which is recorded as... Text can be obtained directly from the keyboard or converted into text information through speech recognition. The system... Word segmentation and business entity recognition are performed using a multi-layer Transformer model, including a word embedding layer, a context encoding layer, and an attention aggregation layer. The word embedding layer maps each identified entity to a fixed-dimensional vector. This is used to represent specific business metrics or dimensional features, such as rental revenue, hospitals, and months. The context encoding layer captures dependencies between entities through bidirectional self-attention, and the attention aggregation layer generates weights based on the semantic importance of entities in the sentence and the priority of business metrics. For example, the main analytical indicator, rental income, is assigned a value of 0.8, the hospital dimension is assigned a value of 0.5, and the month dimension is assigned a value of 0.4 to ensure that the main indicator makes a high contribution to the semantic representation.
[0034] The system also processes the input text. Perform safety and effectiveness preprocessing. If... If the query is empty, contains only greetings, contains database field names that attempt to bypass permissions, contains instructions to delete or modify data, or contains content unrelated to the current business domain, the system will not generate an executable semantic object. Instead, it will return a message indicating that additional business questions are needed or that the request is invalid. For text obtained through speech recognition, the system retains the speech recognition confidence level; if the confidence level is lower than a preset threshold, the user is required to confirm the text before proceeding to entity recognition. For follow-up questions within the same session, such as "Look back at last month" or "Change to a bar chart," the system will only inherit the metrics and dimensions from the previous round if the BI semantic object is still within the valid session window; otherwise, the user is required to explicitly specify the query object.
[0035] The entity vectors are aggregated into a unified semantic vector by weighted summation. The formula is as follows: ; In the above formula, and All data originates from business entities identified from user text and does not include actual database field values or query results. For non-negative weights, the controller or server can normalize or limit all weights to prevent abnormal amplification of the weight of a single entity, which could cause the semantic object to deviate from the user's intent. If the large language model fails to identify the indicator entity, or only identifies time or chart expressions without identifying business indicators, the system marks the request as missing indicators and does not proceed to the normalization execution object generation step 202. If multiple possible indicators are identified and their weights are similar, disambiguation continues in step 202 through standard indicator configuration, and a clarification question is returned if necessary.
[0036] in, From The first one identified in Each entity vector, generated by the word embedding layer, represents a specific business metric or dimensional feature. The weights calculated for the attention aggregation layer are determined by considering the entity's contextual position in the sentence and its business priority; summation symbol. This indicates a weighted summation of all identified entity vectors. The vectors are normalized before aggregation to ensure they participate in the weighted summation on the same numerical scale, guaranteeing a stable aggregation result. For example, for three entity vectors identified from the input text... Corresponding to rental income, hospital, and month, respectively, weighted. The aggregate vector is obtained by performing a weighted summation. Each element of the vector is the sum of the entity vectors of each dimension multiplied by their corresponding weights.
[0037] The system will aggregate vectors Mapping to BI semantic objects middle, The system records the business metrics, business dimensions, time-related information, and visualization intent expressions identified from users' natural language questions. For example, "rental revenue" is recorded as a business metric, "hospitals" as a business dimension, "this year" as a time-related information, and "draw a line chart by month" as a trend-based visualization intent. The system also generates... , Including all identified entity vectors and their corresponding weights This is used for standard item matching when generating standardized BI execution objects later. As an example, for the input text "Please display the rental revenue trend of patient monitors in various hospitals this year, and draw a line chart by month," the system obtains the standard item through weighted aggregation. Then, the semantic content reflected therein, such as "rental income," "hospital," "this year," and "monthly trend," was written into... And write the corresponding entity vectors and weights into The definition, dimension coding, specific time range, and chart type coding of the indicators will be determined in the subsequent standardization process.
[0038] BI semantic objects It also saves the original text, session number, user permission context, entity confidence score, whether it inherits from the previous context, and fields requiring clarification. If an entity is inherited from the context rather than directly identified from the current text, the system... The source of the data is marked, and subsequent steps will still require re-verification of permissions and configurations when generating the query object. Through this process, step 201 outputs an auditable semantic intermediate object, rather than an untraceable large model of free text results.
[0039] In step 202, specifically, this step is driven by rule-based business indicator configuration data. This configuration data is maintained by implementation personnel and confirmed by business definitions during the system deployment phase, and is not generated temporarily by the large language model. The configuration data includes at least the standard indicator code, standard indicator name, definition description, calculation expression identifier, allowed dimensions, allowed time granularity, allowed aggregation methods, visualization adaptation relationship, applicable business domain, and accessible role scope. When reading the configuration data, the system first filters indicators and dimensions that the current user is not authorized to access based on the user permission context in step 201. If a standard indicator, although semantically matching, is not within the user's accessible range, it will not be output as a candidate standard item. Through this filtering, the normalized object will not map the user's natural language intent to unauthorized data definitions.
[0040] The system outputs the BI semantic object in step 201. and entity vector set As input, business metrics, statistical dimensions, time representations, and visualization intents in user questions are standardized. The data already includes indicator names, dimension names, time representations, and chart intentions derived from natural language parsing, such as "rental revenue," "hospital," "this year," and "line trend." The corresponding entity vector is stored in it. and its attention weight in the original problem For example, the entity vectors and weights corresponding to "lease revenue," "hospital," and "month" or "trend" are specified. The system reads pre-configured business indicator data, which is maintained by the implementation personnel during the system deployment phase. This configuration data includes the standard indicator name, indicator calculation method, allowed statistical dimensions, supported time granularity, and visualization adaptation relationships. For example, in the medical device lease statistics scenario, the standard indicator "lease revenue" corresponds to lease income minus maintenance costs, with allowed dimensions including institution code, equipment category, and month. Supported chart types include trend charts and category comparison charts. The system will... Each business entity in the configuration data is matched against a standard item in the configuration data, and then... The entity vectors and weights in the calculation are used to ensure that the semantic strength and weakness relations obtained in step 201 can continue to affect the standardization results of this step.
[0041] The matching calculation is based on cosine similarity in the vector space model. Cosine similarity measures the degree of consistency between the directions of two vectors and is suitable for judging semantically similar but literally different expressions such as "rental revenue" and "rental income minus maintenance costs". This application makes two modifications based on this: First, the cosine similarity is converted to a uniform non-negative scale to facilitate the ranking of matching results; second, the entity weights obtained in step 201 are introduced. Matching items with business rules This ensures that key analytical indicators and standard items conforming to business definitions receive higher matching scores. The specific calculation is as follows: ; In the above formula, It comes from a pre-built standard item vector library, which is generated using the same encoding method as the word embedding layer and is recalculated after the configuration version is updated. These are not model-inferred values, but rather generated from synonyms, definitions, and applicable business domain rules in the business configuration. If or If the entity vector is empty, or the entity vector confidence score is below a preset threshold, then the entity will not participate in automatic matching. The system also sets a minimum matching score threshold and a candidate gap threshold; if the highest score is lower than the minimum threshold, or the score difference between the first two candidate criteria is too small, the execution object will not be generated directly, but a clarification question will be returned to the user, such as asking the user to confirm whether "revenue" refers to rental income, rental income minus maintenance costs, or net profit.
[0042] in, Indicates the first The user entity and the first The matching score between the standard items is used to determine which standard indicator or standard dimension the entity should be mapped to. Output from step 201 , indicating the first The importance of each entity in the original natural language problem; Output from step 201 , indicating the first A vector of entities; This indicates the first [item] in the pre-configured business indicator data. A vector of standard items, which is obtained by encoding the standard indicator name, standard dimension name or standard chart intent by the same word embedding layer; This represents the business rule matching item, generated from pre-configured business indicator data. It takes a value of 1 when the user entity and the standard item directly correspond in terms of business scope, 0.5 when correspondence is required through pre-configured synonyms or definitions, and 0 when they do not belong to the same business analysis scope. The two numerical weights in the formula are used to ensure that semantic similarity plays a major role, while retaining the constraint of business rules on the definition of medical device leasing indicators. All vectors and rule items involved in the calculation have been normalized; therefore, the calculation result is the matching score used for ranking. Taking "leasing revenue" as an example, if its entity weight... The similarity is 0.8, and the cosine similarity with the standard item "rental income minus maintenance costs" is 0.84. Furthermore, this standard item is marked as a direct correspondence in the configuration data. If we take 1, then If the cosine similarity with another standard item, "number of times the device is used," is 0.41, and the business rule matching item is 0, then the corresponding score is... Based on this, the system selects "rental income minus maintenance costs" as the standard indicator for this entity.
[0043] The system processes the data according to the matching scores mentioned above. The system defines the metrics, dimensions, and visualization intents. For metric entities, the system selects the standard metric with the highest score and reads its execution scope. For dimension entities, the system selects the standard dimension code with the highest score that falls within the allowed dimension range for that metric. For time representation, the system generates a specific time range based on the system date and preset time conversion rules. For example, "this year" is converted to January 1st to December 31st of the current year in the current year scenario, and "last month" is converted to the start and end dates of the previous calendar month. For visualization intents, the system determines the type of chart to be executed based on the data type, number of dimensions, and time granularity of the standard metric. For example, when the metric is a numerical metric and the dimension includes months, a trend-based intent is mapped to a line chart; when the metric is a numerical metric and the dimension is an institutional code, a classification comparison intent is mapped to a bar chart. In the medical device leasing business, users often use expressions such as "decline in revenue", "change in utilization rate", and "equipment distribution". These expressions are often not database field names. The system uses standard indicators to classify them into statistical categories in the configuration data. For example, "decline in revenue" is classified into rental income minus maintenance costs and compared by month, and "equipment distribution" is classified into aggregated statistics of equipment category and institution code. This converts the business language into an execution description that can be used to generate query objects.
[0044] Time expression parsing also requires consideration of the system time zone, session date, and data update cycle in the configuration. If the user says "this year," the system uses the calendar year of the server's business date or the fiscal year specified in the configuration as the time range; if the user says "the last three months," the system determines the start and end dates by scrolling backwards from the current business date; if the user does not specify a time range, the system uses the default time range in the indicator configuration and... The time is marked as the default. If the time representation does not match the data granularity, for example, if the user requests to view by day but the standard statistical view only supports monthly granularity, the system will automatically upgrade or downgrade to the configured granularity and... Record the reason for the granularity adjustment and require user confirmation when necessary.
[0045] The system ultimately generates standardized BI execution objects. . It consists of standard indicator definitions, standard dimension codes, specific time ranges, aggregation methods, visualization type codes, and matching scores, where the standard indicator definitions are derived from... The highest score matching result between the indicator entity and the configuration data standard item, the standard dimension code comes from The matching results between mid-dimensional entities and configuration data dimension items, with the specific time range derived from... The parsing results of the time expression are aggregated using a method that comes from the preset statistical methods in the standard indicator configuration, and the visualization type encoding comes from... The matching results between the visualized intent and the adaptation relationship in the configuration data. Continuing with the user question mentioned above, The indicator in the data is rental income minus maintenance costs, with dimension codes of institution and month, a time range from January 1st to December 31st of the current year, aggregation by institution and month, and visualization type code of line trend chart. Therefore, the natural language semantic object obtained in step 201 is converted into an execution-oriented normalized object and used as direct input for generating the data query object in step 203.
[0046] This also includes configuration version number, permission filtering results, matching threshold status, default item source, time granularity adjustment records, and user clarification status. If any standard indicator caliber, standard dimension code, time range, or visualization type code cannot be determined, the system will not proceed to step 203, but will instead return structured prompts such as missing indicator, missing dimension, unclear time, or unsupported chart. Through this processing, step 202 outputs a standardized execution object constrained by business configuration and permissions, rather than a free-form query intent directly inferred from a large language model.
[0047] In step 203, specifically, this step generates controlled data query objects, not directly concatenated free SQL. The system only allows the selection of query elements from pre-defined business statistics data views, field mapping configurations, and indicator calculation expression whitelists, and prohibits the direct use of text output from large language models as table names, field names, calculation expressions, or filter conditions into the database. If the standard metrics, dimensions, time ranges, or visualization type codes in the code fail the configuration and permission verification in step 202, the system will not generate the necessary data. This limitation allows the generation process of data query objects to be audited and reproduced, and also prevents injected content in natural language input from affecting the underlying data query.
[0048] The system outputs the normalized BI execution object in step 202. As input, The established standard indicator definitions, standard dimension codes, specific time ranges, aggregation methods, visualization type codes, and matching scores are converted into data query objects. In the complete process, step 201 forms a semantic expression of the user's natural language question; step 202 converts this semantic expression into an executable business statistical framework; and step 203 maps this business statistical framework to the fields, calculation items, filtering conditions, and result field structures in the business statistics data view. The system reads the pre-set business statistics data view and field mapping configuration. The business statistics data view is established during the system implementation phase and stores aggregated data for equipment leasing and usage statistics, such as institution code, equipment category code, month code, leasing revenue value, maintenance cost value, and usage frequency value. The field mapping configuration records the correspondence between standard indicator criteria, standard dimension codes, statistical fields, calculation fields, and aggregable granularities. Taking "Viewing the trend of patient monitor leasing revenue in various hospitals this year" as an example... The standard indicator in the data is rental revenue minus maintenance costs. The standard dimension codes are institution code and month code, with a specific time range from January to December of the current year. The aggregation method is summarizing by institution and month, and the visualization type is a line trend chart. Based on this, the system retrieves candidate field combinations from the field mapping configuration that can achieve this statistical scope, forming several candidate query paths. Each candidate query path includes a statistical data view identifier, a set of query fields, a set of calculation fields, a set of grouping fields, a time condition, and a result field structure. For example, one candidate query path reads the rental revenue value, maintenance cost value, institution code, and month code from the equipment rental statistics view, then sums them by institution code and month code to calculate rental revenue; another candidate query path reads the revenue summary value and institution code from the revenue summary view, but further determination is needed to determine whether it has a month field and whether it can support a trend chart display.
[0049] Before generating candidate query paths, the system filters accessible data views based on current user permissions, data anonymization rules, and business domain. In medical device leasing scenarios, institution codes, equipment categories, and revenue data can come from anonymized or aggregated statistical views; the system does not directly access original tables containing sensitive details such as patient, doctor, or contract details. If a candidate path requires access to institution scopes, equipment categories, or statistical fields that the user is not authorized to access, that path is immediately eliminated and not included in subsequent scoring. If a candidate path needs to link multiple views, the system also checks whether the association key is a permissible association key in the field mapping configuration, prohibiting the temporary inference of association conditions based on natural language.
[0050] The candidate query paths are ranked using a multi-criteria weighted scoring method. This method originates from the linear weighted summation model in mathematical decision analysis, where multiple normalized evaluation items are added together according to set weights to obtain a comprehensive ranking score. For the conversational BI query scenario of this application, the system extrapolates from this original model: first, it uses field implementation relationships, statistical granularity consistency relationships, and visualization result structure relationships as three evaluation items, and then introduces them into the data stored in step 202. The matching score within the query path is used as a semantic inheritance factor, allowing the reliability of the matching of indicators and dimensions obtained in the previous step to continue participating in query path selection. Simultaneously, a path complexity penalty is added, reducing the priority of paths with a large number of accessed views, field combinations, and calculated items during sorting. The comprehensive score is calculated as follows: ; In the above formula, , , and All of these are calculated from field mapping configurations, statistical view metadata, and visualization structure rules, and are not freely provided by the large language model. , , The value range is limited to between 0 and 1. It is a non-negative complexity value. This is a non-negative complexity adjustment coefficient. If a candidate path lacks the core fields required to achieve the standard metric, or lacks the necessary fields required for the visualization type, then the corresponding... or You can directly return zero, and this path can be marked as an inexecutable path. If all candidate paths are inexecutable, the system will not generate a query object, but will return a message indicating that the current business configuration cannot support this issue.
[0051] in, Indicates the first The combined score of the candidate query paths is used to compare the priorities of different candidate paths; Indicates the first Candidate query paths The semantic inheritance score of a standard element is determined by the standard indicators, standard dimensions, and visualization intents covered by this path. The average of the corresponding matching scores is obtained. For example, when the path simultaneously covers rental income, institution code, month code and line trend chart, the average result of the matching scores of these standard elements is taken. This indicates the field implementation item, provided by the field mapping configuration. It is used when a field in the candidate path can be directly implemented. When encoding the caliber and dimension of indicators, a higher proportion value is used. When an indicator needs to be calculated by combining two statistical fields, a middle proportion value is used. For example, rental income and maintenance cost value together realize rental revenue. This indicates items with consistent query granularity, determined by the statistical granularity of the business statistics view and... The aggregation method is jointly determined. For example, when the institution code, month code, rental income value, and maintenance cost value in the candidate path are all at the statistical granularity of institution plus month, a higher proportion value is taken. This represents the structure of the visualization results, consisting of the candidate path output fields and... The adaptation relationship of the visualization type code is determined. For example, a line trend chart requires a time field, a numerical field, and a grouping field. When the candidate path contains a month code, a rental income calculation field, and an institution code, the higher proportion value is taken. The path complexity term is calculated by the number of statistical views, fields, and computed items that the candidate path needs to access. This represents the complexity adjustment coefficient. All terms involved in the calculation use normalized proportional values, therefore... For ranking scores on the same numerical scale, the left and right sides of the formula maintain a consistent scalar form. The three weighting terms in the formula correspond to whether the field can achieve the business definition, whether the query can be aggregated at the correct granularity, and whether the result field can support chart display. The complexity penalty term is used to ensure that the system prioritizes paths with clear structure and low execution cost.
[0052] Following the above equipment rental statistics example, candidate path one uses the rental revenue value, maintenance cost value, organization code, and month code from the equipment rental statistics view. The average of the indicators, dimensions, and chart intent matching scores in step 202 is then used to obtain... Since rental income needs to be calculated by combining rental revenue and maintenance costs, the field implementation item... The revenue, cost, organization, and month in this path are all at the same aggregation granularity, and the query granularity is consistent. This path outputs the month code, institution code, and rental income value, supporting line trend charts and visualizing the result structure items. This path accesses a statistics view and contains a calculation item and a complexity item. Take the complexity adjustment coefficient. Then there is Candidate path two uses the revenue summary value and institution code from the revenue summary view, with semantic inheritance score. Field implementation items However, this path lacks complete month granularity; queries for items with consistent granularity are needed. Visualization results structure items Complexity term Then there is The two calculation results show that candidate path one simultaneously satisfies the indicator scope, statistical granularity, and trend chart field structure, and is therefore more suitable as the final query path.
[0053] After obtaining the comprehensive score of each candidate query path, the system uses the maximum value selection method in discrete optimization to determine the final query path. The maximum value selection method is used to select the candidate with the highest objective function value from a finite candidate set. This application uses the aforementioned comprehensive score as the objective function, forming the following selection formula: ; When performing maximum value selection, the system also sets a minimum path score threshold and rules for handling parallel paths. If the highest... If the score is below the minimum path score threshold, no path will be selected. If the score difference between two or more candidate paths is less than the preset tie threshold, the path with more complete field granularity, a result field structure more suitable for the chart, and a narrower permission range will be prioritized, or a prompt requiring administrator confirmation of field mapping configuration will be returned. Selected Path It is also necessary to check the query cost limits, such as ensuring that the expected number of rows returned, the number of groups, and the time range do not exceed the system's configured limits; if the limits are exceeded, the system requires the user to narrow down the time range or reduce the dimensions.
[0054] in, Indicates the selected candidate query path number; This indicates selecting from all candidate query paths. The path to obtain the maximum value; It is calculated from the previous formula. The logical relationship between the two formulas is that the first is based on... The field mapping configuration calculates the comprehensive score for each candidate query path, then selects the path with the highest comprehensive score from the candidate path set, and converts that path into a data query object. In the aforementioned calculation example, Greater than ,therefore For candidate path one, the system selects the rental income value, maintenance cost value, organization code, and month code from the equipment rental statistics view as the core fields of the data query object.
[0055] The system is based on the selected path Generate data query object . The query data view identifier, query fields, calculated fields, grouping fields, time conditions, filter conditions, aggregation methods, sorting rules, and result field structures are stored in structured parameter format. The query data view identifier comes from... The corresponding statistical data view, such as the equipment rental statistics view; the query fields are combinations of fields from this path, such as organization code, month code, rental revenue value, and maintenance cost value; the calculation fields are based on... The standard indicator definitions are generated, for example, rental revenue is the sum of rental income values minus the sum of maintenance costs; grouping fields are based on... Standard dimension encoding is generated, such as organization encoding and month encoding; time conditions are based on... The specific time range is generated, for example, the month code falls between January and December of the current year; the aggregation method is based on... Generates results using aggregation methods, such as summarizing by organization and month; the structure of the result fields is based on... The visualization type is encoded, such as the month code, institution code, and rental income value corresponding to a line trend chart. If... Expressed as a database query, its semantics are: to read the organization code, month code, rental income value, and maintenance cost value from the equipment rental statistics view; group by organization code and month code; summarize the rental income value and maintenance cost value separately; and output the difference between the two. These are expressed as data service interface parameters, including view identifier, indicator definition code, dimension code, time range, aggregation method, and result field structure. Therefore, step 203 standardizes the BI execution object. The metrics, dimensions, time, aggregation, and visualization constraints in the data are uniformly converted into executable data query objects. and will This serves as the direct input for the actual query and generation of the visualized BI results in step 204.
[0056] This also includes query execution identifier, configuration version number, permission verification result, field masking flag, expected maximum number of rows returned, timeout limit, and audit log identifier. If Ultimately, it is converted into an SQL statement, and the conversion process can only be performed by the system's query generator. Structured fields are generated and parameterized conditions are used to express time ranges and filtering criteria; the user's original text and the output text of the large language model are not concatenated as SQL fragments. When expressed as a data service interface parameter, the interface only accepts the metric code, dimension code, and time range allowed in the configuration. This process allows data query objects to support both database execution and data service execution, while maintaining clear field origins and permission boundaries.
[0057] In step 204, specifically, before this step is executed, the system performs another verification. The query data view identifier, fields, time conditions, permission flags, and query cost limits. If If the configuration version is outdated, the statistical data view is unavailable, user permissions have changed, the expected amount of data to be returned exceeds the limit, or the query timeout limit cannot be met, the system will not execute the underlying query, but will instead return a message indicating that the configuration is outdated, permissions have changed, or the query scope is too large. When executing a query, the system only makes requests to the read-only statistical view or read-only data service interface, and does not perform write, update, delete, or structure change operations.
[0058] The system queries the data output in step 203. As input, according to The system executes the actual query based on the recorded query data view identifier, query fields, calculated fields, grouping fields, time conditions, filter conditions, aggregation methods, sorting rules, and result field structure, and generates a query result table. During execution, the system first... The query data view identifier in the text calls the corresponding business statistics data view or data service interface, such as the equipment rental statistics view; then according to... The query fields read statistical fields such as organization code, month code, rental income value, and maintenance cost value; then, based on... The time condition in the query limits the range, for example, limiting the month code to January to December of the current year; then according to The grouping field in the code groups the statistical data, for example, by organization code and month code to form different statistical groups; finally, according to... The aggregation method and calculated fields in the dataset generate the target indicator results. Taking "Trends in Patient Monitor Rental Revenue of Various Hospitals This Year" as an example... The calculated field indicates the total rental income minus the total maintenance costs. Under each institution code and month code combination, the system first summarizes the rental income and maintenance costs within that combination, then calculates the difference to form the institution's rental income for that month. For example, if an institution's total rental income in March is 120,000 and its total maintenance costs are 18,000, then the institution's rental income for March is 102,000; if the same institution's total rental income in April is 135,000 and its total maintenance costs are 22,000, then the rental income for April is 113,000. In this way, Each row in the text corresponds to a character. Specify the statistical groupings and retain the month codes, institution codes, and rental income values required for subsequent charts.
[0059] Query results table After generation, the system checks the result fields and data quality. If... If empty, the system will determine the result based on the following: The time and filter conditions return no data results, but retain the chart placeholder description; if China lacks For fields that meet the requirements, no charts will be generated, and a query result structure mismatch warning will be returned. If a numeric field contains null values, abnormal negative values, or values exceeding the range allowed by the business configuration, null values will be retained, zeroed out, removed, or marked as abnormal according to the business configuration. For de-identified fields such as organization codes and equipment category codes, the system will only display the de-identified names allowed by the configuration or the authorized mapping names, and will not expose the original sensitive identifiers to unauthorized users.
[0060] The system obtains the query results table Afterwards, according to Generate visualized BI results from the result field structure. . The structure of the resulting fields has already been determined by the visual type encoding in step 203, therefore the system will The fields in the chart are directly mapped to the fields displayed in the chart. For example, when When the visualization type is a line chart, the system maps the month code to a horizontal field, the rental income value to a vertical field, and the institution code to a legend grouping field, and then follows the pattern... The sorting rules in the table arrange the months in chronological order. This is to ensure the query results table... The system can reliably generate readable charts. and The degree of fit between the result field structures is quantitatively judged. This judgment uses a linear weighted summation model from mathematical decision analysis as the initial source, that is, multiple normalized evaluation items are combined into a comprehensive score according to their weights. In this application, the model is modified to adapt to the execution of conversational BI visualization, taking field completeness, time coverage continuity, and display structure adaptability as evaluation items to ensure consistency between query results, timelines, and chart structures. The calculation formula is as follows: ; In the above formula, , and All are normalized values between 0 and 1, from Result field structure and The actual fields, time coverage, and grouping structure are calculated. If If empty, then It can be recorded as zero or enter the branch with no data displayed; if the field is complete... A value of zero indicates that a necessary field is missing, and the system will not generate a chart. The system allows setting a visualization adaptation threshold; when... When the value is below this threshold, a chart is not forcibly generated; instead, a statistical table and the reason for the structural mismatch are returned. When the data is in the middle range, the system can generate a chart with missing markers or explanatory notes.
[0061] in, Represents the query result table The overall fit score between the chart and the visualization structure is used to determine whether timeline completion, grouping and merging, or display markers are needed when generating the chart. Indicates field integrity, by The actual fields included in the middle and The results are obtained by comparing the fields required by the structure of the result field, for example... The requirements include three fields: month code, organization code, and rental income value. When all are included, the higher proportion value is taken; Indicates the continuity of time coverage, by Time field coverage The degree of time condition is obtained, for example The requirement is twelve months. When covering eleven months, take a proportion that is close to complete. This indicates the adaptability of the display structure, by The number of groups, grouping fields, and numeric fields are related to The degree of matching required by the chart type is obtained. For example, a line trend chart requires a time field, a numerical field, and a legend grouping field. When all three can be matched, a higher proportion value is taken. All evaluation items use normalized proportion values. The left and right sides of the formula are scalar scores under the same scale. The calculation results are used for display processing during the visualization generation process. Continuing with the equipment rental statistics scenario, if... If the complete data includes the month code, institution code, and rental income value, then... If statistical records exist for eleven out of twelve months, then... If the number of institutions is within the preset line chart display range and the field structure meets the requirements for time field, numerical field, and legend field, then... Substituting into the formula, we get The result indicates It has a high degree of compatibility with the structure of line trend charts. Based on this, the system generates continuous monthly coordinates, retains null value marks for months with missing statistical records, and generates multiple trend lines according to the institution code.
[0062] The system generates the final visualized BI results based on the above adaptation results. . This includes a statistical results table, chart types, horizontal fields, vertical fields, legend fields, titles, and displayed data. For the above embodiment, The chart type is a line chart, with the horizontal field being the month code, the vertical field being the rental income value, the legend field being the institution code, and the title being... The data is formed by combining the indicators, time conditions, and dimensional information, such as "the trend of patient monitor rental revenue for various institutions in the current year." When a certain month lacks statistical records, the system will use the following method: The time conditions in the data are used to supplement the horizontal timeline, and are marked as null values or no statistical records in the corresponding positions; when the number of institutions exceeds the preset display range, the system sorts the institutions according to the rental revenue summary results, displays the main institutions separately, and merges the remaining institutions into a summary group; when When multiple statistical records from the same institution for the same month exist, the system will follow the rules. The aggregation method in the code is used to summarize the data before generating the chart data. Finally, the data query object... The actual execution is the query result table. Query results table Converted into visual BI results Users can directly view statistical tables and charts in the dialog interface.
[0063] Visualizing BI Results It also includes result interpretation information and traceability information. Result interpretation information includes the standard indicator caliber used, time range, aggregation method, chart type, handling method for missing months, and grouping and merging rules; traceability information includes the session number, configuration version number, query object number, query execution time, data update time, and permission filtering results. If the user continues to ask "only view the first three institutions" or "change to a bar chart," the system can, based on... The traceability information and the previous round A new normalized object is generated, but permission verification and visual structure adaptation judgment still need to be re-executed.
[0064] As a complete example, after a user inputs "Please display the rental revenue trend of patient monitors in various hospitals this year, and draw a line chart by month," the system first uses a large language model to identify semantics such as "rental revenue," "hospital," "this year," and "monthly trend," and then forms a... and Subsequently, based on the business indicator configuration, "lease revenue" was standardized to "summary lease income minus summary maintenance costs," "hospital" was mapped to institution code, "this year" was converted to January to December of the current year, and the visualization intent was mapped to a line trend chart, generating... Next, the system selects a query path containing rental income, maintenance cost, organization code, and month code from the equipment rental statistics view that the user has permission to access, and generates a structured query object. Finally, the system executes... Get the query results table A line trend chart is generated based on the month code, institution code, and rental income value. Throughout the process, the large language model does not directly generate SQL; database query fields are derived from the whitelist field mapping configuration, and chart fields are derived from... The result field structure ensures consistency between natural language, business definitions, query objects, and visualization results.
[0065] The above method can be executed by the following modules in the system: dialogue input module, semantic recognition module, business configuration management module, standardized execution object generation module, query path scoring module, query object generation module, query execution module, visualization adaptation module, chart generation module, permission auditing module, and exception handling module. The dialogue input module receives text or speech-to-text transcription; the semantic recognition module generates... , and The business configuration management module is used to maintain standard indicators, dimensions, definitions, and visual adaptation relationships; the standardized execution object generation module is used to generate... The query path scoring module is used for calculation. And select $l^\*$; the query object generation module is used to generate The query execution module is used to execute read-only statistical queries and obtain results. The visualization adaptation module is used for calculation. The chart generation module is used to generate charts. The permission auditing module records user permissions, configuration versions, and query objects; the exception handling module handles situations such as lack of permissions, missing indicators, non-executable paths, query timeouts, no data, and incompatible chart structures.
[0066] Figure 3 A block diagram of a large language model conversational BI data query and visualization apparatus according to at least one embodiment of the present disclosure is shown.
[0067] like Figure 3 As shown, the apparatus may include a processor; a storage medium coupled to the processor and storing computer-executable instructions therein for performing steps of various methods of at least one embodiment of the present disclosure when executed by the processor.
[0068] The processor may include, but is not limited to, one or more processors or microprocessors.
[0069] Storage media may include, but are not limited to, random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, and computer storage media (such as hard disks, floppy disks, solid-state drives, removable discs, CD-ROMs, DVD-ROMs, Blu-ray discs, etc.).
[0070] In addition, the device may include (but is not limited to) a data bus, an input / output bus, a display, and input / output devices (e.g., a keyboard, a mouse, a speaker, etc.).
[0071] The processor can communicate with external devices via the I / O bus through wired or wireless networks.
[0072] The storage medium may also store at least one computer-executable instruction for performing the steps of various functions and / or methods in the embodiments described in this technology when executed by a processor.
[0073] In one embodiment, a computer-readable storage medium is provided on which instructions are stored, such as computer-readable instructions. When the computer-readable instructions are executed by a processor, the various methods described above can be performed. The computer-readable storage medium includes, but is not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0074] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner.
[0075] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A large language model-based conversational BI data query and visualization method, characterized in that: include: It receives natural language questions, performs semantic recognition and structured extraction based on a large language model, and obtains business indicator expressions, business dimension expressions, time expressions and visualization intent expressions, forming a set of BI semantic objects and entity vectors; The BI semantic object and the entity vector set are matched with the preset business indicator configuration data. The business indicator expression is converted into a standard indicator standard, the business dimension expression is converted into a standard dimension code, and the time expression is converted into a specific time range to obtain the aggregation method and visualization type code, thus forming a standardized BI execution object. Based on the standardized BI execution object, candidate query paths are generated from the pre-set business statistics data view and field mapping configuration. The candidate query paths include the statistics data view identifier, query fields, calculated fields, grouping fields, time conditions, and result field structure. The candidate query paths are comprehensively scored, taking into account semantic inheritance score, field implementation relationship, statistical granularity consistency, visualization result structure, and path complexity. The candidate query path with the highest comprehensive score is selected to generate a data query object. The data query object is executed to obtain a query result table, and a visual BI result is generated based on the result field structure.
2. The large language model conversational BI data query and visualization method according to claim 1, characterized in that, The semantic recognition and structured extraction based on the large language model includes: The natural language problem is segmented and business entity identified using a multi-layer Transformer model, which includes a word embedding layer, a context encoding layer, and an attention aggregation layer. The word embedding layer maps the identified entities into fixed-dimensional vectors; the context encoding layer captures the dependencies between entities through bidirectional self-attention; and the attention aggregation layer generates weights based on the semantic importance of entities in the sentence and the priority of business metrics. The entity vectors are aggregated into a unified semantic vector by weighted summation, and the unified semantic vector is mapped to the BI semantic object.
3. The large language model conversational BI data query and visualization method according to claim 1, characterized in that, The process of matching BI semantic objects and entity vector sets with pre-configured business indicator data includes: The business entities in the BI semantic object are matched with the standard items in the pre-set business indicator configuration data. The matching score is calculated based on the cosine similarity in the vector space model, and the entity weights and business rule matching items in the entity vector set are introduced. Set a minimum matching score threshold and a candidate gap threshold. When the highest matching score is lower than the minimum matching score threshold, or the score difference between the first two candidate criteria is less than the preset gap threshold, return a clarification question to the user.
4. The large language model conversational BI data query and visualization method according to claim 1, characterized in that, The process of converting the time expression into a specific time range includes: The time expression is converted into a specific time range according to the system date and preset time conversion rules; When the user does not provide a time range, the default time range in the metric configuration will be used. When the time representation does not match the data granularity, it will be automatically adjusted to the granularity allowed by the configuration.
5. The large language model conversational BI data query and visualization method according to claim 1, characterized in that, Before generating candidate query paths, the method further includes: Filter accessible data views based on current user permissions, data anonymization rules, and business domain; Eliminate candidate query paths that require access to institutional scope, equipment category, or statistical fields that the user does not have permission to access.
6. The large language model conversational BI data query and visualization method according to claim 1, characterized in that, In the comprehensive scoring of the candidate query paths: The semantic inheritance score is obtained by averaging the matching scores of the standard indicators, standard dimensions and visualization intents covered by the candidate query path in the normalized BI execution object. The relationship between the fields is determined by the field mapping configuration; The consistency of statistical granularity is determined by the statistical granularity of the pre-set business statistics data view and the aggregation method in the standardized BI execution object; The structure of the visualization results is determined by the adaptation relationship between the result fields of the candidate query path and the visualization type encoding; The path complexity is calculated by the number of statistical views, fields, and calculated items that the candidate query path needs to access.
7. The large language model conversational BI data query and visualization method according to claim 1, characterized in that, The step of selecting the candidate query path with the highest comprehensive score to generate a data query object includes: When the overall score is lower than the minimum path score threshold, no candidate query path is selected; When the score difference between at least two candidate query paths is less than the preset tie threshold, the candidate query path with more complete field granularity, a result field structure that is more suitable for the chart, and a narrower permission range is selected first.
8. The large language model conversational BI data query and visualization method according to claim 1, characterized in that, The execution data query object obtains a query result table, including: Before execution, verify the query data view identifier, fields, time conditions, permission flags, and query cost limits of the data query object; When the configuration version is invalid, the statistical data view is unavailable, user permissions have changed, the expected amount of returned data exceeds the upper limit, or the query timeout limit cannot be met, a configuration invalidation prompt, a permission change prompt, or a query range too large prompt will be returned. After successful verification, requests are only sent to read-only statistical views or read-only data service interfaces. The query is executed according to the query data view identifier, query fields, calculated fields, grouping fields, time conditions, filtering conditions, aggregation methods, and sorting rules of the data query object record, forming the query result table.
9. The large language model conversational BI data query and visualization method according to claim 1, characterized in that, Before generating visualized BI results, the method further includes: Calculate the overall adaptation score between the query result table and the visualization structure. The overall adaptation score is obtained by weighted summation of field completeness, time coverage continuity and display structure adaptability. When the overall adaptation score is lower than the preset visual adaptation threshold, a statistical table and the reason for the structural mismatch are returned.
10. The large language model conversational BI data query and visualization method according to claim 1, characterized in that, The generation of visualized BI results based on the result field structure includes: When a specific month in the query results table is missing statistical records, the horizontal time axis is supplemented according to the time conditions in the data query object, and marked as empty or no statistical records in the corresponding position. When the number of groups exceeds the preset display range, the groups are sorted according to the summary results of the indicators, the main groups are displayed separately, and the groups other than the main groups are merged into a summary group.