Data query method, device and equipment and readable storage medium

By using the NL2CODE method, the intelligent agent recognizes the user's intent and generates the target database query statement, which solves the problems of low accuracy and poor stability in ChatBI tools, realizes the reliability and consistency of data query, and reduces the development difficulty.

CN122309574APending Publication Date: 2026-06-30CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD
Filing Date
2024-12-30
Publication Date
2026-06-30

Smart Images

  • Figure CN122309574A_ABST
    Figure CN122309574A_ABST
Patent Text Reader

Abstract

This application discloses a data query method, apparatus, device, and readable storage medium. The method includes: inputting a user request into an intelligent agent; determining the target tag category corresponding to the identified user intent; determining the target indicator code corresponding to each target tag in the target tag category based on the relationship between each tag and indicator code in a pre-developed tag category; generating target database query statements corresponding to each target indicator code based on each target indicator code and a pre-developed indicator database; executing each target database query statement; and generating response text based on the obtained query results. The scheme disclosed in this application adopts a natural language-based indicator code generation method. The intelligent agent focuses on parsing natural language to obtain the user intent, and determines the corresponding indicator codes and database query statements based on indicator codes and database query statements pre-developed by professional developers, thereby improving the accuracy of database query statement generation and thus improving the accuracy of data query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information processing technology, specifically to a data query method, apparatus, device, and readable storage medium. Background Technology

[0002] With the rapid development of BI (Business Intelligence) tools and solutions, the former has demonstrated excellent data analysis capabilities. However, faced with the increasing number of reports within enterprises, new problems have also emerged. With the emergence of large-scale models, the combination of large-scale models and BI has given rise to many ChatBI (question-answering business intelligence) products.

[0003] Currently, ChatBI typically uses a technique that directly generates database queries from natural language. This involves generating queries directly from a large language model, then executing the generated queries to obtain the results. However, the accuracy of code generated by large models is relatively low; therefore, this method of data querying results in low accuracy.

[0004] In conclusion, improving the accuracy of data retrieval is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of the above problems, this application provides a data query method, apparatus, device and readable storage medium to improve the accuracy of data query.

[0006] In a first aspect, this application provides a data query method, comprising: acquiring a user request; inputting the user request into an intelligent agent to identify the user intent; determining the target tag category corresponding to the user intent; determining the target indicator code corresponding to each target tag in the target tag category based on the relationship between each tag and indicator code in a pre-developed tag category; generating a target database query statement corresponding to each target indicator code based on each target indicator code and a pre-developed indicator database; the indicator database includes the relationship between indicator codes and database query statements; executing each target database query statement to obtain corresponding query results; and generating a response text based on each query result.

[0007] The technical solution disclosed in this application involves inputting a user request into an intelligent agent to identify the user's intent. Then, it determines the target tag category corresponding to the user's intent and, based on the relationship between each tag and indicator code in a pre-developed tag category, determines the target indicator code corresponding to each target tag in the target tag category. Furthermore, based on the target indicator codes corresponding to each target tag and a pre-developed indicator database (which includes the relationship between indicator codes and database query statements), it generates target database query statements corresponding to each target indicator code. The relationship between each tag and indicator code in the tag category, as well as the indicator database, can be pre-developed by professional developers. After generating each target database query statement, it executes each target database query statement to obtain the corresponding query results and generates a response text based on each query result. Therefore, this application adopts NL2CODE (Natural Language Generation Index Encoding) to enable the intelligent agent to focus on parsing natural language to identify user intent. Based on the index codes and database query statements pre-developed and generated by professional developers, the intelligent agent determines the index codes corresponding to the user intent and the target database query statements. This improves the reliability, accuracy, stability, and consistency of the target database query statements, thereby enhancing the reliability, accuracy, stability, and consistency of data queries and achieving data standardization, making it easier to obtain the expected data query results.

[0008] In some embodiments, generating response text based on each query result includes: obtaining target indicator descriptions corresponding to each target indicator code from an indicator table; the indicator includes the relationship between the indicator code and the indicator description; determining model input data corresponding to each target indicator code using each target indicator code, each target indicator description, and the corresponding query results; inputting the model input data corresponding to each target indicator code into a large language model in the agent to obtain judgment text corresponding to each target indicator code; wherein the large language model is pre-trained using a training set, the training set including multiple training elements, each training element including an indicator code, an indicator description, and a case, the case including the indicator query result and case text; and generating the response text based on the judgment text corresponding to each target indicator code.

[0009] The above process enables the use of a large language model pre-trained on a training set within the intelligent agent to perform data analysis on indicator codes and their corresponding query results. This lowers the technical barrier to data analysis, quickly and efficiently providing users with accurate and clear answers and analysis results, saving time and effort in manual data analysis, enhancing the accuracy of data analysis, and facilitating iteration (the indicator database and work order system developed by professional developers can serve as the corpus training set for the intelligent agent). Furthermore, the development difficulty is low (it requires minimal development cost even without a large amount of labeled data, reducing the technical barrier for users in the report generation process and improving report generation efficiency).

[0010] In some embodiments, the indicator table also includes the relationship between indicator codes and case identifiers;

[0011] Before training the agent using the training set, the method further includes: generating the training set based on the indicator table and the case table; the case table includes case identifiers, indicator query results, and relationships between case texts.

[0012] The above process enables the construction of a training set for training large language models based on indicator tables and case tables, thereby reducing the illusion problem of large models, improving the accuracy of large models, and facilitating iteration and reducing development difficulty.

[0013] In some embodiments, after obtaining the judgment text corresponding to each of the target indicator codes, the method further includes: receiving the manually corrected judgment text, associating the manually corrected judgment text and the corresponding query results with the corresponding target indicator codes, and storing the manually corrected judgment text and the corresponding query results in the case table.

[0014] The above process improves the accuracy of the judgment text. The judgment text after manual correction and the corresponding query results are stored as new cases in the case table to update the case table. This allows for the generation of a new training set based on the updated case table, and the updating of the large language model in the agent based on the new training set. This further improves the accuracy of the large language model in the agent, thereby further improving the accuracy of data analysis.

[0015] In some embodiments, after generating a response text based on each of the query results, the method further includes: saving the response text in a work order system; or, generating an analysis report based on the response text and saving the analysis report in the work order system.

[0016] Saving the response text or the analysis report generated from the response text in the work order system not only facilitates the recording of relevant data for later review, but also allows professional developers to generate new training sets based on the work order system and the indicator coding information developed by the developers. This facilitates updating the large language model in the agent based on the new training set, thereby improving the accuracy of the large language model.

[0017] In some embodiments, the method further includes: if the work order system determines that more than a preset number of users have the same problem with their products, then adding a record corresponding to the problem to the product improvement feedback table in the work order system; the record includes a description of the problem and corresponding improvement suggestions.

[0018] The above methods facilitate the identification of common problems in products and improvement suggestions based on the work order system, thereby improving product performance.

[0019] In some embodiments, the response text includes charts and text.

[0020] By including charts and text in the response text, the data analysis results can be presented intuitively and clearly, making it easier for users to quickly understand and grasp the key information of the data.

[0021] In some embodiments, after obtaining a user request, the method further includes: obtaining user query conditions from the user request, and determining query conditions corresponding to the target tag based on the user query conditions;

[0022] Based on the target indicator codes and the pre-developed indicator database, generate target database query statements corresponding to each target indicator code, including: generating target database query statements corresponding to each target indicator code based on each target indicator code, the query conditions corresponding to the target tags, and the indicator database.

[0023] The above method not only ensures the accuracy of the generated query statements for the target database, but also makes the generation of query statements for the target database more flexible.

[0024] In some embodiments, determining the target tag category corresponding to the user intent includes: determining the target tag category corresponding to the user intent based on the pre-configured relationship between intents and tag categories.

[0025] The above process enables efficient and accurate determination of the target tag category corresponding to the user's intent.

[0026] Secondly, this application provides a data query device, comprising: a first acquisition module, configured to acquire a user request and input the user request into an intelligent agent to identify the user intent; a first determination module, configured to determine the target tag category corresponding to the user intent; a second determination module, configured to determine the target indicator code corresponding to each target tag in the target tag category based on the relationship between each tag and indicator code in a pre-developed tag category; a first generation module, configured to generate a target database query statement corresponding to each target tag based on each target indicator code and a pre-developed indicator database; the indicator database includes the relationship between indicator codes and database query statements; and a second generation module, configured to execute each target database query statement to obtain corresponding query results and generate a response text based on each query result.

[0027] Thirdly, this application provides a data query device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the data query method as described in any of the preceding claims.

[0028] Fourthly, this application provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps of the data query method as described in any of the preceding claims.

[0029] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0030] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiments below. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0031] Figure 1 This is a flowchart of a data query method according to some embodiments of this application;

[0032] Figure 2 These are schematic diagrams illustrating different application scenarios in the field of new energy vehicle data analysis, based on some embodiments of this application.

[0033] Figure 3 This is a schematic diagram of the tag tree corresponding to the tag category "decreased battery life" in some embodiments of this application;

[0034] Figure 4This is a flowchart of a data query method according to some embodiments of this application;

[0035] Figure 5 This is a flowchart of a data query method for some embodiments of this application;

[0036] Figure 6 This is a schematic diagram illustrating the generation of training sets and training of large language models in some embodiments of this application;

[0037] Figure 7 This is a schematic diagram illustrating the query data obtained by executing target database query statements in some embodiments of this application;

[0038] Figure 8 This is a schematic diagram of the structure of a data query device according to some embodiments of this application;

[0039] Figure 9 This is a schematic diagram of the structure of a data query device according to some embodiments of this application. Detailed Implementation

[0040] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

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

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

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

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

[0045] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0046] In the description of the embodiments of this application, the technical terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of this application and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.

[0047] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0048] In the past, traditional BI tools demanded a high level of skill from users, requiring basic abilities in statistics and programming, as well as substantial business knowledge. However, with the continuous development and popularization of AI (Artificial Intelligence) technology, the AI+BI approach has gradually emerged, bringing revolutionary changes to data analysis.

[0049] By employing the AI+BI approach, business users can directly engage in simple, conversational question-and-answer sessions with AI to perform intelligent data analysis, achieving "zero-barrier" access to data analysis. This approach not only reduces the difficulty of data analysis but also improves its efficiency and accuracy. Furthermore, the AI+BI approach can provide individual users with more intelligent services, such as personalized recommendations and intelligent customer service.

[0050] Specifically, the AI+BI technical approach has the following advantages in data analysis:

[0051] (1) Lowering the threshold: Traditional BI tools require users to have high statistical and programming skills, while the AI+BI technology route uses technologies such as natural language processing to allow business personnel to conduct data analysis through simple dialogue and question answering, thus lowering the threshold for use.

[0052] (2) Improved efficiency: The AI+BI technology approach can automatically complete data cleaning, integration, and analysis, greatly improving the efficiency of data analysis. At the same time, AI can also make predictions and provide early warnings based on historical data and business rules, helping business personnel to make better decisions.

[0053] (3) Enhanced accuracy: The AI+BI approach utilizes machine learning algorithms to mine and analyze data, enabling the discovery of hidden patterns and potential problems, thereby improving the accuracy of data analysis. Simultaneously, AI can monitor and update data in real time, ensuring its timeliness and accuracy.

[0054] (4) Expanding application scenarios: The AI+BI technology route is not limited to traditional data analysis scenarios, but can also be applied to multiple fields such as intelligent customer service and personalized recommendations. Through continuous learning and optimization of algorithm models, the AI+BI technology route can continuously expand its application scenarios and value.

[0055] The "large model + BI" approach has spawned numerous ChatBI products. Currently, most ChatBI products on the market use a technique that directly generates database queries from natural language. This means that the query is generated directly from a large language model; the user inputs a query in natural language, the large model automatically parses the input and generates the corresponding database query, and then executes the query to obtain the results. For example, using SQL (Structured Query Language) statements, ChatBI typically uses NL2SQL (Natural Language to SQL) technology, directly generating SQL statements from the large language model. However, this approach, where the large model directly generates code, presents the following problems:

[0056] (1) Consistency problem: As a probabilistic product, large models are difficult to guarantee the consistency of output, which is a drawback for data analysis that requires accurate results.

[0057] (2) Accuracy Limitation: In enterprise-level data analysis, the accuracy of code generated by large models may be less than 80%, which means that there is a high error rate.

[0058] (3) Control issues: The output of large models is difficult to control, which may result in the failure to obtain the expected analysis results in specific business scenarios.

[0059] (4) Limitations of multi-table analysis: Large models may have limitations when dealing with complex SQL queries involving multiple tables, which may affect their application in complex data analysis scenarios.

[0060] (5) Output stability: The same question may yield multiple answers, affecting the stability and reliability of the output.

[0061] (6) Performance issues: The generated code may not be optimized, making it difficult to guarantee execution performance.

[0062] In summary, using natural language to directly generate database query statements can lead to problems such as low data query accuracy and inconsistent data definitions when performing data queries.

[0063] To this end, the applicant proposes a data query method, apparatus, device, and readable storage medium. The method involves inputting a user request into an intelligent agent to identify the user's intent. Then, it determines the target tag category corresponding to the user's intent. Based on the relationship between each tag and indicator code in a pre-developed tag category, it determines the target indicator code corresponding to each target tag in the target tag category. Furthermore, based on the target indicator codes corresponding to each target tag and a pre-developed indicator database (which includes the relationship between indicator codes and database query statements), it generates target database query statements corresponding to each target indicator code. The relationship between each tag and indicator code in the tag category, as well as the indicator database, can be pre-developed by professional developers. After generating the target database query statements, the statements are executed to obtain the corresponding query results. Therefore, this application adopts the NL2CODE approach, in which the intelligent agent focuses on parsing natural language to identify user intent, and determines the indicator code corresponding to the user intent and the target database query statement based on the indicator code and database query statement pre-developed and generated by professional developers, so as to improve the reliability, accuracy, stability and consistency of the target database query statement generation, thereby improving the reliability, accuracy, stability and consistency of data query, and realizing the unification of data standards, which facilitates obtaining the expected data query results.

[0064] See Figure 1 This is a flowchart of a data query method according to some embodiments of this application, which may include the following steps:

[0065] S11: Obtain the user request and input the user request into the intelligent agent to identify the user's intent.

[0066] It should be noted that the execution entity of the data query method provided in this application embodiment can be a server, or it can be a computer device or other device capable of running backend programs. Furthermore, the data query method provided in this application embodiment can be applied to the field of new energy vehicle data analysis, such as... Figure 2 The diagram illustrates different application scenarios in the field of new energy vehicle data analysis, based on some embodiments of this application. Of course, the data query method provided in this application can also be applied to other scenarios, such as e-commerce and vehicle networking. When applied to the corresponding field, training data from that field can be used to train the intelligent agent, enabling it to be better suited for that field.

[0067] When a user needs to query data, they can input their request through methods such as keyboard input, touch input, or voice input. Correspondingly, the server can obtain the user request and input it into an intelligent agent to identify the user's intent corresponding to the request.

[0068] That is, the intelligent agent in this embodiment has the function of outputting user intent according to user requests, which can be implemented through machine learning methods. Specifically, the intelligent agent may include a label classifier that can identify user intent according to user requests. This label classifier can be trained using open-source, general methods to reduce the training cost and threshold of the intelligent agent, or it can be customized for specific application domains. Alternatively, a large language model within the intelligent agent can be used for user intent recognition.

[0069] For example, when a user requests "Why can't my car go far?" or "Why is my car's range getting shorter?" or "Recently, I feel that the driving range of my electric car has decreased significantly, what is the reason?" or "The vehicle's range is decreasing very quickly, is this normal?" or "I feel that the car's range is not as good as before, what's going on?", the intelligent agent can recognize the user's intent as "Analysis of the reasons for the decrease in range".

[0070] S12: Determine the target tag category corresponding to the user's intent.

[0071] After obtaining user intent through intelligent agent recognition, a parsing engine can be used to parse the user intent and determine the target tag category corresponding to the user intent.

[0072] For example, the relationship between user intent and tag categories can be pre-configured by professional developers in the relevant domain (i.e., the domain in which the data query method is applied). When the server uses the intelligent agent to identify the user intent corresponding to the user request, it can determine the target tag category corresponding to the user intent based on the pre-configured relationship between intent and tag categories. Alternatively, the server can obtain historical data and determine whether there is an intent in the historical data that is the same as the currently identified user intent. If so, it can obtain the tag category corresponding to the corresponding intent from the historical data and determine that tag category as the target tag category corresponding to the currently identified user intent.

[0073] The tag category contains multiple tags, which are arranged according to a certain logic and hierarchy. Specifically, the tag category contains the hierarchical relationship between tags. The tag category can represent each tag as a tag tree, or as a list or set. That is, a tag category contains at least one tag (correspondingly, a target tag category contains at least one target tag), and each tag includes at least one sub-tag.

[0074] For example, when representing the tag category "decreased battery life" in a tag tree format, please refer to [link / reference]. Figure 3 This diagram illustrates a tag tree corresponding to the tag category "Decreased Range" in some embodiments of this application. When representing each tag as a set, it can specifically be: {(SOH Battery Health), (Charging Habits, High-Temperature Charging), (Charging Habits, Deep Discharge), (Charging Habits, High SOC Rest), (Charging Habits, xx Charging Behavior), (Driving Habits, Rapid Acceleration), (Driving Habits, Emergency Braking), (Historical Range)...}. Among these, "Charging Habits - High-Temperature Charging" and "Charging Habits - Deep Discharge" are two tags included in the tag category "Decreased Range".

[0075] S13: Based on the relationship between each tag and indicator code in the pre-developed tag category, determine the target indicator code corresponding to each target tag in the target tag category.

[0076] It should be noted that professional developers within the domain in which the data query method is applied can pre-develop indicator codes based on the business domain and scope. These indicator codes are in string format. In other words, the indicator coding work is delegated to professional developers for generation. For example, Table 1 shows the indicator coding method:

[0077] Table 1. Index Coding Methods

[0078]

[0079] The indicator code can include three parts: indicator domain, indicator tag, and indicator category. These three parts can be ordered sequentially, with the indicator domain at the top, the indicator tag at the bottom, and the indicator category at the top. The indicator domain and indicator tag can be determined based on the tags contained in the tag category, while the lowest level indicator category can be defined and developed by professional developers.

[0080] Furthermore, professional developers can pre-define the relationship between indicator codes and each tag in the tag category (i.e., each tag in the tag category is associated with the indicator code). For example, the indicator code corresponding to "SOH Battery Health" can be

Battery_BatteryHealth_SohTrend

Battery_BatteryCharge_HighTempChargeCnt

[0081] After determining the target tag category corresponding to the user's intent, the server can determine the target indicator code corresponding to each target tag in the target tag category based on the relationship between each tag and indicator code in the tag category pre-developed by professional developers.

[0082] S14: Based on the target indicator codes and the pre-developed indicator database, generate the target database query statements corresponding to each target indicator code; the indicator database includes the relationship between the indicator codes and the database query statements.

[0083] Among them, professional developers in the field of data query method application can also pre-develop an indicator database. This indicator database contains the relationship between indicator codes and database query statements, that is, the database query statements corresponding to indicator codes can be pre-generated by professional developers.

[0084] After determining the target indicator code corresponding to each target tag in the target tag category, the server can determine the target database query statement corresponding to each indicator code based on the indicator database pre-developed by professional developers and the target indicator code corresponding to each target tag in the target tag category.

[0085] It should be noted that the database query statements mentioned in this application embodiment can specifically be SQL statements, that is, the indicator database pre-developed by professional developers contains the relationship between indicator codes and SQL statements. Based on this, the server can determine the target SQL statement corresponding to each indicator code according to the indicator database pre-developed by professional developers and the target indicator codes corresponding to each target tag in the target tag category.

[0086] The above process enables the use of NL2CODE to parse natural language into indicator codes, upgrading the original path of directly generating database query statements from natural language to NL2CODE. By directly calling the indicator database developed by professional developers based on business needs through indicator codes, the target database query statement corresponding to the indicator code is determined, thereby improving the accuracy, reliability, stability and consistency of the target database query statement generation. This enhances the accuracy and stability of data query while ensuring controllable results and reducing development difficulty.

[0087] S15: Execute the query statements for each target database, obtain the corresponding query results, and generate response text based on each query result.

[0088] After determining the target database query statements corresponding to each indicator code, these queries can be executed separately. Specifically, they can be executed based on the data warehouse and / or data lake within the domain in which the data query method is applied, to obtain the query results corresponding to each target database query statement (or the query results corresponding to each target indicator code). Then, a response text to the user's request can be generated based on the query results corresponding to each target database query statement. This response text can be displayed on a human-computer interaction interface and / or sent to the user (e.g., to the user's smart device), allowing the user to receive the response text and the requested result. The generated response text may include information such as data descriptions and solutions.

[0089] As can be seen from the above process, compared with the current method of directly generating database query statements using large models, this application provides an intelligent agent based on NL2CODE. This agent delegates the work related to indicator definition, indicator development, indicator encoding, and the generation of corresponding database query statements to professional developers. These developers pre-define and develop indicators, generating indicator codes and database query statements. During the data query process, the intelligent agent focuses on parsing natural language and recognizing user intent. Then, based on the pre-developed results by the professional developers, it generates the target database query statement. This avoids directly generating the target database query statement through the intelligent agent, thereby improving the reliability, accuracy, stability, and consistency of the target database query statement generation. This, in turn, improves the reliability and accuracy of data queries and ensures the uniformity of data query criteria.

[0090] The technical solution disclosed in this application involves inputting a user request into an intelligent agent to identify the user's intent. Then, it determines the target tag category corresponding to the user's intent and, based on the relationship between each tag and indicator code in a pre-developed tag category, determines the target indicator code corresponding to each target tag in the target tag category. Furthermore, based on the target indicator codes corresponding to each target tag and a pre-developed indicator database (which includes the relationship between indicator codes and database query statements), it generates target database query statements corresponding to each target indicator code. The relationship between each tag and indicator code in the tag category, as well as the indicator database, can all be pre-developed by professional developers. After generating each target database query statement, it executes each target database query statement to obtain the corresponding query results and generates a response text based on each query result. Therefore, this application embodiment adopts the NL2CODE method, in which the intelligent agent focuses on parsing natural language to identify user intent, and determines the indicator code corresponding to the user intent and the target database query statement based on the indicator code and database query statement pre-developed and generated by professional developers, so as to improve the reliability, accuracy, stability and consistency of the target database query statement generation, thereby improving the reliability, accuracy, stability and consistency of data query, and realizing the unification of data standards, so as to facilitate obtaining the expected data query results.

[0091] See Figure 4 and Figure 5 ,in, Figure 4 This is a flowchart of a data query method according to some embodiments of this application. Figure 5 This is a flowchart illustrating a data query method according to some embodiments of this application. According to some embodiments of this application, wherein... Figure 4 and Figure 5 The examples used here are all SQL database queries. The response text generated based on the query results may include:

[0092] Obtain the target indicator description corresponding to each target indicator code from the indicator table; the indicator table may include the relationship between the indicator code and the indicator description.

[0093] By using the codes and descriptions of each target indicator and the corresponding query results, the model input data corresponding to each target indicator code is determined.

[0094] The model input data corresponding to each target indicator code is input into the large language model in the agent to obtain the judgment text corresponding to each target indicator code. The large language model is pre-trained using a training set, which may include multiple training elements. Each training element may include indicator code, indicator description and case. The case may include indicator query results and case text.

[0095] The response text is generated based on the judgment text corresponding to each target indicator code.

[0096] In this embodiment, professional developers can pre-develop an indicator table, which may include the relationship between indicator codes and indicator descriptions. The indicator table stores information such as indicator codes and descriptions developed by the professional developers. The indicator description, i.e., the meaning of the indicator, can be input into the agent as contextual information to provide auxiliary information, thereby enabling the agent to generate more accurate and coherent output results. Furthermore, to reduce the complexity of development for professional developers, the relationship between indicator codes and database query statements, as well as the indicator table itself, can be stored in an indicator database. Alternatively, the relationship between each tag in a tag category and its indicator code, the relationship between the indicator code and the database query statement, and the indicator table can all be stored in the indicator database.

[0097] In this embodiment, the agent can also output judgment text (in text format) based on the indicator code, the corresponding indicator description, and the indicator query result. That is, the agent can have two functions (providing two interfaces): one is to output the user intent based on the input user request (implemented using machine learning methods, a label classifier, which can be trained using open-source general methods); the other is to output judgment text based on the indicator code, indicator description, and indicator query result (i.e., the indicator query result obtained after executing the database query statement corresponding to the indicator code) (implemented using LLM (Large Language Model)). Of course, the agent can also possess the above two functions through a large language model within the agent.

[0098] For large language models in intelligent agents, pre-training using a training set is possible. Specifically, multiple indicator codes and corresponding indicator descriptions (in text format) can be obtained first. For each indicator code, all associated cases can be obtained (if none exist, they are not included in the training corpus). The cases can include indicator query results (in JSON format) and case text (in text format). Then, a training set is constructed based on the aforementioned information, specifically, it can be generated based on feature engineering. Subsequently, the constructed training set is used to train the large language model to obtain a large language model better suited to the corresponding domain, reducing the illusion problem of large language models (the illusion problem is the generation of inaccurate, incomplete, or misleading outputs when faced with certain inputs), enhancing the agent's understanding of business, and thus improving user service satisfaction.

[0099] This training set can contain multiple training elements, each including an indicator code, an indicator description, and a case. Each case includes the indicator query result and case text. For example, the case text may include a problem description, diagnostic process, solution content, suggested measures, and follow-up plan. Cases corresponding to indicator codes can be generated from external systems such as inspections or work orders, or can be generated manually or by machine. See details in [link to relevant documentation]. Figure 6 This is a schematic diagram illustrating the generation of training sets and training of large language models in some embodiments of this application, wherein... Figure 6 Taking the acquisition of cases through work order feedback as an example, a training set is generated by using indicator codes and descriptions in indicator development and corresponding cases (including indicator query results and case text) in work order feedback, and the training set is used to train a large language model.

[0100] It should be noted that, in order to improve training accuracy, one case can correspond to one indicator code. When one case corresponds to multiple indicator codes, the case can be split into multiple cases corresponding to different indicator codes. For example, if a case includes battery health and battery degradation rate, the case can be split into two cases, which correspond to the indicator codes for battery health and battery degradation rate, respectively.

[0101] For example, the constructed training set can be:

[0102] {Indicator_code,Indicator_desc,case:{id1,result1,text1}}

[0103] {Indicator_code,Indicator_desc,case:{id2,result2,text2}},…

[0104] In this context, Indicator_code represents the indicator code, Indicator_desc represents the indicator description, case represents the case, id represents the case identifier, result represents the indicator query result, and text represents the judgment text.

[0105] Based on the above, the process by which the server generates response text according to each query result can be specifically as follows: The server retrieves the target indicator description corresponding to each target indicator code from an indicator database developed by professional developers. Then, using each target indicator code, its corresponding target indicator description, and the corresponding query result, the server determines the model input data corresponding to each target indicator code. Each target indicator code's model input data includes the target indicator code, its corresponding target indicator description, and the corresponding query result. That is, the agent parses the user's intent, and the server generates model input data {code, desc, result}, where code represents the target indicator code, desc represents the target indicator description, and result represents the query result. Finally, the model input data corresponding to each target indicator code is input into a large language model pre-trained using a training set to obtain the judgment text corresponding to each target indicator code. Specifically, the input data for a target indicator code can be first input into the large language model of the agent to obtain the judgment text corresponding to that target indicator code. Then, the input data for the next target indicator code can be input into the large language model of the agent, and so on, until the input data for the last target indicator code is input into the large language model of the agent to obtain the judgment text corresponding to the last target indicator code. After obtaining the judgment text corresponding to each target indicator code, the response text for the user request is generated based on the judgment text corresponding to each target indicator code.

[0106] The above process enables the use of a large language model pre-trained on a training set within the intelligent agent to perform data analysis on indicator codes and their corresponding query results. This lowers the technical barrier to data analysis, quickly and efficiently providing users with accurate and clear answers and analysis results, saving time and effort in manual data analysis, enhancing the accuracy of data analysis, and facilitating iteration (the indicator database and work order system developed by professional developers can serve as the corpus training set for the intelligent agent). Furthermore, the development difficulty is low (it requires minimal development cost even without a large amount of labeled data, reducing the technical barrier for users in the report generation process and improving report generation efficiency).

[0107] According to some embodiments of this application, the indicator table may also include the relationship between indicator codes and case identifiers;

[0108] Before training the agent using the training set, it may also include:

[0109] A training set is generated based on the indicator database and the case table; the case table may include case identifiers, indicator query results, and relationships between case texts.

[0110] In this embodiment, the indicator table may further include the relationship between indicator codes and case identifiers (which may be in array format). The case identifier may specifically be a case ID or case name, or other unique identifier information that identifies a case. That is, the indicator table not only stores indicator codes and descriptions developed by professional developers, but also associates them with cases for use as training corpus. Specifically, see Table 2, which is the indicator table:

[0111] Table 2 Indicator Table

[0112]

[0113] It should be noted that Table 2 only shows fields related to training, and different indicator tables can be created for indicators with different labels in different fields. For example, the indicator database can contain indicator tables, which can include the correspondence between indicator codes, indicator descriptions, and case identifiers, as well as the correspondence between indicator codes and database query statements.

[0114] Additionally, a case table can be included. This table can contain case identifiers, indicator query results, and relationships between case texts. The case identifiers here have the same format as those in the indicator table, such as "case id," to facilitate querying the case table based on the case identifiers in the indicator table to retrieve the corresponding indicator execution results and case texts. See Table 3 for details, which is the case table:

[0115] Table 3 Case Study

[0116]

[0117] Based on the above, before training the agent using the training set, a training set can be generated according to the indicator table and the case table. Specifically, each indicator code, its corresponding indicator description, and case identifier (if none are available, they are not included in the training corpus) can be obtained from the indicator table. The corresponding indicator query results and case text can then be obtained from the case table based on the case identifier corresponding to each indicator code. Each indicator code, its corresponding indicator description, its corresponding indicator query results, and its case text are then used as training elements to generate the training set.

[0118] The above process enables the construction of a training set for training large language models based on indicator tables and case tables, thereby reducing the illusion problem of large models, improving the accuracy of large models, and facilitating iteration and reducing development difficulty.

[0119] Taking the application of this application embodiment to the field of new energy vehicle data analysis as an example, the above process can realize the construction of a new energy knowledge base based on the indicator table and case table in the corresponding field, which is used to train a large language model suitable for the field of new energy vehicles (which can be called a new energy large language model) or to train a new energy question answering agent, so as to reduce the illusion problem of the large language model.

[0120] According to some embodiments of this application, after generating the response text based on each query result, it may further include:

[0121] Receive the judgment text after manual correction, associate the judgment text and the corresponding query results with the corresponding target indicator codes, and save the judgment text and the corresponding query results in the case table.

[0122] In this embodiment of the application, after the server inputs the model input data corresponding to each target indicator code into the large language model in the intelligent agent to obtain the judgment text corresponding to each target indicator code, it can send the judgment text corresponding to each target indicator code to relevant personnel such as professional developers. The relevant personnel can then correct one or more judgment texts and send them back to the server to improve the accuracy of the judgment text.

[0123] Accordingly, the server can receive the manually corrected judgment text and associate the manually corrected judgment text and the corresponding query results (i.e., the query results corresponding to the target indicator code of the manually corrected judgment text) with the corresponding target indicator code. Specifically, a case identifier can be generated for the manually corrected judgment text, the case identifier can be stored under the corresponding target indicator code in the indicator table, and the case identifier, the manually corrected judgment text, and the corresponding query results can be stored as a new case in the case table.

[0124] The above process improves the accuracy of the judgment text. The judgment text after manual correction and the corresponding query results are stored as new cases in the case table to update the case table. This allows for the generation of a new training set based on the updated case table, and the updating of the large language model in the agent based on the new training set. This further improves the accuracy of the large language model in the agent, thereby further improving the accuracy of data analysis.

[0125] According to some embodiments of this application, after generating the response text based on each query result, it may further include:

[0126] Save the reply text in the work order system;

[0127] Alternatively, an analysis report can be generated based on the response text and saved in the work order system.

[0128] In this embodiment of the application, after the server generates a response text based on each query result, it can save the response text in the work order system.

[0129] Alternatively, an analysis report can be generated based on the reply text. For example, an analysis report generation template can be obtained, and the reply text can be used to generate the analysis report. The analysis report can then be saved in the work order system. At this point, the analysis report can be sent to the user.

[0130] Saving the response text or the analysis report generated from the response text in the work order system not only facilitates the recording of relevant data for later review, but also allows professional developers to generate new training sets based on the work order system and the indicator coding information developed by the developers. This facilitates updating the large language model in the agent based on the new training set, thereby improving the accuracy of the large language model.

[0131] According to some embodiments of this application, it may also include:

[0132] If the work order system determines that more than a preset number of users have the same problem with their products, then add a record corresponding to the problem to the product improvement feedback form in the work order system; the record may include a description of the problem and corresponding improvement suggestions.

[0133] In this embodiment, the response text or analysis report may contain the problems existing in the user's product. After saving the response text or analysis report in the work order system, the server can also analyze the work order system. If the work order system determines that more than a preset number of user products (e.g., new energy vehicles) have the same problem (the preset number can be set by relevant personnel according to needs or experience), a record corresponding to the problem can be added to the product improvement feedback table in the work order system. This record may contain a description of the problem and improvement suggestions for the problem (e.g., possible improvement directions). It should be noted that if the response text or analysis report contains improvement suggestions for the problem, the improvement suggestions in the record can come from the response text or analysis report. If the response text or analysis report does not contain improvement suggestions for the problem, the user or other personnel can send improvement suggestions to the server after obtaining the problem, and the server will record them in the product improvement feedback table.

[0134] The above methods facilitate the identification of common problems in products and improvement suggestions based on the work order system, thereby improving product performance.

[0135] According to some embodiments of this application, the response text may include charts and text.

[0136] In this embodiment, the response text generated by the server based on the judgment text encoded by each target indicator may include charts and text to intuitively and clearly display the data analysis results, thereby facilitating users to quickly understand and grasp the key information of the data. The text may include data explanations and solutions.

[0137] Based on the above, the reply text can be saved as a template, and scheduled reports can be set to generate analysis reports on a regular basis, which can then be sent to users and saved in the work order system.

[0138] According to some embodiments of this application, after obtaining the user request, the process may further include:

[0139] Obtain the user's query conditions from the user's request, and determine the query conditions corresponding to the relevant item tags based on the user's query conditions;

[0140] Based on the target indicator codes and the pre-developed indicator database, generate target database query statements corresponding to each target indicator code, which may include:

[0141] Based on the target indicator codes, the corresponding query conditions for the target labels, and the indicator database, generate the target database query statements corresponding to each target indicator code.

[0142] In this embodiment, after obtaining the user request, it can be determined whether the user request contains user query conditions (such as time window size, time displacement size, etc.). If the user request contains user query conditions, it can be determined which query conditions corresponding to target tags are included in the user query conditions. These user query conditions may include query conditions corresponding to one or more target tags in the target tag category, such as the query condition "time statistics window size is 1 month, difference calculation, comparison with last month" corresponding to "charging habits - high temperature charging". Then, the query conditions corresponding to the respective target tags can be obtained from the user query conditions.

[0143] The system can retrieve the corresponding query conditions for each item tag from the user's query criteria, following the order of time window size, time offset (the amount shifted backward from the current time), operator, and granularity. See Table 4 for a detailed example of the query conditions.

[0144] Table 4. Query Conditions Illustration

[0145]

[0146] It should be noted that if a query for a target tag lacks one of the four elements mentioned above, that element can be omitted, but it must serve as a placeholder to ensure consistent sorting. Additionally, if one or more target tags lack corresponding query conditions in the user's search, the query conditions can be set to empty. Alternatively, the initial query conditions can be retrieved (pre-configured and stored on the server by professional developers) and used as the query conditions for the corresponding target tag. Alternatively, the user can be prompted to enter the query conditions for the corresponding target tag.

[0147] Based on the above, target database query statements corresponding to each target indicator code can be generated according to the target indicator code, the query conditions corresponding to the corresponding target label, and the pre-developed indicator database. Specifically, the database query statements corresponding to each target indicator code can be obtained from the indicator database, and then concatenated with the query conditions corresponding to the corresponding target label (i.e., the target indicator code) to generate the target database query statements corresponding to each target indicator code; or, the target indicator code can be concatenated with the query conditions corresponding to the corresponding target label (i.e., the target indicator code) to obtain the indicator code-query condition concatenation result corresponding to each target indicator code, and the database query statements corresponding to each target indicator code can be obtained from the indicator database. The target database query statements corresponding to each target indicator code and the corresponding indicator code-query condition concatenation result can then be used to generate the target database query statements corresponding to each target indicator code.

[0148] The above method not only ensures the accuracy of the generated query statements for the target database, but also makes the generation of query statements for the target database more flexible.

[0149] According to some embodiments of this application, determining the target tag category corresponding to the user intent may include:

[0150] Based on the pre-configured relationship between intents and tag categories, determine the target tag category corresponding to the user intent.

[0151] In this embodiment, professional developers can also pre-configure the relationship between intents and tag categories. Accordingly, when determining the target tag category corresponding to a user intent, the server can specifically determine the target tag category corresponding to the identified user intent based on the pre-configured relationship between intents and tag categories, thereby achieving efficient and accurate determination of the target tag category corresponding to the user intent.

[0152] To more clearly illustrate the technical solution of this application, a specific case is provided below, which illustrates the application of the technical solution of this application to the field of new energy vehicle data analysis:

[0153] 1. Example of a car owner's question (uniform type: range anxiety):

[0154] Why can't my car go far?

[0155] Why is my car's range getting shorter?

[0156] - I've noticed a significant decrease in the range of my electric vehicle lately. What could be the reason?

[0157] Is it normal for a vehicle's driving range to decrease so quickly?

[0158] -I feel like the car's range isn't as good as it used to be, what's going on?

[0159] 2. Identify the problem and change it to a tag; split the tag tree:

[0160] The user intent is interpreted as "Analysis of the reasons for the decrease in battery life". In other words, when the user request is any of the above, the user intent recognized by the agent is "Analysis of the reasons for the decrease in battery life".

[0161] The target tag category for the intent "Analysis of Reasons for Decreased Battery Life" is determined to be "Decreased Battery Life". This tag category is specifically as follows: Figure 3 As shown.

[0162] 3. Match indicator codes in the indicator database using tags:

[0163] [1] Battery health status

[0164] a1. Search for the categories Battery and BatteryHealth;

[0165] b1. Matching the original indicator codes in the indicator database:

[0166]

Battery_BatteryHealth_SohTrend

[0167] c1. Assemble semantic indicator codes (that is, assemble the original indicator codes with the corresponding query conditions in the user's query conditions) [Battery_BatteryHealth_SohTrend$1Y___W], where 1Y represents data with a query time window of 1 year, and W represents a granularity of 10,000 kilometers. Elements can be omitted but need to be placed.

[0168] d1. Based on the results of step c1 and the indicator database, generate the corresponding target database query statement, execute the target database query statement, obtain the queried data, and display it. For details, please refer to [link to relevant documentation]. Figure 7 This is a schematic diagram of the query data obtained by executing the target database query statement in some embodiments of this application, wherein the horizontal axis is the driving mileage in 10,000 kilometers, and the vertical axis is the battery pack SOH in %.

[0169] e1. Input the results from step c1, the results from step d1, and the corresponding indicator descriptions into the large language model in the agent to generate the judgment text:

[0170] {Your vehicle's health value is declining rapidly, with a degradation rate of {-2.75% / 10,000 km}. The following analysis will examine the factors contributing to battery aging based on battery usage habits, environmental factors, and malfunctions.}

[0171] [2] Battery usage habits

[0172] a2. Search for the categories Battery and BatteryCharge;

[0173] b2. Matching the original indicator codes in the indicator database:

[0174]

Battery_BatteryCharge_HighTempChargeCnt

[0175] c2. Assemble semantic indicator codes (that is, assemble the original indicator codes with the corresponding query conditions in the user's query conditions):

[0176]

Battery_BatteryCharge_HighTempChargeCnt$1M_DELTA_B1M

[0177] d2. Based on the results of step c2 and the indicator database, generate the corresponding target database query statement, execute the target database query statement, obtain the query data, and display it.

[0178] e2. Input the results from step c2 and step d2, along with the corresponding indicator descriptions, into the large language model within the agent to generate the judgment text:

[0179] Last month, the number of high-temperature charging incidents was 2, and this month, the number of high-temperature fast charging incidents was 5. The high number of high-temperature fast charging incidents refers to charging at an initial temperature above 40 degrees Celsius and a charging rate above 0.5C. Excessive charging temperature accelerates internal chemical reactions in the battery, leading to electrolyte evaporation and localized high temperatures within the battery, thus affecting battery performance and lifespan. This manifests in the following ways:

[0180] ① Shortened lifespan

[0181] Excessive charging temperature will accelerate battery aging and shorten battery life. According to tests, when the battery charging temperature increases by 1°C, the battery life will be shortened by about 10%.

[0182] ② Performance reduction

[0183] Excessive charging temperature can also reduce battery performance. When the internal temperature of the battery exceeds a certain range, the battery's output voltage and current will decrease, affecting the battery's reliability and stability.

[0184] ③ Security risks

[0185] Excessive charging temperature can cause violent chemical reactions inside the battery, potentially leading to problems such as battery swelling and short circuits, which in turn pose a threat to personal safety.

[0186] Secondly, we continued to retrieve other indicators: ...

[0187] 4. Provide a summary:

[0188] "Hello, based on recent data analysis of your vehicle, the decrease in range may be related to the following factors: low winter temperatures reduce battery activity; frequent rapid acceleration and high-speed driving recently increased energy consumption; battery aging, with its health level decreasing by 5% compared to the last inspection. We suggest you optimize your driving habits and consider scheduling a battery health check at the nearest service station."

[0189] 5. Record this issue and create a database (this database can be located in the work order system). Records:

[0190] Record Content: Problem Type (Decreased Range), Question Time, Owner Information (Anonymized), Problem Description, Diagnostic Process, Solution Content, Suggested Measures, Follow-up Plan, etc. Specific content includes: Problem type: "Decreased Range," Question time: "[Date]," Owner information: Anonymized, Problem description: "The owner reports a reduction in vehicle range," Diagnostic process: "Analysis of vehicle historical data, battery health status, driving behavior patterns, and external environmental factors," Solution content: "Explanation of possible causes of decreased range, and suggestions for optimizing driving habits and conducting a battery health check," Suggested measures: "The owner is advised to optimize driving habits and schedule a battery health check at a service station," Follow-up plan: "Customer service will follow up with the owner one week later to understand the problem resolution status."

[0191] Database Update: Store this record in the "Problem Resolution Record" table of the customer service database, and simultaneously update the relevant data in the "Vehicle Health Record" table, such as a decrease in battery health score. Furthermore, if a common problem is found, add a record to the "Product Improvement Feedback" table for the R&D team's reference. Specific steps include: adding a new record to the "Problem Resolution Record" table containing all the above information; updating the battery health score of this vehicle from 95% to 90% in the "Vehicle Health Record" table; and if analysis reveals that this problem also exists in other vehicles, adding a record to the "Product Improvement Feedback" table, describing the problem and proposing possible improvement directions.

[0192] 6. Data analysts manually correct and score the records, using them as reserve data for the next training session.

[0193] This application also provides a data query device, see [link to relevant documentation] Figure 8 This is a schematic diagram of the structure of a data query device according to some embodiments of this application. The data query device 80 may include a first acquisition module 81, a first determination module 82, a second determination module 83, a first generation module 84, and a second generation module 85. Specifically, the first acquisition module 81 is used to acquire a user request and input the user request into an intelligent agent to identify the user's intent; the first determination module 82 is used to determine the target tag category corresponding to the user's intent; the second determination module 83 is used to determine the target indicator code corresponding to each target tag in the target tag category based on the relationship between each tag and indicator code in the pre-developed tag category; the first generation module 84 is used to generate target database query statements corresponding to each target tag based on each target indicator code and a pre-developed indicator database; the indicator database may include the relationship between indicator codes and database query statements; and the second generation module 85 is used to execute each target database query statement to obtain the corresponding query results and generate response text based on each query result.

[0194] According to some embodiments of this application, the second generation module 85 may include: an acquisition unit, configured to acquire target indicator descriptions corresponding to each target indicator code from an indicator table; the indicator table may include the relationship between indicator codes and indicator descriptions; a first determination unit, configured to determine the model input data corresponding to each target indicator code using each target indicator code, each target indicator description, and the corresponding query results; an input unit, configured to input the model input data corresponding to each target indicator code into the large language model in the agent to obtain the judgment text corresponding to each target indicator code; wherein, the large language model is pre-trained using a training set, the training set may include multiple training elements, each training element may include indicator codes, indicator descriptions, and cases, and the cases may include indicator query results and case text; and a first generation unit, configured to generate response text based on the judgment text corresponding to each target indicator code.

[0195] According to some embodiments of this application, the indicator table may also include the relationship between indicator codes and case identifiers; the second generation module 85 may also include: a second generation unit, used to generate a training set based on the indicator database and the case table before training the agent using the training set; the case table may include the relationship between case identifiers, indicator query results and case texts.

[0196] According to some embodiments of this application, the second generation module 85 may further include: a receiving unit, configured to receive the manually corrected judgment text after obtaining the judgment text corresponding to each target indicator code, associate the manually corrected judgment text and the corresponding query results with the corresponding target indicator code, and save the manually corrected judgment text and the corresponding query results in a case table.

[0197] According to some embodiments of this application, the data query device 80 may further include: a storage module, used to store the response text in the work order system after generating the response text based on each query result; or, to generate an analysis report based on the response text and store the analysis report in the work order system.

[0198] According to some embodiments of this application, the data query device 80 may further include: an adding module, used to add a record corresponding to the problem to the product improvement feedback table in the work order system if it is determined in the work order system that more than a preset number of users' products have the same problem; the record may include a description of the problem and corresponding improvement suggestions.

[0199] According to some embodiments of this application, the response text may include charts and text.

[0200] According to some embodiments of this application, the data query device 80 may further include: a second acquisition module, used to acquire user query conditions from the user request after acquiring the user request, and determine the query conditions corresponding to the corresponding item tag according to the user query conditions;

[0201] The first generation module 84 may include: a third generation unit, used to generate target database query statements corresponding to each target indicator code based on each target indicator code, the query conditions corresponding to the corresponding target label, and the indicator database.

[0202] According to some embodiments of this application, the first determining module 82 may include: a second determining unit, used to determine the target tag category corresponding to the user intent based on the pre-configured relationship between intent and tag category.

[0203] This application also provides a data query device, see [link to relevant documentation] Figure 9 This is a schematic diagram of the structure of a data query device according to some embodiments of this application. The data query device 90 may include a memory 91 and a processor 92. The memory 91 is used to store computer programs; the processor 92, when executing the computer program stored in the memory 91, can perform the following steps:

[0204] The system acquires user requests and inputs them into the agent to identify user intent; it determines the target tag category corresponding to the user intent; based on the relationship between each tag and indicator code in the pre-developed tag category, it determines the target indicator code corresponding to each target tag in the target tag category; based on each target indicator code and the pre-developed indicator database, it generates target database query statements corresponding to each target indicator code; the indicator database includes the relationship between indicator codes and database query statements; it executes each target database query statement to obtain the corresponding query results, and generates response text based on each query result.

[0205] This application also provides a readable storage medium storing a computer program, which, when executed by a processor, can perform the following steps:

[0206] The system acquires user requests and inputs them into the agent to identify user intent; it determines the target tag category corresponding to the user intent; based on the relationship between each tag and indicator code in the pre-developed tag category, it determines the target indicator code corresponding to each target tag in the target tag category; based on each target indicator code and the pre-developed indicator database, it generates target database query statements corresponding to each target indicator code; the indicator database includes the relationship between indicator codes and database query statements; it executes each target database query statement to obtain the corresponding query results, and generates response text based on each query result.

[0207] For a description of the relevant parts of the data query device, equipment and readable storage medium provided in this application, please refer to the detailed description of the corresponding parts of the data query method provided in this application, and will not be repeated here.

[0208] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no structural conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A data query method, characterized in that, include: Obtain a user request and input the user request into the intelligent agent to identify the user's intent; Determine the target tag category corresponding to the user intent; Based on the relationship between each tag and indicator code in the pre-developed tag category, determine the target indicator code corresponding to each target tag in the target tag category; Based on the target indicator codes and the pre-developed indicator database, a target database query statement corresponding to each target indicator code is generated; the indicator database includes the relationship between the indicator codes and the database query statements. Execute the target database query statements to obtain the corresponding query results, and generate response text based on the query results.

2. The data query method according to claim 1, characterized in that, The step of generating response text based on each query result includes: Obtain the target indicator description corresponding to each target indicator code from the indicator table; the indicator includes the relationship between the indicator code and the indicator description. Using the target indicator codes, target indicator descriptions, and corresponding query results, determine the model input data corresponding to each target indicator code; The model input data corresponding to each of the target indicator codes are respectively input into the large language model in the agent to obtain the judgment text corresponding to each of the target indicator codes; wherein, the large language model is pre-trained using a training set, the training set includes multiple training elements, each of the training elements includes an indicator code, an indicator description and a case, and the case includes the indicator query result and the case text; The response text is generated based on the judgment text corresponding to each of the target indicator codes.

3. The data query method according to claim 2, characterized in that, The indicator table also includes the relationship between indicator codes and case identifiers; Before training the agent using the training set, the following steps are also included: The training set is generated based on the indicator table and the case table; the case table includes case identifiers, indicator query results, and the relationships between case texts.

4. The data query method according to claim 3, characterized in that, After obtaining the judgment text corresponding to each of the target indicator codes, the method further includes: Receive the manually corrected judgment text, associate the manually corrected judgment text and the corresponding query results with the corresponding target indicator codes, and save the manually corrected judgment text and the corresponding query results in the case table.

5. The data query method according to claim 1, characterized in that, After generating the response text based on the query results, the process also includes: Save the reply text in the work order system; Alternatively, an analysis report can be generated based on the response text, and the analysis report can be saved in the work order system.

6. The data query method according to claim 5, characterized in that, Also includes: If the work order system determines that more than a preset number of users have the same problem with their products, a record corresponding to the problem is added to the product improvement feedback table in the work order system; the record includes a description of the problem and corresponding improvement suggestions.

7. The data query method according to claim 1, characterized in that, The response text includes charts and text.

8. The data query method according to any one of claims 1 to 7, characterized in that, After obtaining the user request, it also includes: Obtain user query conditions from the user request, and determine the query conditions corresponding to the target tag based on the user query conditions; Based on the target indicator codes and the pre-developed indicator database, generate target database query statements corresponding to each target indicator code, including: Based on the target indicator codes, the query conditions corresponding to the target labels, and the indicator database, generate target database query statements corresponding to each target indicator code.

9. The data query method according to claim 8, characterized in that, Determining the target tag category corresponding to the user intent includes: Based on the pre-configured relationship between intent and tag category, the target tag category corresponding to the user intent is determined.

10. A data query device, characterized in that, include: The first acquisition module is used to acquire user requests and input the user requests into the intelligent agent to identify user intentions; The first determining module is used to determine the target tag category corresponding to the user intent; The second determining module is used to determine the target indicator code corresponding to each target tag in the target tag category based on the relationship between each tag and indicator code in the pre-developed tag category; The first generation module is used to generate target database query statements corresponding to each target label based on the target indicator codes and a pre-developed indicator database; the indicator database includes the relationship between indicator codes and database query statements; The second generation module is used to execute the query statements of each target database, obtain the corresponding query results, and generate response text based on each query result.

11. A data query device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data query method as described in any one of claims 1 to 9 when executing the computer program.

12. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data query method as described in any one of claims 1 to 9.