Enterprise intelligent number asking implementation method and device and storage medium

By splitting user queries into entities, indicators, attributes and time dimensions, and combining large language modules to generate SQL query statements, the problem of traditional methods' syntax requirements and format restrictions is solved, and more flexible and efficient query processing is achieved.

CN119884166APending Publication Date: 2025-04-25BEIJING KNOWLEDGE ATLAS TECHNOLOGY CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411934802.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

Traditional NL2SQL methods have high syntax requirements and format restrictions on user queries, and cannot effectively handle non-standard queries in which users use natural language, professional terms or spoken language.

Method used

By obtaining user queries, it is divided into multiple dimensions of entity, indicator, attribute and time, and uses the time, indicator, entity and attribute intention recognition model for extraction, and uses the large language module to generate SQL query statements.

Benefits of technology

It significantly improves the system's responsiveness and accuracy when handling complex and fuzzy queries. Users can use professional terms or idiomatic language to query, which has higher flexibility and better user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884166A_ABST
    Figure CN119884166A_ABST
Patent Text Reader

Abstract

The invention relates to an enterprise intelligent number asking implementation method and device and a storage medium, and belongs to the technical field of artificial intelligence. The method comprises the steps of obtaining user inquiry; concurrent intention recognition is performed on user inquiry, and elements of the user inquiry are divided into multiple dimensions of entities, indexes, attributes and time, a time intention recognition model is adopted to extract related time, an index intention recognition model is adopted to extract related indexes, an entity intention recognition model is adopted to extract related entities, and an attribute intention recognition model is adopted to extract related attributes, so that an intention recognition result is obtained; and inputting results of the user inquiry and the intention recognition into a large language module to generate an SQL query statement. According to the method and the device, the response capability and the accuracy of the system in processing complex and fuzzy queries are remarkably improved, and the method and the device have relatively high flexibility and better user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a method, device and storage medium for implementing enterprise intelligent statistics. Background Art

[0002] Traditional NL2SQL (Natural Language to SQL) methods usually require users to provide clear query requirements, including query fields, filter conditions, sorting, aggregation and other operations. This method generates SQL statements based on rules or templates. Therefore, the user's query needs to be very standardized and structured to be correctly converted into SQL queries. For example, the user needs to clearly specify the table, field and query conditions to be queried.

[0003] However, in actual applications, users' queries are often in natural language and may contain professional terms, colloquial expressions or abbreviations, which are often not standardized or do not conform to the structure of traditional SQL queries. For example, users may use industry-specific terms or abbreviations, such as "sales volume" may use different terms in certain industries (such as "sales volume", "shipments"). For example, "the number of signed contracts last month" may not fully comply with the SQL field naming rules, and the user's expression is closer to daily communication rather than precise database queries. In these cases, existing methods for implementing enterprise Q&A cannot correctly parse and convert query requests into valid SQL statements, making it difficult to query valid information.

[0004] Therefore, how to better handle non-standard queries, generate correct SQL statements, and avoid the precise syntax requirements and format restrictions in traditional methods is a topic worthy of study. Summary of the invention

[0005] In view of the above analysis, the embodiments of the present invention aim to provide a method, device and storage medium for implementing enterprise intelligent statistics, so as to solve the problem of high grammar requirements and format restrictions in traditional enterprise intelligent statistics implementation.

[0006] In a first aspect of the present application, a method for implementing enterprise intelligent data query is provided, comprising:

[0007] Obtain user inquiries;

[0008] Concurrently identify the user query, split the elements of the user query into multiple dimensions of entity, indicator, attribute and time, respectively use the time intention recognition model to extract the time involved, use the indicator intention recognition model to extract the indicator involved, use the entity intention recognition model to extract the entity involved, and use the attribute intention recognition model to extract the attribute involved, to obtain the result of intent recognition;

[0009] The user query and the result of the intent recognition are input into the big language module to generate an SQL query statement.

[0010] Optionally, the concurrent intent recognition of the user query includes:

[0011] The time intention recognition model, the indicator intention recognition model, the entity intention recognition model, and the attribute intention recognition model run concurrently on different microservers as independent components and communicate with each other through a network.

[0012] Optionally, the performing concurrent intent recognition on the user query to obtain a result of intent recognition includes:

[0013] When the number of concurrent request tasks exceeds a preset range, the concurrent request tasks are distributed to different micro servers through a load balancer; the load balancer dynamically adjusts the distribution of concurrent request tasks according to the traffic.

[0014] Optionally, the performing concurrent intent recognition on the user query to obtain a result of intent recognition includes:

[0015] Using a message queue to obtain response data obtained by the time intent recognition model, the indicator intent recognition model, the entity intent recognition model, and the attribute intent recognition model respectively;

[0016] After all response data are obtained, the response data are summarized to obtain the result of intent recognition.

[0017] Optionally, the extracting the involved time by using the time intention recognition model includes:

[0018] A time intention recognition model is used to determine whether the time granularity of the user's query is clear; if so, the time granularity is output; if not, a confirmation item is output requiring the user to clarify the time granularity;

[0019] A time intention recognition model is used to extract the time range involved in the user query and convert it into a time description in a standardized format.

[0020] Optionally, the extracting the related indicators by using the indicator intention recognition model includes:

[0021] Build a database mapping business terms to standard indicator descriptions;

[0022] Vectorizing the user query and the business term respectively to obtain a vector representation of the user query and a vector representation of the business term;

[0023] Calculating the similarity between the vector representation of the user query and the vector representation of the business term, and determining a plurality of candidate business terms matching the user query;

[0024] A plurality of candidate business terms and a mapping database are input into a large language model, and the large language model is used to extract standard indicator descriptions in the user query.

[0025] Optionally, the extracting the related indicators by using the indicator intention recognition model includes:

[0026] Input the user query into the AC automaton, extract the standard indicators existing in the indicator library, and obtain a preliminary extraction result; wherein the AC automaton is used to extract the indicators existing in the indicator library in the user query and complete the mapping from non-standard indicators to standard indicators;

[0027] The user query is input into the big model, and the big model performs abbreviation completion and spoken language reasoning on non-standard indicators to obtain a processed text;

[0028] The processed text is input into the AC automaton again for extraction to form the final standard indicator description.

[0029] Optionally, extracting the involved entities by adopting the entity intent recognition model includes:

[0030] According to the entity composition rules, an entity is split into a set of multiple elements as search fields;

[0031] Create new search fields based on entity elements and aliases;

[0032] Search based on the search field and the new search field, and if a match is found, take the corresponding entity as the extraction result;

[0033] If no entity is found, a large language model is used to extract entities in the user query, and the extracted entities are vectorized to obtain extracted entity vectors;

[0034] Calculate the cosine similarity between the extracted entity vector and the vectors of all possible entities in the database, and select the most similar entity as the final matching result.

[0035] Optionally, extracting the involved attributes by using the attribute intent recognition model includes:

[0036] For Boolean attributes, determine whether the user query includes preset keywords to determine the attribute value;

[0037] For an enumerated attribute, verify whether the specific value mentioned in the user query is in a predefined enumerated value list;

[0038] For inference attributes, the inference results are obtained through inference using the pre-trained attribute intent recognition model, and the inference results are aligned with the relevant data in the database.

[0039] In a second aspect of the present application, there is provided an enterprise intelligent data implementation device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the enterprise intelligent data implementation method according to any one of the above is implemented.

[0040] According to a third aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the enterprise intelligent data implementation method according to any one of the above-mentioned methods is implemented.

[0041] The enterprise intelligent query implementation method provided in this application obtains user queries; performs concurrent intent recognition on user queries, splits the elements of the user queries into multiple dimensions of entities, indicators, attributes and time, respectively uses the time intent recognition model to extract the time involved, uses the indicator intent recognition model to extract the indicators involved, uses the entity intent recognition model to extract the entities involved, and uses the attribute intent recognition model to extract the attributes involved, to obtain the result of intent recognition; inputs the user query and the result of the intent recognition into the large language module to generate SQL query statements. The method provided in this application splits the elements of the user query into four dimensions of entity, indicator, attribute and time for analysis, and further combines an enhanced search method to solve the problem of inaccurate queries caused by non-standard user queries, and significantly improves the system's responsiveness and accuracy when processing complex and fuzzy queries. Users can use professional terms or idiomatic language to make inquiries, which has high flexibility and better user experience.

[0042] In addition, the present application also provides an enterprise intelligent data implementation device and storage medium having the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0044] Figure 1 A flowchart of a specific implementation method of the enterprise intelligent data query implementation method provided by this application;

[0045] Figure 2Schematic diagram of the enterprise intelligent data implementation method provided by this application

[0046] Figure 3 Workflow diagram for the temporal intent recognition model;

[0047] Figure 4 Provide a workflow diagram for the indicator intent identification model;

[0048] Figure 5 Workflow diagram for the entity intent recognition model;

[0049] Figure 6 A schematic diagram for extracting indicators;

[0050] Figure 7 This is a structural block diagram of the enterprise intelligent data implementation device provided in this application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that, in the absence of conflict, the embodiments in the present disclosure and the features in the embodiments can be combined, separated, interchanged and / or rearranged with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0052] The terms used here are for the purpose of describing specific embodiments, and are not intended to be restrictive. As used here, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups. It should also be noted that, as used here, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values ​​and / or the values ​​provided that will be recognized by those of ordinary skill in the art.

[0053] A flowchart of a specific implementation method of the enterprise intelligent data implementation method provided in this application is as follows: Figure 1 As shown, it can be understood that the query refers to the process of generating SQL query statements based on user queries, executing and returning relevant data. The method specifically includes:

[0054] S101: Obtain user query.

[0055] S102: Perform concurrent intent recognition on the user query, split the elements of the user query into multiple dimensions of entity, indicator, attribute and time, respectively use the time intent recognition model to extract the time involved, use the indicator intent recognition model to extract the indicators involved, use the entity intent recognition model to extract the entities involved, and use the attribute intent recognition model to extract the attributes involved, to obtain the intent recognition result.

[0056] As a specific implementation method, the time intent recognition model, the indicator intent recognition model, the entity intent recognition model, and the attribute intent recognition model are run concurrently on different microservers as independent components, and communicate with each other through the network. This can not only achieve physical isolation and parallel processing, but also dynamically expand or shrink resources according to the load of each service.

[0057] When the number of concurrent request tasks exceeds a preset range, the concurrent request tasks are distributed to different micro servers through a load balancer; the load balancer dynamically adjusts the distribution of concurrent request tasks according to the traffic.

[0058] A message queue is used to obtain the response data obtained by the time intention recognition model, the indicator intention recognition model, the entity intention recognition model, and the attribute intention recognition model respectively; after all the response data are obtained, the response data are summarized to obtain the result of intent recognition.

[0059] By breaking down user queries into different intent dimensions (time, metrics, entities, attributes), the query content can be analyzed and understood more comprehensively. This refined processing method allows the system to not only identify key information in the query, but also understand its context and details, thereby improving the accuracy of recognition. In addition, concurrent processing of various intents allows the system to analyze multiple aspects at the same time, which can process complex queries in a short period of time and improve response speed. At the same time, parallel processing also means that the system can focus on key elements in the query more quickly, rather than processing them one by one in a linear manner, thereby improving processing efficiency and accuracy.

[0060] S103: Input the user query and the result of the intention recognition into a large language module to generate an SQL query statement.

[0061] The user query, the result of the intent recognition, the SQL generation standard, the few-sample learning examples, and the fields of the table are input into the large language module to generate an SQL query statement that meets the requirements.

[0062] Furthermore, if the generated SQL query statement is executed incorrectly, the error description returned by the execution and the generated SQL query statement are given to the large model, and a repaired SQL statement is generated.

[0063] Compared with the traditional method of training NL2SQL models, this application implements NL2SQL functions at a lower cost without the need to collect and annotate training data sets. Compared with the method of directly using large models to generate SQL queries for users, this application designs a powerful concurrent intent recognition module. This module splits the elements of user queries into four dimensions: entities, indicators, attributes, and time for analysis, and further combines enhanced search methods to solve the problem of inaccurate queries caused by non-standard user queries, and significantly improves the system's responsiveness and accuracy when processing complex and ambiguous queries. Users can use professional terms or idiomatic language to inquire, which has extremely high flexibility and a better user experience.

[0064] Figure 2 FIG. 1 shows a schematic diagram of a method for implementing enterprise intelligent data query provided by the present application. Based on any of the above embodiments, Figure 3 As shown in the workflow diagram of the time intention recognition model, the time involved in the extraction of the time using the time intention recognition model includes:

[0065] S301: using a time intention recognition model to determine whether the time granularity of the user's inquiry is clear; if so, outputting the time granularity; if not, outputting a confirmation item requiring the user to clarify the time granularity.

[0066] Time granularity identification is used to identify whether the time granularity of the user's query is clear and output the specific time granularity. If the time granularity of the user's query is clear, the specific time granularity [day|week|month|quarter|year] is output.

[0067] For example: How many subscription units will be sold in Hefei in the first quarter of 2023?

[0068] Output {"status":"clear","optionaltimegranularity":["season"]}

[0069] If the time granularity asked by the user is ambiguous, a confirmation item is output, asking the user to clarify the time granularity.

[0070] For example: What is the trend of the number of contracted units in Shenzhen this year? This user question has multiple explanations, and can output daily trends, weekly trends, or monthly trends, so it is necessary to further clarify it to the user.

[0071] Output {"status":"rhetorical question","optional time granularity":["day","week","day","month","quarter"]}

[0072] The model training process is as follows:

[0073] (1) Construct a dataset based on categories and build a script to automatically generate data:

[0074] Specifically, the training data can be classified according to the output results so that the model can learn the judgment logic of different categories. The specific categories are as follows:

[0075] {"status":"clear","optionaltimegranularity":["day"]},

[0076] {"status":"clear","optional_granularity":["week"]},

[0077] {"status":"clear","optionaltimegranularity":["month"]},

[0078] {"status":"clear","optional_granularity":["season"]},

[0079] {"status":"clear","optionaltimegranularity":["year"]},

[0080] {"status":"clear","optional_granularity":[""]},

[0081] {"status":"rhetorical question","optional time granularity":["day","week","month","quarter","year"]},

[0082] {"status":"rhetorical question","optional time granularity":["day","week","month","quarter"]},

[0083] {"status":"rhetorical question","optional time granularity":["day","week","month"]},

[0084] {"status":"rhetorical question","optional time granularity":["day","week"]},

[0085] A certain number of user queries are collected for each category. For example, for the category {"status": "clear", "optional time granularity": ["season"]}, user queries are collected: How many units were subscribed to Hefei Jingyuan in the first quarter of 2023? And it is converted into a standard template: What is the [indicator] of [entity] [season description]? Subsequently, the use case is expanded by replacing the specific values ​​of [entity], [season description], and [indicator] to generate large-scale training samples.

[0086] (2) Construction of training set and validation set

[0087] During the training phase, in order to ensure the balance between categories so that the model can be fully learned, each category is divided into a training set and a validation set at a ratio of 5:1. The training set is used for learning and training the model, and the validation set is used to evaluate the generalization ability of the model.

[0088] Model training results: After training, the model was tested on 350 real user queries collected, with 349 correct answers and 1 incorrect answer, an accuracy rate of 99.7% and an average response time of 0.807s.

[0089] S302: Using a time intention recognition model to extract the time range involved in the user query, and convert it into a time description in a standardized format.

[0090] Time range extraction: used to extract the time range involved in user queries and convert it into a standard description.

[0091] For example: What is the decoration subscription amount of Shiyan Lanxi Valley in the fourth quarter of 2022?

[0092] Output: {"Time Range":[{"Start Date":"2022-Q4","End Date":"2022-Q4"}]}

[0093] The process of model inference is:

[0094] Model input: "What is the renovation subscription amount of Shiyan Lanxi Valley in the fourth quarter of 2022?", {time granularity: quarter}

[0095] Model output: {'R category':'R14','year':{'need reasoning':[],'no reasoning needed':

[2022] },'season':{'need reasoning':[],'no reasoning needed':[4]}}

[0096] After conversion: {'Time Range':[{'Start Date':'2022-Q4','End Date':'2022-Q4'}]}

[0097] The model training process is as follows:

[0098] (1) Based on business understanding, time is divided into the following categories. Here are some examples:

[0099] Business-related derivation rules:

[0100] R1: Daily derivation rules

[0101] 1. Last 3 days, Recent 3 days, Past 3 days: September 27, 2024 - September 29, 2024

[0102] R2: Weekly derivation rules

[0103] 1. Recent week, most recent week, past week: September 23, 2024 - September 29, 2024

[0104] R3: Monthly derivation rules

[0105] 1. Recent half month, most recent half month, past half month: September 15, 2024 - September 29, 2024

[0106] R4: Seasonal derivation rules

[0107] 1. Recent quarter, most recent quarter, past quarter: Q3 2024 - Q3 2024

[0108] R5: Year derivation rules

[0109] 1. Recent six months, the last six months, the past six months: April 2024 - September 2024

[0110] Non-business related

[0111] R6: Daily derivation rules

[0112] 1. Today: September 29, 2024 - September 29, 2024

[0113] R7: Weekly derivation rules

[0114] 1. Last week, the week before: 2024 W38 - 2024 W38

[0115] R8: Monthly derivation rules

[0116] 1. Last month, last month, last month: August 2024 - August 2024

[0117] R9: Seasonal derivation rules

[0118] 1. Last quarter, previous quarter: 2024Q2-2024Q2

[0119] R10: Year derivation rules

[0120] 1. This year: 2024

[0121] Non-business related combination derivation rules

[0122] R11: Year + Month derivation rule (continuous)

[0123] 1. March-April of this year: March 2024-April 2024

[0124] R12: Year + Month Derivation Rule (Discrete)

[0125] 1. February and April of this year: February 2024, April 2024

[0126] R13: Year + Quarter Derivation Rules (Continuous)

[0127] 1. The third and fourth quarters of this year: Q3 2024, Q4 2024

[0128] R14: Year + Season Derivation Rules (Discrete)

[0129] 1. The third and fourth quarters of this year: Q3 2024, Q4 2024

[0130] (2) Collect a batch of user query templates for each category. For example, for category R1, collect user questions: What is the contract amount of Shiyanlan Valley in the past three days? Convert it into a standard template [R1 type time description], [entity] [index] is what? Subsequently, expand the use case by replacing the specific values ​​of [entity], [R1 type time description], and [index] to generate large-scale training samples.

[0131] (3) Construction of training set and validation set

[0132] During the training phase, in order to ensure the balance between categories so that the model can be fully learned, each category is divided into a training set and a validation set in a ratio of 5:1.

[0133] Model training results: After training, the model was tested on 349 real user questions collected, with 349 correct answers and 0 incorrect answers, an accuracy rate of 100%, and an average response time of 1.349 seconds.

[0134] Based on any of the above embodiments, Figure 4 As shown in the workflow diagram of the indicator intent recognition model, the use of the indicator intent recognition model to extract the indicators involved includes:

[0135] S401: Build a mapping database from business terms to standard indicator descriptions.

[0136] The purpose of building a mapping library from business terms to standard indicators is to solve the problem of uniform identification of the same indicator in different fields or different expressions. For example, "contract amount" and "sales" refer to the same indicator, but the business terms are different. By collecting all common business terms and mapping them to standard indicator descriptions, it is ensured that different business terms can be unified into a standard database query indicator.

[0137] S402: vectorizing the user query and the business term respectively to obtain a vector representation of the user query and a vector representation of the business term.

[0138] The user's query and business terms are converted into mathematical representations that can calculate similarity, so that the model can understand the user's query and compare it with the business terms. Specifically, the user query and business terms can be mapped into vectors to convert natural language into a form that can be understood by the machine.

[0139] S403: Calculate the similarity between the vector representation of the user query and the vector representation of the business term, and determine a plurality of candidate business terms that match the user query.

[0140] Identify relevant indicators in user queries by calculating the similarity between user queries and business terms. Cosine similarity is a commonly used way to measure vector similarity. Values ​​closer to 1 indicate higher similarity, and values ​​closer to 0 indicate no correlation. In this step, the model calculates the similarity between user queries and all business term vectors, and selects the top N terms whose similarity exceeds a certain threshold (e.g. 0.8).

[0141] As a specific implementation, the cosine similarity between the user question and the business term vector may be calculated, and the top 3 results with a threshold greater than 0.8 may be selected as candidate business terms.

[0142] S404: Inputting a plurality of candidate business terms and a mapping database into a large language model, and using the large language model to extract standard indicator descriptions in the user query.

[0143] Based on the mapping between user questions and Top N business terms, combined with the full set of standard indicator descriptions, they are input into the model, allowing the model to ultimately determine the standard indicator description corresponding to the user's query intent.

[0144] As another specific implementation, the indicator intention recognition model may be used to extract the indicators involved in the following manner:

[0145] The user query is input into the AC automaton, and the standard indicators existing in the indicator library are extracted to obtain a preliminary extraction result; wherein the AC automaton is used to extract the indicators existing in the indicator library in the user query, and complete the mapping of non-standard indicators to standard indicators.

[0146] A database including standard indicators is constructed, and corresponding standard indicators are defined for each non-standard indicator. The mapping of non-standard indicators to standard indicators can be based on expert knowledge or obtained through historical data analysis. The AC automaton can be used to quickly match any preset standard indicators that appear in the text. However, due to the limitations of the AC automaton, it may not be able to recognize indicators in the form of abbreviations or spoken expressions. Therefore, the embodiment of the present application inputs the user query into the large model for further processing.

[0147] The user query is input into the big model, and the big model performs abbreviation completion and spoken language reasoning on non-standard indicators to obtain a processed text.

[0148] The processed text is input into the AC automaton again for extraction to form the final standard indicator description.

[0149] The large model performs abbreviation completion and spoken reasoning on user queries, and then extracts them again through the AC automaton. This implementation combines the fast matching capability of the AC automaton with the semantic understanding capability of the deep learning model, making the mapping from non-standard indicators to standard indicators more accurate and comprehensive.

[0150] For example, Figure 5 As shown in the schematic diagram of index extraction, the user query inputs "contracted amount and area", and the user query is input into the AC automaton for extraction, and the extraction result "contracted amount" is obtained. The user query "contracted amount and area" is input into the large model, and after abbreviation completion, the processed data "contracted amount, contracted area" is obtained. The processed data is input into the AC automaton again for extraction, and the extraction result of "contracted amount, contracted area" is obtained. The two extraction results are combined and output to obtain the final extraction result "contracted amount, contracted area".

[0151] For example, Figure 5 As shown in the schematic diagram of index extraction, the user query inputs the colloquial expression "How many sets have been sold recently?" and inputs the query into the AC automaton for extraction. The AC automaton cannot recognize the colloquial expression and no index data is extracted, so the extraction result is empty. The user query is input into the large model for colloquial reasoning to obtain the processed data "Number of signed sets". The processed data is then input into the AC automaton for extraction to obtain the extraction result of "Number of signed sets". The two extraction results are combined and the final extraction result "Number of signed sets" is output.

[0152] The model training process is as follows:

[0153] (1) Template data collection: For each term, a batch of user questions are collected, and the price trend of Lanxi Valley in the past year is converted into the price trend of the template [entity] [time]. The training set is expanded by replacing [entity] [time].

[0154] (2) Construction of training and validation sets: During the training phase, in order to ensure a balance between categories so that the model can be fully learned, the data related to each term is divided into a training set and a validation set in a ratio of 5:1.

[0155] Verification of training results: After training, the test was conducted on 347 real user questions collected, with 340 correct answers and 7 incorrect answers, an accuracy rate of 97.9% and an average response time of 0.479s.

[0156] Based on any of the above embodiments, Figure 6 As shown in the workflow diagram of the entity intent recognition model, the extraction of the entities involved includes:

[0157] S601: According to entity composition rules, an entity is split into a set of multiple elements as search fields.

[0158] S602: Create a new search field based on the entity element and the alias.

[0159] Based on the constituent elements of the entity (such as city, project name, etc.), create additional search fields that include both the full entity name and possible abbreviations or aliases to increase search flexibility and accuracy. Create alias fields for entities to identify and match different names or abbreviations that users may use.

[0160] S603: Search based on the search field and the new search field, and if a match is found, take the corresponding entity as an extraction result.

[0161] S604: If no entity is found in the search, a large language model is used to extract entities in the user query, and the extracted entities are vectorized to obtain extracted entity vectors.

[0162] S605: Calculate the cosine similarity between the extracted entity vector and the vectors of all possible entities in the database, and select the most similar entity as the final matching result.

[0163] The process involves extracting the [region, city, company, project, phase] entities involved in the user's question and aligning them with the values ​​in the database.

[0164] Enhanced search is divided into two parts: 1. According to the entity composition rules, an entity is split into a set of multiple elements, and a new search field is created for entity elements and aliases. Search for the element set that matches the user's question. If only one meets the conditions, the corresponding entity is used as the extraction result. 2. Construct an entity alias field and search for the alias that matches the user's question. If a match is found, the corresponding entity is used as the extraction result.

[0165] Construct the abbreviation descriptions of the region, city, company, project, and installment fields according to the business rules, and create new fields Region 2, City 2, Company 2, Project 2, and Installment 2 to save

[0166] Use user questions to search the [Region, City, Company, Project, Phase] fields and the [Region 2, City 2, Company 2, Project 2, Phase 2] fields. If the corresponding values ​​are matched, they are output. If no content is found, a fuzzy search is performed, that is, a large model extraction combined with a vector search is used.

[0167] The following is a further detailed description of the method of using large model extraction combined with vector search: Use the large model to extract the entities in the user's question and vectorize them. Calculate the cosine similarity between the extracted entity vector and all the enumeration value vectors of region, city, company, project, and installment, and select the top 1 for output.

[0168] For example: Lanxigu's contract performance trend over the past year

[0169] Output: {"Entity Name": ["Zhangzhou Lanxi Valley [20221010]"]}

[0170] Model inference process:

[0171] Model input: Lanxigu's contract performance trends over the past year

[0172] Model output: {'Entity Name': ['Lanxi Valley']}

[0173] Vector search: {'entity name': ['Lanxi Valley']}->{'entity name': ['Zhangzhou Lanxi Valley [20221010]]}

[0174] Model training process:

[0175] (1) Collect data templates and expand training data

[0176] According to the entity category (region, city, company, project, phase), the corresponding user questions are collected, with 200 examples in each category, for example: the contract performance trend of Lanxi Valley in the past year, and the user questions are converted into the standard template [entity] contract performance trend in the past year. Subsequently, training data is constructed by replacing [entity]. In addition to using standard entity descriptions for replacement, the abbreviation of the entity can also be used for replacement, such as removing the city prefix and plot suffix in the entity component.

[0177] (2) Construction of training set and validation set

[0178] During the training phase, in order to ensure the balance between categories so that the model can be fully learned, each category is divided into a training set and a validation set at a ratio of 5:1.

[0179] Model training results: After training, the model was tested on 349 real user questions collected, with 347 correct answers and 2 incorrect answers, an accuracy rate of 99.40% and an average response time of 0.398s.

[0180] Based on any of the above embodiments, extracting the attributes involved by using the attribute intent recognition model includes:

[0181] For Boolean attributes, it is determined whether the user query includes a preset keyword to determine the attribute value.

[0182] For enumerated attributes, verify whether the specific value mentioned in the user query is in the predefined enumerated value list.

[0183] For inference attributes, the inference results are obtained through inference using the pre-trained attribute intent recognition model, and the inference results are aligned with the relevant data in the database.

[0184] This process extracts the attributes involved in the user's question and aligns them with the values ​​in the database. There are three types of attributes: 1. The value is bool type, such as 'Our company is in charge' (project attribute), the value is 'yes' or 'no'. 2. The value is a finite enumeration type, such as 'Product type', the value is (parking space, residence, apartment.....). 3. The value needs to be inferred, for example, 'Projects that acquired the land last year' need to be inferred {'attribute name': land acquisition time, 'attribute value': 2023}

[0185] For type 1: Use the ac automaton to search for field names and keywords such as yes, no, and non for extraction.

[0186] For type 2: Use the ac automaton to search for field names and field values ​​for positioning.

[0187] For type 3: train the attribute extraction model for recognition, which is similar to the process of time extraction.

[0188] The embodiments of the present application design corresponding training schemes for the time intent recognition model, indicator intent recognition model, entity intent recognition model, and attribute intent recognition model, respectively, fine-tune the large model with smaller parameters, and combine enhanced search methods for intent recognition in various dimensions, thereby solving the problem of inaccurate queries caused by non-standard user inquiries (i.e., fuzzy questions) and significantly improving the system's responsiveness and accuracy in processing complex and fuzzy queries.

[0189] In addition, the present application also provides an enterprise intelligent data implementation device, such as Figure 7 As shown in the structural block diagram of the enterprise intelligent data implementation device provided in the present application, the device specifically includes a memory 71 and a processor 72, and the memory 71 stores a computer program. When the computer program is executed by the processor 72, it implements the enterprise intelligent data implementation method according to any one of the above-mentioned methods.

[0190] In addition, the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the enterprise intelligent data implementation method according to any one of the above-mentioned methods is implemented.

[0191] Computer readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0192] The professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0193] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0194] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A method for implementing enterprise intelligent data query, characterized in that: include: Obtain user inquiries; Concurrently identify the user query, split the elements of the user query into multiple dimensions of entity, indicator, attribute and time, respectively use the time intention recognition model to extract the time involved, use the indicator intention recognition model to extract the indicator involved, use the entity intention recognition model to extract the entity involved, and use the attribute intention recognition model to extract the attribute involved, to obtain the result of intent recognition; The user query and the result of the intent recognition are input into the big language module to generate an SQL query statement.

2. The enterprise intelligent data implementation method according to claim 1, characterized in that: The concurrent intent recognition of the user query includes: The time intention recognition model, the indicator intention recognition model, the entity intention recognition model, and the attribute intention recognition model run concurrently on different microservers as independent components and communicate with each other through a network.

3. The enterprise intelligent data implementation method according to claim 2, characterized in that: The concurrent intent recognition of the user query is performed to obtain the result of the intent recognition, including: When the number of concurrent request tasks exceeds a preset range, the concurrent request tasks are distributed to different micro servers through a load balancer; the load balancer dynamically adjusts the distribution of concurrent request tasks according to the traffic.

4. The enterprise intelligent data implementation method according to claim 2, characterized in that: The concurrent intent recognition of the user query to obtain the result of the intent recognition includes: Using a message queue to obtain response data obtained by the time intent recognition model, the indicator intent recognition model, the entity intent recognition model, and the attribute intent recognition model respectively; After all response data are obtained, the response data are summarized to obtain the result of intent recognition.

5. The enterprise intelligent data implementation method according to any one of claims 1 to 4, characterized in that: The extraction of the involved time by using the time intention recognition model includes: A time intention recognition model is used to determine whether the time granularity of the user's query is clear; if so, the time granularity is output; if not, a confirmation item is output requiring the user to clarify the time granularity; A time intention recognition model is used to extract the time range involved in the user query and convert it into a time description in a standardized format.

6. The enterprise intelligent data implementation method according to any one of claims 1 to 4, characterized in that: The method of extracting the related indicators by using the indicator intention recognition model includes: Build a database mapping business terms to standard indicator descriptions; Vectorizing the user query and the business term respectively to obtain a vector representation of the user query and a vector representation of the business term; Calculating the similarity between the vector representation of the user query and the vector representation of the business term, and determining a plurality of candidate business terms matching the user query; A plurality of candidate business terms and a mapping database are input into a large language model, and the large language model is used to extract standard indicator descriptions in the user query.

7. The enterprise intelligent data implementation method according to any one of claims 1 to 4, characterized in that: The method of extracting the related indicators by using the indicator intention recognition model includes: Input the user query into the AC automaton, extract the standard indicators existing in the indicator library, and obtain a preliminary extraction result; wherein the AC automaton is used to extract the indicators existing in the indicator library in the user query and complete the mapping from non-standard indicators to standard indicators; The user query is input into the big model, and the big model performs abbreviation completion and spoken language reasoning on non-standard indicators to obtain a processed text; The processed text is input into the AC automaton again for extraction to form the final standard indicator description.

8. The enterprise intelligent data implementation method according to any one of claims 1 to 4, characterized in that: The extracting of the involved entities by using the entity intent recognition model includes: According to the entity composition rules, an entity is split into a set of multiple elements as search fields; Create new search fields based on entity elements and aliases; Search based on the search field and the new search field, and if a match is found, take the corresponding entity as the extraction result; If no entity is found, a large language model is used to extract entities in the user query, and the extracted entities are vectorized to obtain extracted entity vectors; Calculate the cosine similarity between the extracted entity vector and the vectors of all possible entities in the database, and select the most similar entity as the final matching result.

9. The enterprise intelligent data implementation method according to any one of claims 1 to 4, characterized in that: The extracting of the involved attributes by using the attribute intention recognition model includes: For Boolean attributes, determine whether the user query includes preset keywords to determine the attribute value; For an enumerated attribute, verify whether the specific value mentioned in the user query is in a predefined enumerated value list; For inference attributes, the inference results are obtained through inference using the pre-trained attribute intent recognition model, and the inference results are aligned with the relevant data in the database.

10. An enterprise intelligent data processing device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for realizing enterprise intelligent data according to any one of claims 1 to 9 is realized.

11. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the enterprise intelligent data implementation method according to any one of claims 1-9 is implemented.

Citation Information

Cited By

  • Intelligent number asking implementation method and device based on analysis model and medium

    CN120723875A

  • Intelligent interrogation method and system based on operating data of SAP system

    CN122633716A