Erp natural language interaction intelligent business processing system and method
Patent Information
- Application Number
- CN202610767935.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-08-18
AI Technical Summary
传统菜单导航与表单查询模式下,用户需通过多层级菜单定位功能页面,在固定格式表单中输入查询条件,跨模块数据关联需人工手动完成,非技术人员需经过专业培训才能熟练操作,在日常业务中体现出操作门槛较高、处理效率偏低的特点;预定义报表查询与分析系统需由IT人员预先编写SQL查询或报表模板,最终用户仅能调用已部署的模板,无法响应实时、临时的查询需求,且需求从提出到落地需跨部门协作,整体流程周期较长、人力成本较高,同时报表仅返回原始数据集,需用户自行分析挖掘业务信息;固定规则FAQ问答模块基于关键词匹配或预定义“问题-答案”对实现交互,仅能处理简单、标准化的问题,无法理解自然语言中的上下文逻辑和复杂业务诉求,且随着企业业务的拓展,需持续新增和维护规则,后续的维护成本会随业务规模同步增加
基于ERP业务定制的三层意图识别架构,意图识别准确率>90%,SQL生成准确率>85%,能够理解复杂上下文和多条件业务查询,将专业ERP语言转化为自然语言,大幅降低ERP操作的学习门槛,提升意图识别与查询准确性;
Smart Images

Figure CN122596060A_ABST
Abstract
Description
Technical Field
[0001] This invention mainly relates to the field of enterprise informatization and artificial intelligence, specifically to an ERP natural language interactive intelligent business processing system and method, which can be directly adapted to the core business modules of EPICORERP system such as sales, procurement, inventory, and finance, to realize deep intelligent interaction between natural language and ERP system and compliant business operations. Background Technology
[0002] ERP systems are core information tools for enterprises to integrate core business processes such as finance, procurement, sales, production, and inventory. Currently, there are three main ways for ERP systems to interact and process data, and each method has its own limitations in practical applications. Traditional menu navigation and form query modes require users to navigate through multi-level menus to locate function pages, input query conditions into fixed-format forms, and manually complete cross-module data association. Non-technical personnel need professional training to operate proficiently, resulting in high operational barriers and low processing efficiency in daily business. Predefined report query and analysis systems require IT personnel to pre-write SQL queries or report templates, and end users can only call deployed templates, unable to respond to real-time or ad-hoc query needs. Furthermore, the process from request to implementation requires cross-departmental collaboration, resulting in a long overall cycle and high labor costs. Additionally, reports only return raw datasets, requiring users to analyze and extract business information themselves. Fixed-rule FAQ modules rely on keyword matching or predefined "question-answer" pairs for interaction, handling only simple and standardized questions. They cannot understand the contextual logic in natural language or complex business requirements. Moreover, as the business expands, rules need to be continuously added and maintained, increasing maintenance costs in tandem with business growth.
[0003] The core common problem with existing ERP interaction and data processing technologies lies in their reliance on a "predefined" paradigm. Menus, forms, reports, and other elements must be explicitly defined and deployed before user interaction, making them ill-suited to the rapidly changing and unpredictable business information needs of a commercial environment. Most existing ERP interaction systems directly interface with the main database, and frequent queries can impose additional workloads on the ERP system. Furthermore, these systems often only possess information query capabilities, lacking the ability to map operations to business rules, failing to directly translate user needs into compliant ERP business operations. This makes them ill-suited to the agile and intelligent operational development needs of enterprises. Currently, there is no intelligent processing system or method that can deeply understand user business intent through natural language, dynamically generate query logic, and achieve lightweight integration with the ERP system while supporting compliant business operations. Summary of the Invention
[0004] 1. The technical problem that the invention aims to solve: The ERP natural language interactive intelligent business processing system and method provided by the present invention are used to solve the technical problems existing in the above-mentioned background art.
[0005] 2. Technical Solution: To achieve the above objectives, the technical solution provided by the present invention is as follows: An ERP natural language interactive intelligent business processing system, characterized in that it includes: The interaction module receives natural language queries / operation commands from users and records multi-turn dialogue history; The intent analysis module communicates with the interaction module to preprocess natural language commands, perform semantic parsing, intent recognition, and structured information extraction, and output slot information such as table names, fields, and filtering conditions. The schema context generation module communicates with the intent analysis module to generate a customized schema context for the ERP database based on the slot information, which includes table structure, field business meaning, inter-table relationships and currency field information. The LLM calling module communicates with the Schema context generation module, constructs prompt words based on ERP customized system rules, Schema context and user queries, and calls the large language model to dynamically generate SQL statements; The SQL processing module communicates with the LLM calling module to perform security checks, error detection, automatic repair, and performance optimization on the SQL statements. The ERP data interaction module communicates with the SQL processing module and the ERP main system to execute optimized SQL statements to obtain ERP data, or to map natural language operation instructions into ERP business operation sequences and perform business rule verification. The results display module communicates with the ERP data interaction module and the interaction module to format, visualize, and generate natural language summaries of the ERP data, and then feeds the results back to the user.
[0006] An ERP natural language interactive intelligent business processing method, based on the system described in claim 1, is characterized by comprising the following steps: S1: The interaction module receives the user's natural language query / operation instructions and transmits them to the intent analysis module; S2: The intent analysis module processes natural language commands and outputs standardized queries, entity information, intent types, and slot information; S3: The Schema context generation module loads ERP metadata based on the slot information and generates a customized Schema context; S4: The LLM calling module builds the prompt word project and calls the large language model to dynamically generate SQL statements; S5: The SQL processing module performs security checks, error detection, automatic repair, and performance optimization on the SQL statement, and outputs a compliant optimized SQL statement; S6: The ERP data interaction module executes the optimized SQL statement to obtain business data from the ERP main system, or performs business rule verification on the natural language operation instructions and then calls the ERP API to complete the business operation; S7: The results display module formats, visualizes, and generates natural language summaries of the business data, and provides feedback to the user through the interaction module.
[0007] Furthermore, the intent analysis module adopts a three-layer intent recognition architecture, including a text understanding layer, an intent classification layer, and a slot filling layer. The text understanding layer preprocesses natural language instructions, performs entity recognition, synonym normalization, and word segmentation, and outputs a normalized query, an entity dictionary, and word segmentation results. The intent classification layer performs intent keyword matching and score calculation on the normalized query to determine the primary intent, secondary intent, and confidence level. The slot filling layer extracts structured slot information such as table name, fields, filtering conditions, and time range based on the entity dictionary and intent type.
[0008] Furthermore, the text understanding layer identifies specific ERP entities based on regular expression matching, including company code, product code, order number, document type, date / time range, and numerical value; the text understanding layer completes synonym standardization through an ERP business term synonym mapping table, unifying sales order and SO as order, and purchase order and PO as purchase.
[0009] Furthermore, the intent types in the intent classification layer include query, statistics / summary, counting, analysis, sorting, filtering, grouping, association, calculation, and time series; the intent score calculation rule is that the keyword weight in the normalized query is 2, the keyword weight in the word segmentation result is 1, and the confidence score = main intent score / total score.
[0010] Furthermore, the SQL processing module includes an SQL verification unit, an SQL repair unit, and an SQL optimization unit. The SQL verification unit only allows SELECT queries and prohibits dangerous SQL operations such as DROP, DELETE, and TRUNCATE, while detecting syntax errors such as SQL truncation and unclosed parentheses. The SQL repair unit automatically detects and repairs the risk of Cartesian products in ERP multi-table joins and field truncation issues, and adds company code filtering conditions to all SQL statements. The SQL optimization unit adds TOP restrictions to SQL statements that return a large number of results and optimizes the JOIN order.
[0011] Furthermore, the SQL repair unit automatically detects and adds JOIN conditions for missing OrderLine fields in the ERP detail tables OrderDtl, ShipDtl, and InvcDtl; the SQL repair unit, based on the EPICOR_FIELD_MAPPING mapping table, repairs truncated field names such as Order and PartN to OrderNum and PartNum.
[0012] Furthermore, the ERP data interaction module includes a lightweight middleware layer. This lightweight middleware layer communicates with the ERP main system through the ERP's REST API or BAQ, and uses an incremental synchronization strategy to capture ERP data changes in real time and establish an optimized cache index in the middleware layer.
[0013] Furthermore, it also includes a caching module and a permission adaptation module; the caching module adopts a multi-level caching mechanism, including schema context caching, Excel metadata caching and database connection pool; the permission adaptation module filters ERP business data based on user roles, while recording users' high-frequency queries and operations and actively pushing quick access points.
[0014] Furthermore, in step S4, the LLM calling module dynamically adjusts the max_tokens parameter of the large language model according to the query complexity, setting it to 1500 for simple queries, 2500 for medium queries, and 3000 for complex queries, while setting the temperature parameter of the large language model to 0.1; in step S7, the result display module provides feedback on the results in a multimodal form, including table / chart visualization, natural language summarization, and summary statistics, and provides modification suggestions with cause analysis for erroneous queries.
[0015] 3. Beneficial effects: Compared with the prior art, the technical solution provided by this invention has the following advantages: Based on a three-layer intent recognition architecture customized for ERP business, the intent recognition accuracy is >90% and the SQL generation accuracy is >85%. It can understand complex contexts and multi-condition business queries, and transform professional ERP language into natural language, which greatly reduces the learning threshold of ERP operation and improves the accuracy of intent recognition and query. Through a lightweight middleware layer and an incremental real-time data synchronization mechanism, the middleware layer undertakes most of the query calculation tasks, reducing the load on the ERP main system by about 40%. Simple queries have a response time of only 2-5 seconds, and complex queries can be controlled within 20 seconds, thus reducing the load on the ERP main system and improving the response speed. Business rules embedded in ERP sales, procurement and other modules are automatically validated before operation execution, mapping natural language commands into compliant ERP business operation sequences. Business operations completed through the question-and-answer interface have a success rate of over 98%, significantly reducing manual review costs and achieving compliant ERP business operations. Through data visualization in tables and charts, combined with a multimodal feedback mechanism of natural language summarization, users' average time to understand business data is reduced by 50%, and it supports fuzzy query fault tolerance and multi-turn dialogue context association, further improving operational efficiency, optimizing user interaction experience, and enhancing information delivery efficiency. The multi-level caching mechanism avoids redundant calculations, and the modular architecture supports flexible replacement of LLM models and intent analysis algorithms, which can be extended to ERP systems of different brands. At the same time, it only allows SELECT queries and prohibits dangerous SQL operations, effectively preventing SQL injection and ensuring ERP data security, with high performance, high scalability and high security. Attached Figure Description
[0016] Figure 1 This is a system module diagram of the ERP Natural Language Interactive Intelligent Business Processing System of the present invention; Figure 2 This is a flowchart of the ERP natural language interactive intelligent business processing method of the present invention; Figure 3 This is a flowchart of the three-layer intent recognition process of the intent analysis module of the present invention; Figure 4 This is a schematic diagram of the interactive interface of the invention system. Detailed Implementation
[0017] To facilitate understanding of the present invention, a more complete description of the invention will be given below with reference to the accompanying drawings, which illustrate several embodiments of the invention. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that the disclosure of the invention will be more thorough and complete.
[0018] The ERP Natural Language Interactive Intelligent Business Processing System of this invention adopts a layered modular architecture, including an interaction module, an intent analysis module, a schema context generation module, an LLM call module, an SQL processing module, an ERP data interaction module, a result display module, a caching module, and a permission adaptation module. Each module is deployed independently and works collaboratively. The specific functions are implemented as follows: Interaction module: Provides users with dual text / voice input interfaces, receives users' natural language query / operation commands, and records multi-turn dialogue history to provide data support for context association; transmits user commands to the intent analysis module and receives feedback results from the results display module to present to the user; supports responsive layout and can be embedded in the ERP native UI layer; Intent Analysis Module: Adopts a three-layer intent recognition architecture, including a text understanding layer, an intent classification layer, and a slot filling layer. It is customized for ERP business and does not rely on the pre-training capabilities of general NLP models. It completes natural language preprocessing, semantic parsing, intent recognition, and structured slot information extraction, and outputs core information such as table names, fields, and filtering conditions. Schema Context Generation Module: Based on the slot information output by the intent analysis module, it loads Excel metadata from the cache module, extracts the table structure, field business meaning, inter-table relationships, and currency field information from the ERP database, and generates a customized schema context; it supports dynamically adjusting the level of detail of the schema context according to the query complexity, with simple queries containing only basic field information, and complex queries adding table relationships, JOIN examples, and other content; The LLM calling module encapsulates the API interfaces of large language models such as Tongyi Qianwen, constructs structured prompt words based on 700+ lines of customized ERP system rules, schema context, and user queries, and calls the large language model to dynamically generate SQL statements; it supports dynamically adjusting max_tokens and temperature parameters according to query complexity to ensure the accuracy and stability of SQL generation; SQL processing module: Includes SQL verification unit, SQL repair unit, and SQL optimization unit, completing the entire process of SQL statement processing; only allows SELECT queries, prohibits dangerous SQL operations, automatically detects and repairs unique issues such as Cartesian product risks in ERP multi-table joins and field truncation, and optimizes the performance of queries that return a large number of results; ERP Data Interaction Module: Includes a lightweight middleware layer that communicates with the main ERP system via EPICORERP's RESTAPI or BAQ. It uses an incremental synchronization strategy to capture ERP data changes in real time, establishes optimized cache indexes in the middleware layer, executes optimized SQL statements to obtain ERP business data, or maps natural language operation instructions to ERP business operation sequences and performs business rule verification. Results Display Module: Receives query / operation results returned by the ERP data interaction module, completes data formatting, natural language summary generation, and data visualization; provides feedback on results in a multimodal format, offers modification suggestions with cause analysis for erroneous queries, supports user feedback on results, and data formatting specifically includes standardization of numbers, currencies, and dates, while data visualization specifically includes tables, charts, etc. Cache module: Employs a multi-level caching mechanism, including schema context caching, Excel metadata caching, and database connection pooling, reusing database connections and generated schema contexts to avoid redundant calculations and significantly improve system response speed; Permission adaptation module: Based on user roles, it performs precise filtering of ERP business data to ensure that users can only access data within their authorized scope; at the same time, it records users' high-frequency queries and operations, and proactively pushes quick access points to realize personalized services.
[0019] A three-tier intent recognition architecture was custom-developed for ERP business, with the processing steps, rules, and inputs / outputs of each layer as follows: 1. Text Understanding Layer Input: User's raw natural language query / operation command; The core processing rules include: 1) Text preprocessing: removing leading and trailing spaces, standardizing punctuation, removing modal particles and stop words, and standardizing time formats; 2) Entity recognition: identifying specific ERP entities based on regular expression matching, including company code (EPIC\d{2}), product code, order number, document type, date / time range, and numerical values; 3) Synonym standardization: based on the ERP business terminology synonym mapping table, unifying "sales order" and "SO" as "order", and "purchase order" and "PO" as "purchase", etc.; 4) Word segmentation: performing simple word segmentation based on spaces and punctuation. The regular expression matching rules for specific entities in ERP are described in text as follows: ① Company code: Matches character combinations that begin with EPIC followed by two digits, such as EPIC06 and EPIC03; ②Product code: Matches two character combination formats, one is a three-segment character combination (each segment has at least 3 letters / numbers, connected by hyphens), and the other is a continuous character combination of at least 2 letters and at least 2 numbers; ③ Order Number: Matches combinations containing the word "order" followed by numbers, or combinations containing the OrderNum field identifier followed by numbers (a colon, equals sign, or space may exist between the identifier and the numbers). ④ Document Types: Precisely matches four fixed document types: sales orders, purchase orders, delivery notes, and invoices; ⑤ Date / Time Range: Recognizes relative time (this month, last quarter, etc.) and absolute time (xxxx-xx-xx to xxxx-xx-xx, etc.) in natural language and converts them into the standard date format xxxx-xx-xx.
[0020] The synonym standardization follows EPICOR's fixed mapping rules for business terms. The core mapping relationships are: Order ←→ Sales Order, SO, SalesOrder; Purchase ←→ Purchase Order, PO, PurchaseOrder; Customer ←→ Customer, Customer; Material ←→ Part, Product, Item; Shipment ←→ Shipment, Delivery; Invoice ←→ Invoice, Invc. Output: Normalized query, entity dictionary, word segmentation results.
[0021] 2. Intent Classification Layer Input: The output of the text understanding layer; The core processing rules include: (1) Intent keyword matching: matching 10 core ERP intent types, including query, statistics / summary, counting, analysis, sorting, filtering, grouping, association, calculation, and time series; (2) Intent score calculation: the keyword weight in the normalized query is 2, and the keyword weight in the word segmentation result is 1. Calculate the score of each intent type; (3) Intent determination: the highest score is the primary intent, and the non-primary intent with a score > 0 is the secondary intent. Confidence = primary intent score / total score; The specific calculation principles and examples for intent score and confidence level are as follows: Weighting principle: Intent keywords appearing in the normalized query are assigned a weight of 2; intent keywords appearing in the word segmentation results are assigned a weight of 1. Score Calculation: For each intent type, the corresponding weights of its associated keywords in the standardized query and word segmentation results are summed to obtain the total score for that intent type; Confidence score calculation: Confidence score = Total score of primary intent type / Sum of total scores of all intent types; Calculation example: If the keyword "statistics" appears in the normalized query and there are no other intent keywords in the word segmentation results, then the intent score for "statistics / summary" is 2, the total score is 2, and the confidence level is 1; if the normalized query contains the keyword "query" (2 points) and the word segmentation results contain the keyword "sort" (1 point), then "query" is the primary intent (2 points) and "sort" is the secondary intent (1 point), the total score is 3, and the confidence level is approximately 0.67; Output: list of primary intents and secondary intents, confidence level, and score for each intent.
[0022] 3. Slot filling layer Input: Output results from the text understanding layer and the intent classification layer; The core processing rules include: (1) Table name extraction: Based on the EPICOR_TABLE_MAPPING mapping table, the table name is inferred through business keywords, and the 19 core business tables of ERP are matched first; (2) Field / condition / time range extraction: Extract the fields, filtering conditions (such as Company='EPIC06') and time range involved in the query, and identify aggregation operations such as SUM and COUNT; (3) Sorting / grouping rule extraction: Identify ascending / descending sorting rules and GROUPBY grouping fields; The table name extraction executes the EPICOR business keyword and data table fixed mapping rules, prioritizing the matching of 19 core ERP business tables. The core mapping relationships are: Order → OrderHed, OrderDtl; Customer → Customer; Material → Part; Supplier → Supplier; Purchase Order → POHeader, PODetail; Ship Order → ShipHead, ShipDtl; Invoice → InvcHead, InvcDtl.
[0023] The field extraction executes the EPICOR business field keyword mapping rules, with the core relationships being: Amount → DocAmount, ExtPrice; Currency Type → DocCurrency, RptCurrency; Order Date → OrderDate; Request Date → ReqDate; Shipment Date → ShipDate.
[0024] The conditional extraction executes two fixed rules: First, it automatically adds a company code filter condition to all queries, which is fixed as Company='EPIC06'; second, it uniformly maps the business status description in natural language to the standard status values of the ERP system (such as Shipped, Incomplete, Closed). Output: List of table names, list of fields, list of filter conditions, time range, list of aggregation operations, sorting rules, and list of grouping fields.
[0025] The schema context generation module generates a customized schema context for ERP based on the table name information output by the intent analysis module. The specific steps are as follows: Identify the relevant tables: obtain them from the list of table names in the slot filling layer; if not specified, infer them based on business keywords. Load Excel metadata: Read pre-loaded Excel metadata from the cache module and extract table structure, field descriptions, data types, and business meanings; Generate Schema context: Includes table structure, field business meaning, inter-table relationships, common JOIN examples, and currency field information. Simple queries only include basic field information, while complex queries add examples and relationship information. Currency field detection: Automatically detects the document currency field (starting with Doc) and report currency field in the table, marks the currency type and generates usage tips; Output: Customized schema context (including currency field hints).
[0026] The specific implementation methods for SQL generation and processing are as follows: LLM dynamically generates SQL: The LLM calls a module to build suggestion words, including 700+ lines of EPICOR customized system rules, schema context, currency field suggestions, and user queries, and calls the Tongyi Qianwen API to generate SQL; max_tokens is dynamically adjusted according to query complexity: 1500 for simple queries, 2500 for medium queries, and 3000 for complex queries, with the temperature parameter set to 0.1 to ensure stable output; SQL Validation: The SQL validation unit performs security checks, prohibiting dangerous keywords such as DROP, DELETE, and TRUNCATE, and only allowing SELECT queries; it also detects syntax errors such as SQL truncation, unclosed parentheses, and incomplete JOIN conditions. SQL Auto-Repair: The SQL repair unit automatically repairs common SQL issues in ERP systems: 1) Cartesian Product Repair: Detects if the OrderLine field is missing in the joins of detail tables (OrderDtl / ShipDtl / InvcDtl) and automatically adds the missing JOIN condition; 2) Field Truncation Repair: Based on the EPICOR_FIELD_MAPPING mapping table, repairs truncated field names, such as Order→OrderNum, PartN→PartNum; 3) Company Code Appending: Automatically adds the Company='EPIC06' filter condition to all SQL statements. The above repairs are all based on EPICOR's customized judgment rules and execution steps. The specific detection logic and repair operations are as follows: Cartesian Product Detection and Repair Rules: ① Detection and Judgment Rules: For SQL statements involving ERP detail table relationships such as OrderDtl, ShipDtl, and InvcDtl, sequentially determine whether both OrderNum and OrderLine fields are included in the same equivalence condition. If either condition is missing, a Cartesian product risk is identified. ② Repair Execution Steps: For detail table relationship statements lacking an OrderLine field equivalence condition, directly append an equivalence matching condition for the OrderLine field after the original OrderNum field equivalence condition to complete the relationship condition. This rule applies to all detail table relationship scenarios involving ShipDtl and OrderDtl, InvcDtl and OrderDtl, and ShipDtl and InvcDtl. Field truncation repair rules and execution steps: ① The fixed mapping relationship between truncated fields and standard fields is: Order→OrderNum, PartN→PartNum, Cust→CustNum, DocAm→DocAmount, RptAm→RptAmount, OrderL→OrderLine; ② Repair execution steps: Traverse all field names in the SQL statement, and replace the content that matches the above truncated field names with the corresponding standard field names; ignore case differences during field name matching to ensure full replacement without omissions; The automatic appending of company code is performed on the generated SQL statement in two scenarios, with the fixed appending condition being Company='EPIC06': ① If the SQL statement does not contain a WHERE clause, "WHERECompany='EPIC06'" is directly appended to the end of the statement; ② If the SQL statement already contains a WHERE clause, "Company='EPIC06'AND" is directly concatenated after the WHERE clause, and then the original filtering condition is added to ensure that the company code condition is the primary filtering rule. SQL optimization: The SQL optimization unit adds a TOP constraint to queries that return a large number of results, optimizes the JOIN order, and improves query performance.
[0027] The specific implementation methods for ERP data interaction and result display are as follows: ERP Data Interaction: The ERP data interaction module obtains a SQL Server connection from the database connection pool, executes optimized SQL statements, and converts the results into DataFrame format; for natural language operation instructions, it maps them to ERP business operation sequences, performs business rule verification, such as supplier qualifications, credit limits, and pricing strategies, and calls the ERP API to execute the operation after the verification is successful. Result formatting: Format the query results, keep numbers to 2 decimal places and add thousands separators, add symbols (€ / $) to currencies according to their codes, and use a uniform date format; Multimodal feedback: The results display module visualizes formatted results in tables / charts, generates natural language summaries and summary statistics, such as total amount and total quantity; it provides user-friendly modification suggestions for erroneous queries and supports user feedback on the results.
[0028] The above-described embodiments are merely illustrative of certain implementations of the present invention, and are described in a relatively specific and detailed manner. However, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements are all within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. An ERP natural language interactive intelligent business processing system, characterized in that: include: The interaction module receives natural language queries / operation commands from users and records multi-turn dialogue history; The intent analysis module communicates with the interaction module to preprocess natural language commands, perform semantic parsing, intent recognition, and structured information extraction, and output slot information such as table names, fields, and filtering conditions. The schema context generation module communicates with the intent analysis module to generate a customized schema context for the ERP database based on the slot information, which includes table structure, field business meaning, inter-table relationships and currency field information. The LLM calling module communicates with the Schema context generation module, constructs prompt words based on ERP customized system rules, Schema context and user queries, and calls the large language model to dynamically generate SQL statements; The SQL processing module communicates with the LLM calling module to perform security checks, error detection, automatic repair, and performance optimization on the SQL statements. The ERP data interaction module communicates with the SQL processing module and the ERP main system to execute optimized SQL statements to obtain ERP data, or to map natural language operation instructions into ERP business operation sequences and perform business rule verification. The results display module communicates with the ERP data interaction module and the interaction module to format, visualize, and generate natural language summaries of the ERP data, and then feeds the results back to the user.
2. An ERP natural language interactive intelligent business processing method, implemented based on the system described in claim 1, characterized in that, Includes the following steps: S1: The interaction module receives the user's natural language query / operation instructions and transmits them to the intent analysis module; S2: The intent analysis module processes natural language commands and outputs standardized queries, entity information, intent types, and slot information; S3: The Schema context generation module loads ERP metadata based on the slot information and generates a customized Schema context; S4: The LLM calling module builds the prompt word project and calls the large language model to dynamically generate SQL statements; S5: The SQL processing module performs security checks, error detection, automatic repair, and performance optimization on the SQL statement, and outputs a compliant optimized SQL statement; S6: The ERP data interaction module executes the optimized SQL statement to obtain business data from the ERP main system, or performs business rule verification on the natural language operation instructions and then calls the ERP API to complete the business operation; S7: The results display module formats, visualizes, and generates natural language summaries of the business data, and provides feedback to the user through the interaction module.
3. The ERP Natural Language Interactive Intelligent Business Processing System according to claim 1, characterized in that: The intent analysis module adopts a three-layer intent recognition architecture, including a text understanding layer, an intent classification layer, and a slot filling layer. The text understanding layer preprocesses natural language instructions, performs entity recognition, synonym normalization, and word segmentation, and outputs a normalized query, an entity dictionary, and word segmentation results. The intent classification layer performs intent keyword matching and score calculation on the normalized query to determine the primary intent, secondary intent, and confidence level. The slot filling layer extracts structured slot information such as table name, fields, filtering conditions, and time range based on the entity dictionary and intent type.
4. The ERP natural language interactive intelligent business processing system according to claim 3, characterized in that: The text understanding layer identifies specific ERP entities based on regular expression matching, including company code, product code, order number, document type, date / time range, and numerical value. The text understanding layer completes the synonym standardization through the ERP business term synonym mapping table, unifying sales order and SO as order, and purchase order and PO as purchase.
5. The ERP natural language interactive intelligent business processing system according to claim 3, characterized in that: The intent types in the intent classification layer include query, statistics / summary, counting, analysis, sorting, filtering, grouping, association, calculation, and time series. The intent score calculation rule is that the keyword weight in the normalized query is 2, the keyword weight in the word segmentation result is 1, and the confidence score = main intent score / total score.
6. The ERP Natural Language Interactive Intelligent Business Processing System according to claim 1, characterized in that: The SQL processing module includes an SQL verification unit, an SQL repair unit, and an SQL optimization unit; The SQL verification unit only allows SELECT queries and prohibits dangerous SQL operations such as DROP, DELETE, and TRUNCATE. It also detects syntax errors such as SQL truncation and unclosed parentheses. The SQL repair unit automatically detects and repairs the risk of Cartesian product in ERP multi-table joins and field truncation issues, and adds company code filtering conditions to all SQL statements. The SQL optimization unit adds TOP restrictions to SQL statements that return a large number of results and optimizes the JOIN order.
7. The ERP Natural Language Interactive Intelligent Business Processing System according to claim 6, characterized in that: The SQL repair unit automatically detects the associations of the ERP detail tables OrderDtl, ShipDtl, and InvcDtl and adds JOIN conditions for the missing OrderLine field; the SQL repair unit, based on the EPICOR_FIELD_MAPPING mapping table, repairs truncated field names such as Order and PartN to OrderNum and PartNum.
8. The ERP Natural Language Interactive Intelligent Business Processing System according to claim 1, characterized in that: The ERP data interaction module includes a lightweight middleware layer. This lightweight middleware layer communicates with the ERP main system through the ERP's REST API or BAQ, and uses an incremental synchronization strategy to capture ERP data changes in real time and establish an optimized cache index in the middleware layer.
9. The ERP Natural Language Interactive Intelligent Business Processing System according to claim 1, characterized in that: It also includes a caching module and a permission adaptation module; the caching module adopts a multi-level caching mechanism, including schema context caching, Excel metadata caching and database connection pool; the permission adaptation module filters ERP business data based on user roles, while recording users' high-frequency queries and operations and actively pushing quick access points.
10. The ERP natural language interactive intelligent business processing method according to claim 2, characterized in that: In step S4, the LLM calling module dynamically adjusts the max_tokens parameter of the large language model according to the query complexity: 1500 for simple queries, 2500 for medium queries, and 3000 for complex queries. The temperature parameter of the large language model is set to 0.
1. In step S7, the result display module provides feedback on the results in a multimodal form, including table / chart visualization, natural language summarization, and summary statistics. It also provides modification suggestions with cause analysis for erroneous queries.