An intelligent question-answering system based on unified industry and finance semantic layer
Patent Information
- Application Number
- CN202610985953.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-03
- Publication Date
- 2026-10-23
AI Technical Summary
[0002]企业内部业财数据分散存储于ERP、CRM、财务系统、OA系统等多源异构平台,数据格式、计算口径与存储结构差异显著,形成大量数据孤岛,导致跨系统数据整合难度大、一致性差
1.本发明通过统一业财语义层模块,将ERP、CRM、财务系统、OA系统等多源异构业财数据转化为标准化语义模型,完成业务术语、指标、数据集的统一抽象管理,有效打破企业内部数据孤岛,解决了传统模式下数据分散、格式不一、口径混乱、难以融合的痛点;同时实现业务语言与技术逻辑的双向精准映射,建立标准化术语库适配企业私域知识,让业务人员无需掌握SQL等技术知识,直接用日常业务语言即可查询数据,彻底改变了依赖技术人员写数、取数的传统模式,大幅降低数据使用门槛,提升业财数据的易用性与复用性。
Smart Images

Figure CN122964093A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent querying of business and financial data, specifically to an intelligent querying system based on a unified business and financial semantic layer. Background Technology
[0002] Enterprise internal business and financial data are scattered across multiple heterogeneous platforms such as ERP, CRM, financial systems, and OA systems. Significant differences in data format, calculation methods, and storage structures create numerous data silos, leading to difficulties in cross-system data integration and poor consistency. Traditional data query models prevent business personnel from directly using business language to retrieve data, requiring technical personnel to write SQL statements. This results in high communication costs, long response times, and low demand matching, failing to meet the needs of real-time enterprise decision-making. Existing intelligent data query solutions generally lack a unified business semantic abstraction layer, resulting in a severe disconnect between business language and underlying technical logic. Furthermore, they cannot effectively adapt to enterprise private domain business terminology, leading to low accuracy in natural language intent recognition. Simultaneously, data access control often remains at the table level, failing to achieve fine-grained control across all levels from subject domain to data row, posing data security risks. Moreover, single-agent architectures cannot efficiently handle complex tasks involving data querying, in-depth analysis, and visualization, with execution efficiency and result quality failing to meet enterprise-level application requirements. Therefore, there is an urgent need for an intelligent data query system based on a unified business and financial semantic layer. Summary of the Invention
[0003] The purpose of this invention is to provide an intelligent query system based on a unified business semantic layer, thereby solving the problems mentioned in the background art.
[0004] This invention is achieved through the following technical solution: An intelligent query system based on a unified business and financial semantic layer includes: The Unified Business and Finance Semantic Layer Module is used to build standardized business semantic models, realize bidirectional mapping between business language and technical logic, and store semantic model libraries, dataset libraries, indicator libraries, terminology libraries, and permission rule libraries. The natural language interaction and intent recognition module is used to receive the user's natural language / voice input, combine the output of the unified business semantic layer module and the conversation context, and output a structured intent representation. A multi-agent collaborative engine is used to receive the structured intent representation, determine the task complexity, decompose the complex task into multiple dependent sub-tasks and allocate their execution, and integrate the execution results. The slot-filling API query generation module is used to receive structured query parameters from data query subtasks, combine them with the output of the unified business semantic layer module and the current user role information, and generate standardized API call requests. The StarRocks distributed computing and caching module is used to receive the standardized API call request, execute data queries, and return the original query result dataset. The results integration and visualization module is used to receive the original query result dataset and the output of the multi-agent collaborative engine, and generate the final display results. The multi-turn session and memory management module is used to store and recall session contexts.
[0005] Furthermore, The unified business and financial semantic layer module transforms multi-source heterogeneous data into a standardized semantic model with business semantic tags through the semantic model construction unit. The indicator definition and management unit completes the creation, derivation, and metadata maintenance of various business indicators. Then, the dataset assembly unit integrates the dimensions and indicators of cross-models under the same subject domain into a logical wide table that hides the underlying details. At the same time, the terminology library construction unit realizes the standardized injection of private domain business knowledge and large model adaptation. Finally, the four-level data permission configuration unit completes the full-level data access control from subject domain to data row, forming a complete and reusable business semantic abstraction system. It provides standardized slot definitions for the slot-filled API query generation module and a unified data interface for the multi-agent collaborative engine.
[0006] Furthermore, The semantic model building unit is configured to support both direct mapping of physical tables and custom SQL scripts for creating data models. It can automatically identify the data type and business characteristics of fields and classify them into primary key, dimension, measure, and date / time fields. Users can manually adjust the semantic classification of fields according to actual business needs, and assign a globally unique ID to each generated semantic model to achieve unified management across the entire system.
[0007] Furthermore, The dataset assembly unit is configured to automatically generate JOIN association conditions between multiple semantic models based on the predefined primary key information in the semantic model, verify the existence and validity of the dimensions and indicators selected by the user in the specified semantic model, support configuring the query mode of the dataset to an aggregation mode suitable for statistical analysis or a detailed mode suitable for detailed viewing, and set a default aggregation function for the aggregation mode to simplify user operations.
[0008] Furthermore, The terminology database construction unit is configured to perform deduplication and format standardization processing on the input enterprise private domain business terms, establish a precise mapping relationship between terms and dimensions and indicators in the semantic model, convert terms and their mapping relationships into prompt templates that can be understood by the large model to enhance the accuracy of semantic understanding, and assign a globally unique ID to each standardized term to support dynamic updates and version management.
[0009] Furthermore, The four-level data permission configuration unit is configured to configure data access permissions for different user roles in order of granularity from coarse to fine according to subject domain, model, column, and row. It converts row permission rules into filter condition templates that can be automatically applied during queries, establishes a mapping relationship between user role ID and corresponding permission rules and stores it in the permission rule library, thereby achieving fine-grained data security control without modifying the database configuration.
[0010] Furthermore, The multi-agent collaborative engine includes a planning agent, a Text2SQL agent, an analysis agent, and a Kanban agent. The planning agent, as the core scheduling unit, is configured to determine the task complexity based on the number of indicators, the number of dimensions, and whether analysis requirements are included in the structured intent representation. It then decomposes complex tasks into dependent subtasks, schedules them in parallel, and integrates the final results. The Text2SQL agent, as the data query execution unit, is configured to process data query tasks and output standardized structured query parameters. The analysis agent, as the deep analysis execution unit, is configured to complete the logical derivation of complex indicator calculations and root cause analysis tasks. The Kanban agent, as the visualization execution unit, is configured to generate visualization configurations adapted to different data types.
[0011] Furthermore, The slot-filling API query generation module is configured to automatically add row and column permission filtering conditions to the structured query parameters based on the current user role information and permission rule base. The query parameters with added permission filtering conditions are then filled one by one into the standardized API preset slots containing dataset ID, dimension list, indicator list, filter conditions, grouping conditions, sorting conditions, limit on the number of records, and query mode. After verifying the matching of all slot values with the dimensions and indicators in the specified dataset, the filled API request object is serialized into a standardized API call request with a signature.
[0012] Furthermore, The StarRocks distributed computing and caching module is configured to calculate the MD5 hash value as the cache key based on the core parameters of the standardized API call request, and sequentially query the multi-level cache consisting of memory cache, Redis cache, and disk cache. If the cache is not hit, the standardized API call request is parsed and an executable SQL statement is generated based on the association model information of the dataset. The SQL statement is submitted to the StarRocks computing engine for execution to obtain the original query result dataset. At the same time, common indicators are pre-calculated when the system starts and when the scheduled task is triggered, and the results are stored in the StarRocks aggregation table to accelerate subsequent queries.
[0013] Furthermore, The multi-turn conversation and memory management module is configured to extract key information such as datasets, dimensions, indicators, and filtering conditions from historical conversation records to generate a structured conversation context. The conversation context is used to automatically complete the omitted information in the user's current query to generate a complete query text and output it to the natural language interaction and intent recognition module. A long and short time memory separation storage mechanism is adopted to store the most recent 10 rounds of dialogue in short time memory and store the user's frequently used queries and preferences in long time memory. The module also recalls relevant historical memories based on the semantic similarity of the user's current query as auxiliary information for intent recognition.
[0014] The beneficial effects of this invention are as follows: 1. This invention, through a unified business and financial semantic layer module, transforms heterogeneous business and financial data from multiple sources such as ERP, CRM, financial systems, and OA systems into standardized semantic models. This achieves unified abstract management of business terms, indicators, and datasets, effectively breaking down data silos within enterprises and solving the pain points of data dispersion, inconsistent formats, confusing terminology, and difficulty in integration under traditional models. Simultaneously, it achieves a precise two-way mapping between business language and technical logic, establishing a standardized terminology library adapted to the enterprise's private domain knowledge. This allows business personnel to query data directly using everyday business language without needing to master technical knowledge such as SQL. This completely changes the traditional model of relying on technical personnel to write and retrieve data, significantly lowering the threshold for data use and improving the usability and reusability of business and financial data.
[0015] 2. This invention employs a multi-agent collaborative engine. Through the division of labor and cooperation among four types of agents—planning, Text2SQL, analysis, and Kanban—it can automatically determine the complexity of tasks and decompose complex data query tasks, including data querying, indicator calculation, root cause analysis, and visualization generation, into dependent sub-tasks and schedule them for parallel execution. This solves the problems of a single agent being unable to handle multiple types of tasks, low processing efficiency, and one-sided results. Each agent focuses on its core capabilities, completing specialized tasks such as structured query generation, in-depth business analysis, and visualization configuration. This ensures both the accuracy of data querying and the depth of business analysis, while also achieving high efficiency in task execution, significantly improving the system's ability to handle complex business and financial data requirements and the quality of results. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the system architecture of the present invention; Figure 2 This is a schematic diagram of the internal structure of the module unit. Detailed Implementation
[0017] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0018] See the example. Figures 1 to 2 : An intelligent query system based on a unified business and financial semantic layer includes: The Unified Business and Finance Semantic Layer Module is used to build standardized business semantic models, realize bidirectional mapping between business language and technical logic, and store semantic model libraries, dataset libraries, indicator libraries, terminology libraries, and permission rule libraries. The natural language interaction and intent recognition module is used to receive the user's natural language / voice input, combine the output of the unified business semantic layer module and the conversation context, and output a structured intent representation. A multi-agent collaborative engine is used to receive the structured intent representation, determine the task complexity, decompose the complex task into multiple dependent sub-tasks and allocate their execution, and integrate the execution results. The slot-filling API query generation module is used to receive structured query parameters from data query subtasks, combine them with the output of the unified business semantic layer module and the current user role information, and generate standardized API call requests. The StarRocks distributed computing and caching module is used to receive the standardized API call request, execute data queries, and return the original query result dataset. The results integration and visualization module is used to receive the original query result dataset and the output of the multi-agent collaborative engine, and generate the final display results. The multi-turn session and memory management module is used to store and recall session contexts.
[0019] Furthermore, The unified business and financial semantic layer module transforms multi-source heterogeneous data into a standardized semantic model with business semantic tags through the semantic model construction unit. The indicator definition and management unit completes the creation, derivation, and metadata maintenance of various business indicators. Then, the dataset assembly unit integrates the dimensions and indicators of cross-models under the same subject domain into a logical wide table that hides the underlying details. At the same time, the terminology library construction unit realizes the standardized injection of private domain business knowledge and large model adaptation. Finally, the four-level data permission configuration unit completes the full-level data access control from subject domain to data row, forming a complete and reusable business semantic abstraction system. It provides standardized slot definitions for the slot-filled API query generation module and a unified data interface for the multi-agent collaborative engine.
[0020] This approach avoids the core pain points of traditional business and financial data fusion, such as the difficulty in unifying multi-source heterogeneous data, the disconnect between business language and technical logic, the coarse data access control, and the inability of large models to adapt to enterprise private domain knowledge. It constructs a complete and reusable business semantic abstraction system, providing a standardized slot definition foundation for the slot-filling API query generation module and a unified data access interface for the multi-agent collaborative engine. This enables business personnel to query data directly using business language without needing to understand the underlying database structure. For example, in a business and financial integration project of a large manufacturing enterprise, the semantic model building unit converts procurement data from the ERP system, sales data from the CRM system, voucher data from the financial system, and approval data from the OA system into a standardized semantic model with unified business semantic tags. The indicator definition and management unit created core business indicators such as "procurement cost", "sales revenue" and "accounts receivable turnover" based on these models, and supports the derivation of composite indicators such as "gross profit margin" and "net profit margin" from the basic indicators; the dataset assembly unit integrates the customer dimension, product dimension, order indicators and payment collection indicators under the sales theme domain into a wide table of sales analysis logic that hides the details of the underlying multi-table relationships; The terminology database construction unit standardizes and maps enterprise-specific private domain terms such as "ex-factory price including tax," "net cash inflow," and "in-transit inventory" to corresponding dimensions and indicators, while converting them into prompt templates that the larger model can understand. The four-level data permission configuration unit configures full-level access permissions from the sales subject domain to specific order lines for different roles such as CFO, regional sales manager, and ordinary salesperson. This ultimately forms a unified semantic layer covering the entire business and financial process of the enterprise, allowing business personnel to directly obtain accurate data results simply by entering "sales revenue of various products in East China in the first quarter of 2025," without relying on technical personnel to write SQL statements.
[0021] Furthermore, The semantic model building unit is configured to support both direct mapping of physical tables and custom SQL scripts for creating data models. It can automatically identify the data type and business characteristics of fields and classify them into primary key, dimension, measure, and date / time fields. Users can manually adjust the semantic classification of fields according to actual business needs, and assign a globally unique ID to each generated semantic model to achieve unified management across the entire system.
[0022] It supports two data model creation methods: direct mapping of physical tables and custom SQL scripts. It balances the convenience and flexibility of modeling, and can automatically identify the data type and business characteristics of fields and perform semantic classification, which greatly reduces the workload and error rate of manual modeling. At the same time, by assigning a globally unique ID to each semantic model, it realizes unified management, referencing and version control of models across the entire system, avoiding the problems of duplicate model creation and naming conflicts. For example, in the financial data modeling process of the aforementioned manufacturing enterprise, for the simple "bank statement," the system uses a direct mapping method of physical tables, automatically identifying "transaction number" as the primary key field, "transaction date" as the date and time field, "transaction amount" as the measure field, and "counterpartie" as the dimension field. The modeling process only takes 3 minutes. For the "consolidated profit and loss statement" that requires merging the financial data of multiple subsidiaries, the system supports users to write custom SQL scripts to merge and summarize the profit and loss statement data of the three subsidiaries in Beijing, Shanghai, and Guangzhou to generate a unified semantic model. Users can also manually adjust the "subsidiary code" that was automatically misclassified from a measure field to a dimension field. The system assigns globally unique IDs "MODEL_FIN_001" and "MODEL_FIN_002" to these two semantic models respectively. Subsequently, when creating indicators and datasets, only the IDs need to be referenced, ensuring the consistency of model references throughout the system.
[0023] Furthermore, The dataset assembly unit is configured to automatically generate JOIN association conditions between multiple semantic models based on the predefined primary key information in the semantic model, verify the existence and validity of the dimensions and indicators selected by the user in the specified semantic model, support configuring the query mode of the dataset to an aggregation mode suitable for statistical analysis or a detailed mode suitable for detailed viewing, and set a default aggregation function for the aggregation mode to simplify user operations.
[0024] The system automatically generates JOIN conditions between multiple semantic models based on predefined primary key information in the semantic model. This avoids logical errors and performance issues that are prone to occur when business personnel manually write join statements. At the same time, it can verify the existence and legality of the dimensions and indicators selected by the user in the specified semantic model, preventing the generation of invalid queries. It supports two query modes: aggregation mode and detail mode, and sets a default aggregation function for aggregation mode, which greatly simplifies the query operation for business personnel and lowers the technical threshold for data query. For example, when assembling a sales analysis dataset, the system automatically generates INNERJOIN conditions between the two models based on the primary key "Customer ID" of the "Customer Model" and the foreign key "Customer ID" of the "Order Model," eliminating the need for users to manually write SQL join statements. When a user attempts to select "Purchase Cost," an indicator that only exists in the purchase model, the system immediately alerts the user that this indicator does not exist in the semantic model of the sales subject domain, preventing the execution of invalid queries. Users can configure the dataset in aggregation mode according to their needs. By default, the system uses the SUM function to aggregate metrics such as "Sales Revenue" and "Payment Amount," or it can be configured in detail mode to directly view detailed information for each order, satisfying both statistical analysis and detailed verification needs.
[0025] Furthermore, The terminology database construction unit is configured to perform deduplication and format standardization processing on the input enterprise private domain business terms, establish a precise mapping relationship between terms and dimensions and indicators in the semantic model, convert terms and their mapping relationships into prompt templates that can be understood by the large model to enhance the accuracy of semantic understanding, and assign a globally unique ID to each standardized term to support dynamic updates and version management.
[0026] By deduplicating and standardizing the format of enterprise private domain business terms, the semantic ambiguity caused by inconsistent expressions of the same business concept by different departments within the enterprise is resolved. By establishing a precise mapping relationship between terms and dimensions and indicators in the semantic model, the automatic conversion of business terms to technical logic is realized. At the same time, the terms and their mapping relationships are converted into prompt templates that the large model can understand, which significantly enhances the accuracy of the large model's understanding of the enterprise's private domain business language. By assigning a globally unique ID to each standardized term, dynamic updates and version management of terms are supported, ensuring the consistency and maintainability of the terminology system. For example, the sales department of this manufacturing company typically refers to "sales revenue excluding tax" as "net sales revenue," while the finance department refers to it as "main business revenue." The terminology database construction unit removes duplicate terms from these, standardizes them all as "sales revenue excluding tax," and establishes a precise mapping relationship between this term and the "sales revenue" indicator in the semantic model. Simultaneously, it generates a prompt template stating that "when a user queries 'net sales revenue' or 'main business revenue,' it maps to the indicator 'sales revenue excluding tax.'" This template is then injected into the prompts in the large model, enabling the large model to accurately identify the differences in terminology used by different departments. When the company subsequently adjusts the calculation method for "sales revenue excluding tax," the system assigns a new version ID to the updated term while retaining historical versions, ensuring the traceability of historical query results.
[0027] Furthermore, The four-level data permission configuration unit is configured to configure data access permissions for different user roles in order of granularity from coarse to fine according to subject domain, model, column, and row. It converts row permission rules into filter condition templates that can be automatically applied during queries, establishes a mapping relationship between user role ID and corresponding permission rules and stores it in the permission rule library, thereby achieving fine-grained data security control without modifying the database configuration.
[0028] The system implements full-level data access control from coarse to fine granularity at the subject domain, model, column, and row levels. It can meet the refined data security needs of different roles and positions within an enterprise. Row permission rules are converted into filter condition templates that can be automatically applied during queries without modifying the permission configuration of the underlying database, which greatly reduces the complexity and maintenance cost of permission management. At the same time, by establishing a mapping relationship between user role IDs and permission rules, centralized management and dynamic adjustment of permissions are achieved. For example, the permission rules configured for regional sales managers by this manufacturing company are as follows: At the subject domain level, access to the sales and customer subject domains is allowed, while access to the purchasing and financial subject domains is prohibited; at the model level, access to the order model and customer model is allowed, while access to the contract model is prohibited; at the column level, viewing fields such as "order number," "customer name," "product name," and "sales amount" is allowed, while viewing sensitive fields such as "cost amount" and "profit amount" is prohibited; at the row level, only order data for the East China region under their responsibility can be viewed. The system converts this row's permission rule into a filter condition template "region = 'East China'" and establishes a mapping relationship with the regional sales manager's role ID "ROLE_SALE_002". When a user in this role initiates a data query, the system automatically adds this filter condition to the query statement without modifying the database's user permission configuration, thus ensuring data security and improving the efficiency of permission management.
[0029] Furthermore, The multi-agent collaborative engine includes a planning agent, a Text2SQL agent, an analysis agent, and a Kanban agent. The planning agent, as the core scheduling unit, is configured to determine the task complexity based on the number of indicators, the number of dimensions, and whether analysis requirements are included in the structured intent representation. It then decomposes complex tasks into dependent subtasks, schedules them in parallel, and integrates the final results. The Text2SQL agent, as the data query execution unit, is configured to process data query tasks and output standardized structured query parameters. The analysis agent, as the deep analysis execution unit, is configured to complete the logical derivation of complex indicator calculations and root cause analysis tasks. The Kanban agent, as the visualization execution unit, is configured to generate visualization configurations adapted to different data types.
[0030] Through the collaborative division of labor among planning agents, Text2SQL agents, analysis agents, and Kanban agents, complex tasks are automatically decomposed, parallelized, and results integrated. This solves the problem that a single agent cannot simultaneously handle multiple complex tasks such as data querying, deep analysis, and visualization. The planning agent dynamically schedules tasks based on their complexity, fully leveraging the expertise of each agent and significantly improving the execution efficiency and result quality of complex query tasks. For example, when a user inputs "Analyze the reasons for the year-on-year decline in sales in East China in Q1 2025 and generate a visualization Kanban board," the planning agent first determines that the task is complex based on the number of indicators, dimensions, and root cause analysis requirements in the structured intent representation. It then decomposes the task into four dependent sub-tasks: the first sub-task, "Query sales data for each product and channel in East China in Q1 2025 and Q1 2024," is assigned to the Text2SQL agent; the second sub-task, "Calculate the year-on-year sales growth rate for each product and channel, and identify products with a decline exceeding 10% and..." The first subtask, "Channel," is assigned to the analysis agent; the second subtask, "Based on relevant data of declining products and channels, deduce the main reasons for the decline in sales," is assigned to the analysis agent; the third subtask, "Based on the analysis results, generate a visualization dashboard including a sales trend chart, a product share chart, and a channel comparison chart," is assigned to the dashboard agent. The planning agent is scheduled according to the dependencies of the subtasks, first executing the data query subtask, then executing the calculation and analysis subtasks in parallel after obtaining the query results, and finally executing the visualization subtask. The results of all subtasks are then integrated into a complete analysis report and visualization dashboard and returned to the user.
[0031] Furthermore, The slot-filling API query generation module is configured to automatically add row and column permission filtering conditions to the structured query parameters based on the current user role information and permission rule base. The query parameters with added permission filtering conditions are then filled one by one into the standardized API preset slots containing dataset ID, dimension list, indicator list, filter conditions, grouping conditions, sorting conditions, limit on the number of records, and query mode. After verifying the matching of all slot values with the dimensions and indicators in the specified dataset, the filled API request object is serialized into a standardized API call request with a signature.
[0032] For example, in one embodiment, when the East China sales manager inputs "Query sales revenue of each product in the first quarter of 2025", the slot-filled API query generation module first retrieves the corresponding permission rules from the permission rule base based on the user's role ID "ROLE_SALE_002", and automatically adds the row permission filter condition "region = 'East China'" and the column permission filter condition "Exclude cost amount and profit amount fields" to the query parameters; then, it adds "Dataset ID=DATASET_SALE_001", "Dimension list=[product name]", "Indicator list=[sales amount]", and "Filter condition=[Transaction date between '2025-01-01' and '2025-03-31' and region = The parameters such as "[East China]", "Grouping condition = [Product Name]", and "Query mode = Aggregation mode" are filled into the preset slots of the standardized API. Then, it is verified that the "Product Name" dimension and the "Sales Amount" indicator exist in the "DATASET_SALE_001" dataset. After the verification is successful, the API request object is serialized into JSON format, and the request content is signed using the system private key. A standardized API call request with the signature is generated and sent to the StarRocks distributed computing and caching module.
[0033] Furthermore, The StarRocks distributed computing and caching module is configured to calculate the MD5 hash value as the cache key based on the core parameters of the standardized API call request, and sequentially query the multi-level cache consisting of memory cache, Redis cache, and disk cache. If the cache is not hit, the standardized API call request is parsed and an executable SQL statement is generated based on the association model information of the dataset. The SQL statement is submitted to the StarRocks computing engine for execution to obtain the original query result dataset. At the same time, common indicators are pre-calculated when the system starts and when the scheduled task is triggered, and the results are stored in the StarRocks aggregation table to accelerate subsequent queries.
[0034] By employing a multi-level caching mechanism consisting of memory cache, Redis cache, and disk cache, the response speed of repeated queries can be significantly improved and unnecessary redundant calculations can be reduced. At the same time, by pre-calculating common indicators and storing them in the StarRocks aggregation table when the system starts up and when scheduled tasks are triggered, the execution efficiency of high-frequency queries can be significantly accelerated. By leveraging the distributed computing capabilities of StarRocks, complex query tasks of massive business and financial data can be handled, ensuring high concurrency and high performance of the system. For example, when a user queries "Sales revenue of various products in East China in Q1 2025" for the first time, the system calculates the MD5 hash value as the cache key based on the core parameters of the API request (dataset ID, dimension list, indicator list, and filter conditions). It then queries the memory cache, Redis cache, and disk cache sequentially. Since it is the first query, the cache is not hit. The system parses the API request and generates an executable SQL statement, submits the SQL statement to the StarRocks computing engine for execution, obtains the original query result dataset, and stores the results in the memory cache, Redis cache, and disk cache simultaneously, setting different expiration times. The system triggers a scheduled task at 2 AM every day to pre-calculate commonly used indicators such as "monthly sales revenue," "quarterly sales revenue," and "annual sales revenue," and stores the results in a StarRocks aggregation table. When the user queries "Sales revenue of various products in East China in Q1 2025" again, the system will directly retrieve the results from the Redis cache, significantly improving the response time.
[0035] Furthermore, The multi-turn conversation and memory management module is configured to extract key information such as datasets, dimensions, indicators, and filtering conditions from historical conversation records to generate a structured conversation context. The conversation context is used to automatically complete the omitted information in the user's current query to generate a complete query text and output it to the natural language interaction and intent recognition module. A long and short time memory separation storage mechanism is adopted to store the most recent 10 rounds of dialogue in short time memory and store the user's frequently used queries and preferences in long time memory. The module also recalls relevant historical memories based on the semantic similarity of the user's current query as auxiliary information for intent recognition.
[0036] The system extracts key information from historical session records to generate structured session contexts, automatically completes the omitted information in the user's current query, and avoids the user repeatedly entering the same query conditions in multiple sessions, thus improving the user experience. It adopts a long short-term memory separation storage mechanism, which not only ensures fast access to the recent session context, but also saves the user's frequently used queries and preferences for a long time. At the same time, it recalls relevant historical memories based on the semantic similarity of the user's current query as auxiliary information for intent recognition, which significantly improves the accuracy of intent recognition. For example, in the first round of the conversation, if a user enters "Query the sales revenue of each product in East China in the first quarter of 2025", the multi-round conversation and memory management module extracts key information such as "time = first quarter of 2025", "region = East China", "dimensional = [product name]", and "metric = [sales amount]" from the query, generates a structured conversation context, and saves it in short-term memory. When the user enters "how much year-on-year growth" in the second round of the conversation, the module automatically completes the omitted time, region, dimension, and metric information from the conversation context, completing the query as "how much year-on-year growth in sales revenue of each product in East China in the first quarter of 2025", and outputs it to the natural language interaction and intent recognition module. At the same time, the module saves frequently queried information such as "sales revenue in East China" and "product sales share" in long-term memory. When the user subsequently enters "check the sales situation", the system will recall relevant information from long-term memory based on semantic similarity and prioritize displaying product sales information in East China, further improving the user's query efficiency.
[0037] It is understood that the above embodiments are merely exemplary implementations used to illustrate the principles of the present invention, and the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. An intelligent query system based on a unified business and financial semantic layer, characterized in that, include: The Unified Business and Finance Semantic Layer Module is used to build standardized business semantic models, realize bidirectional mapping between business language and technical logic, and store semantic model libraries, dataset libraries, indicator libraries, terminology libraries, and permission rule libraries. The natural language interaction and intent recognition module is used to receive the user's natural language / voice input, combine the output of the unified business semantic layer module and the conversation context, and output a structured intent representation. A multi-agent collaborative engine is used to receive the structured intent representation, determine the task complexity, decompose the complex task into multiple dependent sub-tasks and allocate their execution, and integrate the execution results. The slot-filling API query generation module is used to receive structured query parameters from data query subtasks, combine them with the output of the unified business semantic layer module and the current user role information, and generate standardized API call requests. The StarRocks distributed computing and caching module is used to receive the standardized API call request, execute data queries, and return the original query result dataset. The results integration and visualization module is used to receive the original query result dataset and the output of the multi-agent collaborative engine, and generate the final display results. The multi-turn session and memory management module is used to store and recall session contexts.
2. The intelligent query system based on a unified business semantic layer according to claim 1, characterized in that, The unified business and financial semantic layer module transforms multi-source heterogeneous data into a standardized semantic model with business semantic tags through the semantic model construction unit. The indicator definition and management unit completes the creation, derivation, and metadata maintenance of various business indicators. Then, the dataset assembly unit integrates the dimensions and indicators of cross-models under the same subject domain into a logical wide table that hides the underlying details. At the same time, the terminology library construction unit realizes the standardized injection of private domain business knowledge and large model adaptation. Finally, the four-level data permission configuration unit completes the full-level data access control from subject domain to data row, forming a complete and reusable business semantic abstraction system. It provides standardized slot definitions for the slot-filled API query generation module and a unified data interface for the multi-agent collaborative engine.
3. The intelligent query system based on a unified business semantic layer according to claim 2, characterized in that, The semantic model building unit is configured to support both direct mapping of physical tables and custom SQL scripts for creating data models. It can automatically identify the data type and business characteristics of fields and classify them into primary key, dimension, measure, and date / time fields. Users can manually adjust the semantic classification of fields according to actual business needs, and assign a globally unique ID to each generated semantic model to achieve unified management across the entire system.
4. The intelligent query system based on a unified business semantic layer according to claim 2, characterized in that, The dataset assembly unit is configured to automatically generate JOIN association conditions between multiple semantic models based on the predefined primary key information in the semantic model, verify the existence and validity of the dimensions and indicators selected by the user in the specified semantic model, support configuring the query mode of the dataset to an aggregation mode suitable for statistical analysis or a detailed mode suitable for detailed viewing, and set a default aggregation function for the aggregation mode to simplify user operations.
5. The intelligent query system based on a unified business semantic layer according to claim 2, characterized in that, The terminology database construction unit is configured to perform deduplication and format standardization processing on the input enterprise private domain business terms, establish a precise mapping relationship between terms and dimensions and indicators in the semantic model, convert terms and their mapping relationships into prompt templates that can be understood by the large model to enhance the accuracy of semantic understanding, and assign a globally unique ID to each standardized term to support dynamic updates and version management.
6. The intelligent query system based on a unified business semantic layer according to claim 2, characterized in that, The four-level data permission configuration unit is configured to configure data access permissions for different user roles in order of granularity from coarse to fine according to subject domain, model, column, and row. It converts row permission rules into filter condition templates that can be automatically applied during queries, establishes a mapping relationship between user role ID and corresponding permission rules and stores it in the permission rule library, thereby achieving fine-grained data security control without modifying the database configuration.
7. The intelligent query system based on a unified business semantic layer according to claim 1, characterized in that, The multi-agent collaborative engine includes a planning agent, a Text2SQL agent, an analysis agent, and a Kanban agent. The planning agent, as the core scheduling unit, is configured to determine the task complexity based on the number of indicators, the number of dimensions, and whether analysis requirements are included in the structured intent representation. It then decomposes complex tasks into dependent subtasks, schedules them in parallel, and integrates the final results. The Text2SQL agent is configured as a data query execution unit to handle data query tasks and output standardized structured query parameters; the analysis agent is configured as a deep analysis execution unit to complete complex indicator calculation logic derivation and root cause analysis tasks; and the Kanban agent is configured as a visualization execution unit to generate visualization display configurations adapted to different data types.
8. The intelligent query system based on a unified business semantic layer according to claim 1, characterized in that, The slot-filling API query generation module is configured to automatically add row and column permission filtering conditions to the structured query parameters based on the current user role information and permission rule base. The query parameters with added permission filtering conditions are then filled one by one into the standardized API preset slots containing dataset ID, dimension list, indicator list, filter conditions, grouping conditions, sorting conditions, limit on the number of records, and query mode. After verifying the matching of all slot values with the dimensions and indicators in the specified dataset, the filled API request object is serialized into a standardized API call request with a signature.
9. The intelligent query system based on a unified business semantic layer according to claim 1, characterized in that, The StarRocks distributed computing and caching module is configured to calculate the MD5 hash value as the cache key based on the core parameters of the standardized API call request, and sequentially query the multi-level cache consisting of memory cache, Redis cache, and disk cache. If the cache is not hit, the standardized API call request is parsed and an executable SQL statement is generated based on the association model information of the dataset. The SQL statement is submitted to the StarRocks computing engine for execution to obtain the original query result dataset. At the same time, common indicators are pre-calculated when the system starts and when the scheduled task is triggered, and the results are stored in the StarRocks aggregation table to accelerate subsequent queries.
10. The intelligent query system based on a unified business semantic layer according to claim 1, characterized in that, The multi-turn conversation and memory management module is configured to extract key information such as datasets, dimensions, indicators, and filtering conditions from historical conversation records to generate a structured conversation context. The conversation context is used to automatically complete the omitted information in the user's current query to generate a complete query text and output it to the natural language interaction and intent recognition module. A long and short time memory separation storage mechanism is adopted to store the most recent 10 rounds of dialogue in short time memory and store the user's frequently used queries and preferences in long time memory. The module also recalls relevant historical memories based on the semantic similarity of the user's current query as auxiliary information for intent recognition.