Enterprise digitalization intelligent implementation method based on large language model

By using a large language model to create a unified query portal for internal enterprise data, the problems of adapting structured and unstructured data and isolating permissions are solved, improving the accuracy and consistency of queries and reducing the operational burden.

CN122633713APending Publication Date: 2026-08-25SHANGHAI SAGE INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610865860.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-16
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing technologies cannot process structured and unstructured data simultaneously under a unified entry point, cannot adapt to enterprise-specific semantics, and lack cross-data type permission isolation mechanisms, resulting in a heavy workload for enterprise employees switching between multiple systems and inaccurate query results.

Method used

It adopts a large language model as a unified semantic processing engine, and achieves a unified query entry point for structured and unstructured data through role-aware permission recognition mechanism and data isolation. It adapts to enterprise private semantics, and provides adaptive result push by combining multi-turn dialogue-aware question rewriting and dual-engine query.

Benefits of technology

It enables simultaneous access to structured business data and unstructured knowledge documents through a single natural language entry point, solving the problems of enterprise-specific semantic adaptation and cross-data format permission isolation, improving query accuracy and consistency, and reducing operational burden.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122633713A_ABST
    Figure CN122633713A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of artificial intelligence and enterprise informatization integration, and particularly relates to an enterprise digitization intelligent implementation method based on a large language model. The present application integrates core technologies such as role-aware data authority management and control, large model-driven data source routing and semantic understanding, multi-strategy differentiated search engine, and adaptive result pushing, and provides unified internal information acquisition capability for enterprise employees. In the architecture design, the present application adopts a standardized data source adaptation layer, so that different types of enterprise data sources such as structured databases, unstructured documents and semi-structured interfaces can be accessed into the method framework through the implementation of a unified adaptation interface, and the present application has open expansion capability for the continuous evolution of enterprise digitization construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence and enterprise information integration technology, and in particular to a method for realizing enterprise digital intelligence based on a large language model. Background Technology

[0002] Enterprise internal information assets typically exist in two distinct forms: one is structured data, carried by spreadsheets, business ledgers, and databases, such as procurement schedules, personnel ledgers, and equipment lists; the other is unstructured knowledge, carried by documents, wikis, and manuals, such as technical specifications, operating procedures, and R&D notes. Existing technologies, when providing unified natural language information retrieval services for enterprise employees, suffer from the following three fundamental shortcomings: (i) Structured and unstructured data query systems are fragmented and lack a unified entry point; Existing solutions are typically built independently for single data types: NL2SQL solutions for structured data rely on fixed database schemas and cannot handle document-based knowledge; Retrieval Enhancement Generation (RAG) systems for unstructured data excel at document question answering but cannot perform aggregation statistics or row-level filtering on tabular data. Employees often need two types of information simultaneously in their daily work—for example, querying the procurement progress of a project (structured) while referring to relevant technical specifications (unstructured)—but existing technologies require employees to manually switch between two independent systems, disrupting the information retrieval experience and failing to achieve semantic understanding of joint queries across data sources.

[0003] (ii) Existing systems are not compatible with the enterprise's proprietary, non-standard semantic environment; Both NL2SQL solutions and general RAG systems assume that user input conforms to standardized expressions. However, enterprises have a large number of proprietary semantics: project abbreviations and internal numbers (such as using abbreviations instead of full project names), field-level semantic offsets (such as when querying material categories, the memo field should actually be matched instead of the name field), and departmental differences in terminology (such as the same concept being called differently in R&D and procurement departments). Existing solutions cannot handle such diverse proprietary semantics at a unified entry point, leading to query failures or incorrect data returns. At the same time, in multi-turn dialogue follow-up scenarios (such as "What about this project?") of unstructured RAG systems, without context completion for follow-up questions, vector retrieval will deviate significantly from the user's intent due to semantic incompleteness.

[0004] (iii) Lack of a unified role-aware access control and data isolation mechanism across data formats; There are fundamental differences in the information access boundaries for personnel in different positions within an enterprise: management can access company-wide cross-project progress and the entire knowledge base; ordinary project personnel should only access data for the projects they are responsible for and knowledge documents for the corresponding business lines; personnel in specific positions have only limited query permissions. In existing solutions, the structured query system and the RAG system each maintain independent permission logic, or even lack permission control altogether, making it impossible to implement unified, fine-grained role-aware data isolation for the two types of data within the same framework.

[0005] In summary, existing technologies lack a method that can simultaneously serve the query needs of both structured and unstructured enterprise internal data under a unified entry point and a unified permission framework. There is an urgent need to solve three core problems: unified routing of heterogeneous data, adaptation of enterprise private semantics, and permission isolation across data formats. Summary of the Invention

[0006] To address the aforementioned technical problems, this invention proposes a method for achieving enterprise digital intelligence based on a large language model. Using the large language model as a unified semantic processing engine, and within the same entry point and permission framework, it intelligently routes users' natural language queries to a dedicated retrieval engine that matches the data format, and pushes the results to users in a manner suitable for the dissemination characteristics of enterprise IM platforms. The technical solution of this invention is implemented as follows: This invention discloses a method for achieving enterprise digital intelligence based on a large language model, comprising the following steps: Role-based permission recognition mechanism and data isolation: Role-aware permissions include multi-level permissions, each with different dynamic permission interface identification mechanisms and query permissions. The first level is for administrators, determined by the union of a pre-set static personnel identifier list and a dynamically updated whitelist of interfaces. A match in either list grants full data access and permission for all query types, adapting to both fixed management positions and personnel changes. The second level is for ordinary business users, who dynamically obtain their project or business scope by calling the internal business management system interface. Structured queries are limited to data rows within the access scope, while unstructured queries are limited to the knowledge base partition of the corresponding business line. The third level is for specific restricted users, who only support certain query types. Sensitive summary and statistical queries are directly intercepted during the permission verification stage and a warning is returned, preventing further processing. Isolate end-to-end data by using standardized session identifiers as namespaces; Unified query entry point processing for large language models: The large language model determines whether the current query is routed to a structured data query engine or an unstructured RAG retrieval engine by using a preset data source and user input, and rewrites the user input as a structured condition string or performs context-aware question rewriting. The Prompt sets constraint rules to adapt to the enterprise's proprietary semantic environment, including: Name integrity protection rule: The constraint model shall not arbitrarily abbreviate the complete business entity name entered by the user, and shall only extract the abbreviation when the user originally used the abbreviation; Field semantic mapping rules: When a user asks a question using the material category, it is mapped to the matching conditions of the remarks or category field, rather than the product name field; Number format recognition rules: Identify internal business number formats consisting of specific combinations of letters and numbers, distinguish them from business names, and map them to the correct fields; Unified rules for field aliases: Identify commonly used aliases such as drawing numbers, part numbers, and model numbers, and automatically map them to standard field names in the data table; Special abbreviation preset rules: Preset non-standard abbreviations that are frequently used within the enterprise in the Prompt.

[0007] Dual-engine query retrieval: The structured data query engine parses the structured conditions output by the large language model into data filtering rules and performs fault-tolerant matching on each field; For retrieval of multi-field business conditions, the structured query engine performs multi-field joint state reasoning on each retrieved business record, mapping the combined logic of multiple original fields into a natural language business state description. The unstructured data RAG retrieval engine maintains multiple independent vector knowledge base partitions and uses vector semantic retrieval technology to convert the rewritten query string into a vector, and retrieves the results in the corresponding vector knowledge base partitions. Adaptive dual-channel result push: The message push method is adaptively selected based on the user's query intent type and the size of the query results.

[0008] Furthermore, the result of the dynamic permission interface call is set with a valid time period; The end-to-end data includes a subset of data from structured queries, a knowledge base partition mapping for unstructured retrieval, storage of multi-turn dialogue history, and a directory of temporary result files.

[0009] Furthermore, the large language model determines the current query route based on the pre-defined mapping relationship between the session's group and the data source partition, as well as the semantic features of the question.

[0010] Furthermore, for requests routed to the structured data query engine, the large language model categorizes query intent into overall overview queries, detailed queries, exception list queries, and invalid or fuzzy queries.

[0011] Furthermore, the large language model combines the recent dialogue history of the current session to extract entities and pronouns, completes the user's follow-up questions into semantically independent and complete retrieval queries, and constructs the completed independent query vector.

[0012] Furthermore, the large language model preserves context-aware rewriting issues and the original input, automatically downgrading to use the original input for querying when mobilization fails.

[0013] Furthermore, the structured data query engine performs four levels of gradient matching on the business name field, namely fixed abbreviation dictionary replacement, full string exact matching, substring inclusion matching, and character similarity fallback. When a match returns multiple candidate results, display the candidate list to the user and perform the search based on the user's selection; Furthermore, the structured query engine performs multi-field joint state reasoning on each retrieved business record, mapping the combined logic of multiple original fields into a natural language business state description.

[0014] Furthermore, the unstructured data RAG retrieval engine employs vector semantic retrieval technology: after preprocessing, documents are split into semantically complete fragments, which are then transformed into high-dimensional vectors through an embedding model and stored in a vector index; during query execution, the query string rewritten from the question is transformed into a vector, and the document fragment with the closest semantics is retrieved from the corresponding knowledge base partition. The retrieved fragment is then used as context input to the large language model to generate an answer based on enterprise knowledge.

[0015] Furthermore, the large language model uses a persistent database to store the complete dialogue history of each session, recording user questions, system answers, and timestamps. Users can trigger the clearing of the session history by using agreed-upon keywords to start a new round of question and answer.

[0016] Furthermore, the unstructured data RAG retrieval engine also includes dynamic knowledge base updates: by periodically scanning externally pushed document update event files, parsing the document's partition information, vectorizing newly added or modified documents and updating them to the corresponding knowledge base partition, and performing targeted removal of vector indexes for deletion events.

[0017] Furthermore, when the number of query results exceeds a preset threshold, only a summary summary is displayed to the user, and the enterprise IM's private messaging interface is called to send the user a link to the complete data or the answer content. When the number of query results does not exceed a preset threshold, display formatted content of key fields and status descriptions; When a vector knowledge base question-and-answer request takes longer than the preset response time, an asynchronous push mechanism is used: the main thread returns a placeholder response before the timeout, and the background thread pushes the complete answer to the user through the IM platform's session-level callback interface after the large language model is generated.

[0018] Furthermore, the method also includes hot updating of structured data and timeliness tracing: Structured data files are periodically updated and stored in a designated directory according to agreed naming conventions; This embodiment establishes a file monitoring sentinel, which calculates the MD5 digest of the file or parses the file name timestamp by listening to the Inotify event of the file system; When a query request arrives, lazy loading is used in the singleton pattern. At the same time, the timestamp of the data parsed from the file name is synchronously embedded into the query result message header and the download file name.

[0019] The advantages of this invention are as follows: Unified entry point: Users can access both structured business data and unstructured knowledge documents through a single natural language entry point, without needing to understand the underlying data format and retrieval technology, eliminating the burden of manually switching between multiple systems.

[0020] Enterprise-specific semantic adaptation: By using Prompt constraint rules, the general language model can correctly handle special inputs such as enterprise-specific abbreviations, non-standard numbers, and field semantic offsets, thus solving the problem of the lack of applicability of existing standardized solutions in enterprise-specific data environments.

[0021] Improved accuracy in multi-turn dialogues: The context-aware question rewriting mechanism significantly improves the semantic integrity of vector retrieval in follow-up question scenarios, avoiding the problem of retrieval results deviating due to follow-up questions containing pronouns or omitting context.

[0022] Unified permissions across data types: The multi-level permission system simultaneously constrains the access scope of data rows for structured queries and the access boundaries of knowledge base partitions for unstructured retrieval within the same framework, achieving consistent permission control across heterogeneous data sources.

[0023] General scalability: The methodology framework does not depend on specific business data. By replacing the data access layer, adjusting the state machine rules and knowledge base partitioning configuration, it can be extended to various internal enterprise information query scenarios such as human resources, finance, project management, and equipment operation and maintenance.

[0024] Open data source scalability: The retrieval layer adopts a standardized adapter interface design, decoupling the large-model semantic routing layer from specific data sources. When an enterprise introduces a new data system, it only needs to implement the adapter interface for the new data source and register it in the routing configuration to be incorporated into the unified query framework, without needing to modify the core method logic. This feature enables this method to continuously evolve as the enterprise's digital transformation deepens, avoiding the engineering costs of repeatedly reconstructing the query entry point as data sources increase.

[0025] This invention is the first to integrate the semantic understanding capabilities of a large language model, Prompt constraint engineering for enterprise-specific semantics, context rewriting technology for multi-turn dialogue awareness, and a unified access control mechanism for heterogeneous data sources into a complete methodological framework. This enables enterprise employees to access structured business data and unstructured knowledge documents simultaneously through everyday natural language from a single entry point, without needing to understand the underlying data storage format and retrieval technology details.

[0026] This invention resolves the contradiction between the ambiguity / fuzziness of natural language and the deterministic requirements of structured data retrieval in enterprise internal queries, as well as the contradiction between heterogeneous data silos and unified access control. By defining a standardized data source adaptation layer protocol, it decouples the semantic understanding layer from the data storage layer, thus solving the problem of exponentially increasing maintenance costs due to the increase in data sources during enterprise digital transformation. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only one embodiment of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is an overall flowchart of an embodiment of the present invention; Figure 2 The flowchart for the context-aware problem in the embodiments of the present invention has been rewritten; Figure 3 This is a flowchart of the four-level gradient service name matching process in an embodiment of the present invention. Detailed Implementation

[0029] The technical solutions of the present invention will now be clearly and completely described with reference to the embodiments and accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0030] Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains; the terminology used in the detailed description is for the purpose of describing particular embodiments only and is not intended to limit the invention; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0031] In the description of specific embodiments of the present invention, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present invention, "multiple" means two or more, unless otherwise explicitly defined.

[0032] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this invention can be combined with other embodiments.

[0033] In the description of the embodiments of this invention, the term "and / or" is merely a description of the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, in this invention, the character " / " generally indicates that the preceding and following associated objects have an "or" relationship.

[0034] In the existing technology, the NL2SQL solution for structured data and the RA / G system for unstructured data are two independent technical paths. Each has its own advantages in the data type it targets, but neither can cover the other type of data, nor can they implement cross-data type permission control under a unified framework.

[0035] To address the aforementioned issues, this invention positions the large language model as a unified semantic routing and understanding engine. It schedules two types of heterogeneous retrieval engines under a unified entry point through a data source routing mechanism and constrains the data access boundaries of the two types of engines with a unified permission framework. This is the first time that a unified method for querying structured and unstructured information within an enterprise has been achieved.

[0036] In processing structured data, this invention adapts the capabilities of a general large language model to the enterprise's private non-standard semantic environment through specially designed Prompt constraint rules, breaking through the strong dependence of existing solutions on standardized data environments. At the same time, it introduces a multi-field joint state machine reasoning layer to transform the combination logic of the original field values ​​into a readable natural language description of the business state, achieving a qualitative leap from data display to business state interpretation.

[0037] In processing unstructured data, this invention introduces a context-aware multi-turn dialogue question rewriting mechanism, which completes follow-up questions into independent and complete retrieval queries, significantly improving the accuracy of vector retrieval in multi-turn dialogue scenarios; at the same time, it implements group-based multi-knowledge base partitioning routing, which isolates the knowledge content of different business lines from each other and prevents knowledge noise from interfering with the retrieval results.

[0038] The technical solution of the present invention will be described in more detail below through embodiments.

[0039] In one specific embodiment, such as Figure 1 As shown, a method for achieving enterprise digital intelligence based on a large language model includes the following four progressively advancing processing steps: 1. Role-aware permission recognition and data isolation (first stage) This step identifies user permissions and determines the boundaries of visible data before the query is executed, providing consistent permission constraints for both structured and unstructured queries.

[0040] This embodiment constructs a three-tier permission system: The first tier is for administrators, whose permissions are determined by taking the union of a pre-set static list of personnel identifiers and a dynamically updated whitelist of interfaces. If either matches, the administrator is granted full access to all data and permission to query all types of data, adapting to both fixed management positions and personnel changes. The second tier is for ordinary business users, whose responsibilities for projects or business scopes are dynamically obtained by calling the internal business management system interface. Structured queries are limited to data rows within the access scope, while unstructured queries are limited to the knowledge base partition of the corresponding business line. The third tier is for specific restricted users, who only support certain query types. Sensitive summary and statistical queries are directly intercepted during the permission verification stage and a prompt is returned, without proceeding to the subsequent processing flow.

[0041] The results of permission API calls are cached in memory for 5 minutes, significantly reducing the frequency of API calls while ensuring that permission changes take effect automatically within a short time. This embodiment uses standardized session identifiers as namespaces to isolate data across the entire chain, including data subsets from structured queries, knowledge base partition mapping for unstructured searches, storage of multi-turn dialogue history, and temporary result file directories, preventing cross-session data mixing and achieving unified isolation across data formats.

[0042] 2. Large-scale model semantic understanding layer – core processing of the unified entry point (second stage) This stage undertakes three key responsibilities: determining which data source and search engine is appropriate for routing the current query, understanding the user's query intent and extracting structured search conditions, and adapting enterprise-specific non-standard semantic expressions. All three responsibilities are completed by the large language model in a single or few calls, forming the semantic processing core of the unified query entry point.

[0043] 2.1 Data Source Routing and Intent Classification The large language model determines whether the current query should be routed to a structured data query engine or an unstructured RAG retrieval engine based on the content characteristics of the user's query and the system's pre-defined data source description. The routing criteria include: the pre-defined mapping relationship between the session's group and the data source partition (e.g., R&D groups are preferentially routed to the R&D knowledge base, and supply chain groups are preferentially routed to the procurement ledger), and the semantic characteristics of the question (e.g., queries that explicitly point to progress, quantity, or status tend to be routed to the structured engine, while queries that point to methods, specifications, or principles tend to be routed to the RAG engine).

[0044] For requests routed to the structured data query engine, the large language model further categorizes query intents into four types: overall overview query (requires aggregation and statistical analysis of matching records before output), detailed query (requires returning detailed information for each matching record line by line), anomaly list query (retains only records in specific anomaly states based on the detailed query), and invalid or fuzzy query (returns a guidance prompt without triggering a search). Route determination and intent classification are completed together in the same large language model call using a predefined output format, reducing the number of calls and lowering response latency.

[0045] 2.2 Conditional Structured Extraction of Structured Data and Adaptation to Enterprise-Specific Semantic Language For requests routed to the structured engine, the large language model rewrites user input as a structured condition string in the format "field name: field value". Five dedicated constraint rules are set in the Prompt to adapt to the enterprise's proprietary semantic environment: Name integrity protection rule: The constraint model shall not arbitrarily abbreviate the complete business entity name entered by the user. The abbreviation shall only be extracted when the user originally used the abbreviation to prevent name truncation from causing subsequent search failures.

[0046] Field semantic mapping rules: When a user asks a question with a material category (such as sheet metal parts, machined parts, etc.), it is mapped to the matching conditions of the remarks or category field, rather than the product name field, thus solving the problem of field-level semantic offset.

[0047] Number format recognition rules: Identify internal business number formats consisting of specific combinations of letters and numbers, distinguish them from business names, and map them to the correct fields.

[0048] Unified rules for field aliases: Identify commonly used aliases such as drawing numbers, part numbers, and model numbers, and automatically map them to standard field names in the data table, eliminating the gap between user terminology and data fields.

[0049] Special abbreviation preset rules: Preset non-standard abbreviations that are frequently used within the enterprise in the Prompt to prevent them from being misjudged as other field types by the model.

[0050] The above five constraint rules are encoded as policy operators in System Prompt, and the model is guided to generate a standardized JSON structured middleware format through Few-shot examples.

[0051] 2.3 Rewriting to address the context-aware problem of unstructured data For requests routed to the RAG retrieval engine, the large language model performs context-aware question rewriting: combining the recent dialogue history of the current session (taking the most recent four to six records), it extracts entities and pronouns, completes the user's follow-up questions (such as "How to implement this?", "Are there any corresponding specifications?", etc., which contain pronouns or omit context) into semantically independent and complete retrieval queries, and constructs the completed independent query vector, so that vector retrieval can accurately locate relevant document fragments, rather than causing retrieval deviation due to semantic incompleteness.

[0052] The question rewriting Prompt follows these core rules: Only supplement necessary context, avoiding any assumptions not explicitly mentioned by the user; avoid imposing additional logical relationships such as chronological order; refer to the topic direction of recent conversations rather than verbatim copying of historical content; the rewritten question should be understandable as an independent query, independent of context. Both the rewritten result and the original user input are preserved; the original input is used for conversation history, and the rewritten query is used for vector retrieval execution. In case of a large language model call failure, automatic fallback to using the original input ensures service continuity.

[0053] The rewriting process for context-aware problems is as follows: Figure 2 As shown, the user's original input (such as "What about Linux?") is combined with recent dialogue history by the large language model to complete a semantically independent complete query (such as "How to install a central control system on Linux?"). The rewritten result is used for vector retrieval, and the original follow-up question is retained for dialogue history storage. When the large language model fails to be invoked, it automatically degrades to using the original follow-up question for direct retrieval.

[0054] 3. Dual-engine query (third stage) 3.1 Structured Data Query Engine 3.1.1 Multidimensional Fuzzy Condition Retrieval The structured query engine parses the structured conditions output by the large language model into data filtering rules and performs fault-tolerant matching on each field. For the business name field, a four-level gradient matching is implemented: Level 0 is fixed abbreviation dictionary replacement (zero computational overhead, highest priority); Level 1 is full string exact matching; Level 2 is substring inclusion matching (both forward and reverse checks are performed); Level 3 is character similarity fallback (calculating character-level similarity ratios and selecting candidate sets above a threshold, adapting to misspellings and near-homophone scenarios).

[0055] When multiple candidates are returned for matching, the candidate list should be displayed to the user, requiring explicit selection and preventing arbitrary decisions. For product or material name fields, word segmentation and fault-tolerant matching should be implemented: the user input is split into valid words, substring matching is performed on each word, and the union of the results is taken to expand the recall.

[0056] The four-level gradient business name matching process is as follows: Figure 3 As shown, Level 0 has the highest priority for fixed abbreviation replacement and zero computational overhead; Levels 1 to 3 progressively improve fault tolerance, and if any level has a unique match, the subsequent matching will immediately stop; when Level 3 returns multiple candidates, it will display a list to the user for confirmation and will not make a selection on its own; when there are no candidates at all three levels, it will return a guidance prompt.

[0057] 3.1.2 Multi-field business state machine reasoning The structured query engine performs multi-field joint state reasoning on each retrieved business record, mapping the combined logic of multiple raw fields into a natural language business state description that users can directly understand. The state machine adopts hierarchical short-circuit evaluation logic: it judges field combinations level by level according to the sequence of business processes. Once a node is matched, it immediately returns the corresponding natural language description without continuing to the next level of judgment, resulting in an extremely low average number of field judgments. Taking the procurement progress scenario as an example, the state machine covers multiple stages such as procurement application, order approval, logistics in transit, and warehousing completion, forming more than ten final state descriptions, enabling employees to obtain clear business progress information without understanding the original field codes. When a record is in transit, it further calls a third-party logistics query interface to obtain real-time express delivery status and appends it to the description, realizing the closed information link between business progress and logistics status.

[0058] This state machine architecture is configurable: by modifying field definitions and inference rules, it can adapt to the state machine inference needs of other business scenarios such as personnel approval processes, financial reimbursement progress, and equipment maintenance work orders without changing the query framework.

[0059] 3.2 Unstructured Data RAG Retrieval Engine 3.2.1 Group-based multi-knowledge base partition routing The unstructured search engine maintains multiple independent vector knowledge base partitions, corresponding to different business lines or departments within the enterprise (such as R&D knowledge base, operations knowledge base, general knowledge base, etc.).

[0060] This embodiment uses a pre-defined group-knowledge base mapping relationship to route query requests from different IM groups to the corresponding knowledge base partitions. This achieves business line isolation of knowledge content, prevents the leakage of sensitive cross-departmental knowledge, and avoids irrelevant knowledge content interfering with search results. The knowledge base mapping configuration is centrally managed; adding a new business line to the knowledge base only requires adding a record to the mapping table, without modifying the core logic of the search engine.

[0061] 3.2.2 Vector Retrieval and Multi-Turn Dialogue History Management The knowledge base retrieval uses vector semantic retrieval technology: after the document is preprocessed and split into semantically complete fragments, it is transformed into a high-dimensional vector through an embedding model and stored in the vector index; when the query is executed, the query string after the question is rewritten is also transformed into a vector, and the document fragment with the most similar semantics is retrieved in the corresponding knowledge base partition. The retrieved fragment is used as the context input to the large language model to generate an accurate answer based on enterprise knowledge.

[0062] This embodiment uses a persistent database to store the complete dialogue history of each session, recording user questions, system responses, and timestamps. Historical records are processed using a time-decay weighting strategy when building the large language model input: recent dialogue history is weighted higher than earlier records. Within a limited context window, the dialogue context most relevant to the current query is prioritized, reducing interference from distant historical information in the current retrieval. Users can trigger a clearing of the session history using agreed-upon keywords, starting a new question-and-answer round from a clean context.

[0063] 3.2.3 Knowledge Base Dynamic Update Mechanism The knowledge base content is kept synchronized with the enterprise's internal knowledge management system (such as Wiki, document collaboration platform, etc.). By periodically scanning externally pushed document update event files, parsing the document's partition information, vectorizing newly added or modified documents, and updating the corresponding knowledge base partition, the vector index of deleted events is removed in a targeted manner. This mechanism enables incremental updates of the knowledge base content without requiring a full re-indexing, and the knowledge update latency is consistent with the execution frequency of the scheduled tasks.

[0064] 4. Adaptive dual-channel result push (fourth stage) Based on the query intent type and result size, the most suitable push method is adaptively selected to resolve the engineering conflict between the character limit of a single message on the enterprise IM platform and the complete distribution of large result sets. This embodiment sets a dynamic threshold T based on the number of bytes or entries in the returned result set. When the result set R > T, an asynchronous task processor is triggered to generate a temporary shared object storage (OSS) link and push a message payload in a specific format to the user's UUID via the IM Webhook protocol.

[0065] When the number of query results does not exceed a preset threshold, the formatted content of key fields and status descriptions is directly displayed in the group message. When the number of results exceeds the threshold, the group message only displays a summary (statistics of the number of each status category in the structured query scenario, and a direct answer in the knowledge base Q&A scenario), and simultaneously calls the enterprise IM platform's private message interface to send a download link for the complete data (structured query) or the complete answer content (knowledge base Q&A) to the query initiator. If the private message fails to send, the link or content is automatically appended to the end of the group message to ensure data accessibility.

[0066] For knowledge base question-and-answer requests that take a long time (generating a large language model usually takes several seconds to tens of seconds, which may exceed the response timeout window of the IM platform), this embodiment adopts an asynchronous push mechanism: the main thread returns a placeholder response before the timeout, and the background thread pushes the complete answer to the user through the session-level callback interface of the IM platform after the large language model is generated, so that the user first receives a waiting prompt and then receives the complete result, resulting in a natural and smooth experience.

[0067] In some preferred embodiments, the present invention also includes a structured data hot update and timeliness traceability mechanism: structured data files are periodically updated and stored in a designated directory according to an agreed naming convention (the file name contains a month, day, hour, minute, and timestamp).

[0068] A file monitoring sentinel is established to listen for file system Inotify events and calculate file MD5 digests or parse filename timestamps. When a query request arrives, a lazy loading mechanism in a singleton pattern is used to ensure consistency between memory-mapped files and disk data, enabling data hot-swapping without downtime. Simultaneously, the query result message header and downloaded filename are synchronously embedded with the data update timestamp parsed from the filename, achieving end-to-end transparent traceability of data timeliness.

[0069] It should be noted that this embodiment employs a pluggable data source adapter design in the third stage (retrieval layer): both the structured data query engine and the unstructured RAG retrieval engine implement the same standard retrieval interface. The large model semantic layer is only responsible for routing decisions and is unaware of the specific implementation details of the underlying data source. This design allows the access of new types of data sources (such as relational databases, time-series data, external API interfaces, etc.) to simply implement the corresponding adapter, without modifying any logic in the routing layer, permission layer, and push layer, fundamentally ensuring the framework's adaptability to the continuous expansion of enterprise data assets.

[0070] Furthermore, the technical solution of the present invention can be extended to the following scenarios: Structured data scenarios: personnel attendance and holiday ledger query, financial reimbursement approval progress tracking, equipment maintenance work order status query, and project milestone progress query.

[0071] Unstructured data scenarios: Q&A of internal enterprise operating procedures and process manuals, retrieval of technical R&D documents and design specifications, Q&A of training materials and knowledge accumulation documents, retrieval of meeting minutes and project documents.

[0072] Cross-format joint scenario: query the current procurement progress of a project (structured) and simultaneously retrieve the quality requirements of the material in the relevant technical specifications (unstructured), and complete the acquisition of composite information across data formats in a single dialogue.

[0073] New data source integration scenario: As enterprises deepen their digital transformation, when new data systems (such as relational business databases, external API data interfaces, time-series device sensor data, etc.) need to be incorporated into a unified query framework, it is only necessary to implement a standard retrieval adapter interface for the new data source and complete the registration in the routing configuration. No changes are required to the logic of the permission layer, semantic layer, and push layer. After the new data source is integrated, it automatically enjoys the same permission control, natural language understanding, and result push capabilities as the existing data source, with extremely low engineering costs.

[0074] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for achieving enterprise digital intelligence based on a large language model, characterized in that, The steps include the following: Role-based permission recognition mechanism and data isolation: Each role level has its own dynamic permission interface identification mechanism and query permissions. The entire data chain is isolated by using standardized session identifiers as namespaces; the entire data chain includes a subset of structured query data, knowledge base partition mapping of unstructured retrieval, multi-turn dialogue history storage, and temporary result file directory; Unified query entry point processing for large language models: The large language model determines whether the current query is routed to a structured data query engine or an unstructured RAG retrieval engine by using a preset data source and user input, and rewrites the user input into a structured condition string or performs context-aware question rewriting. Set constraint rules in the Prompt to adapt to the enterprise's private semantic environment; Dual-engine query retrieval: The structured data query engine parses the structured conditions output by the large language model into data filtering rules and performs fault-tolerant matching on each field; For retrieval of multi-field business conditions, the structured query engine performs multi-field joint state reasoning on each retrieved business record, mapping the combined logic of multiple original fields into a natural language business state description. The unstructured data RAG retrieval engine maintains multiple independent vector knowledge base partitions and uses vector semantic retrieval technology to convert the rewritten query string into a vector, and retrieves the results in the corresponding vector knowledge base partitions. Adaptive dual-channel result push: The message push method is adaptively selected based on the user's query intent type and the size of the query results.

2. The method according to claim 1, characterized in that, The dynamic permission interface call result is set with a valid time period.

3. The method according to claim 1, characterized in that, The large language model determines the current query route based on the pre-defined mapping relationship between the session's group and the data source partition, as well as the semantic features of the question.

4. The method according to claim 1, characterized in that, For structured data query requests, the large language model categorizes query intent into overall overview queries, detailed queries, anomaly list queries, and invalid or fuzzy queries.

5. The method according to claim 1, characterized in that, The constraints of an enterprise's proprietary semantic environment include: Name integrity protection rule: The constraint model shall not arbitrarily abbreviate the complete business entity name entered by the user, and shall only extract the abbreviation when the user originally used the abbreviation; Field semantic mapping rules: When a user asks a question using the material category, it is mapped to the matching conditions of the remarks or category field, rather than the product name field; Number format recognition rules: Identify internal business number formats consisting of specific combinations of letters and numbers, distinguish them from business names, and map them to the correct fields; Unified rules for field aliases: Identify commonly used aliases such as drawing numbers, part numbers, and model numbers, and automatically map them to standard field names in the data table; Special abbreviation preset rules: Preset non-standard abbreviations that are frequently used within the enterprise in the Prompt.

6. The method according to claim 1, characterized in that, The large language model combines the recent dialogue history of the current session to extract entities and pronouns, completes the user's follow-up questions into semantically independent and complete retrieval queries, and constructs the completed independent query vector.

7. The method according to claim 6, characterized in that, The large language model preserves the context-aware rewriting problem and the original input, and automatically degrades to using the original input for querying when the retrieval fails.

8. The method according to claim 1, characterized in that, The structured data query engine performs four levels of gradient matching on the business name field, namely, fixed abbreviation dictionary replacement, full string exact matching, substring inclusion matching, and character similarity fallback. When a match returns multiple candidate results, display the candidate list to the user and perform the search based on the user's selection; The structured query engine also performs multi-field joint state reasoning on each retrieved business record, mapping the combined logic of multiple original fields into a natural language business state description.

9. The method according to claim 1, characterized in that, The RAG retrieval engine for unstructured data employs vector semantic retrieval technology: After the document is preprocessed and split into semantically complete fragments, it is transformed into a high-dimensional vector through an embedding model and stored in a vector index. When the query is executed, the query string after the question is rewritten is transformed into a vector, and the document fragment with the most similar semantics is retrieved in the corresponding knowledge base partition. The retrieved fragment is used as context input into the large language model to generate an answer based on enterprise knowledge. The large language model uses a persistent database to store the complete dialogue history of each session, recording user questions, system answers, and timestamps. Users can trigger the clearing of the conversation history and start a new round of question and answer by using agreed-upon keywords. The unstructured data RAG retrieval engine also includes dynamic knowledge base updates: by periodically scanning externally pushed document update event files, parsing the document's partition information, vectorizing newly added or modified documents and updating them to the corresponding knowledge base partition, and removing the vector index for deletion events.

10. The method according to claim 1, characterized in that, This also includes hot updates and timeliness tracking of structured data: Structured data files are periodically updated and stored in a designated directory according to agreed naming conventions; This embodiment establishes a file monitoring sentinel, which calculates the MD5 digest of the file or parses the file name timestamp by listening to the Inotify event of the file system; When a query request arrives, lazy loading is used in the singleton pattern. At the same time, the timestamp of the data parsed from the file name is synchronously embedded into the query result message header and the downloaded file name.