A method and system for question-answering and visualization of mine production data based on large models

Through a big model-based method, combining vector database and ElasticSearch, an intention comparison table and production data index table are established, which solves the problem of strict question format and single results in the mine production data question and answer, and realizes flexible processing and diversification of mine data. Display, improving system response quality and user satisfaction.

CN118733716BActive Publication Date: 2024-11-01ZIJIN ZHIXIN (XIAMEN) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411232832.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-11-01
Estimated Expiration
2044-09-04

AI Technical Summary

Technical Problem

In the existing technology, there are problems such as strict question format requirements, insufficient understanding of mining product data, and a single result format in mining production data, which cannot support broad question-and-answer modes and diversified visual scenarios.

Method used

Using a large model-based method, we establish an intention comparison table and a preset production data index table, combine vector database and ElasticSearch to generate script code through vector matching and keyword matching, support more natural language input, and provide multiple display methods. Such as tables, charts and documents.

Benefits of technology

It realizes flexible processing and diversified display of mine production data, improves system response quality and user satisfaction, enables large models to process industry-specific data and indicators, and supports a wider and flexible Q&A model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733716B_ABST
    Figure CN118733716B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for mine production data question-answering and visualization based on a big model, including establishing an intention comparison table containing mapping relationships between fuzzy questions and preset question processing methods; establishing an actual production data table containing field names, field descriptions and value ranges corresponding to preset production data indicators, binding the production data table and the intention comparison table, matching the questions actually input by the user in a vector database and ElasticSearch to obtain mapping relationships, and inputting them into the big model together with the actual production data table and the mapping relationship, so that the big model can accept more natural language input, and does not require users to follow a strict question format, which helps the big model to better understand and process production data, and can more deeply understand and process data and indicators of specific industries; the vector database and ElasticSearch can accurately match the user's questions and answers; provide a variety of display methods, and generate corresponding script codes to meet various visualization needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of large models, and in particular to a large-model-based mine production data question-answering and visualization method and system. Background Art

[0002] With the development of artificial intelligence technology, especially the progress of natural language processing (NLP) and machine learning, it has become possible to convert natural language into structured queries. This technology has a wide range of application scenarios, from simplifying database query operations to improving the efficiency of data analysis, and has important practical value. Through this technology, users can ask questions in natural language, and the system automatically converts these questions into SQL query statements, which are then executed on relational databases to obtain the required data, realizing the conversion from natural language questions to SQL queries on relational databases.

[0003] The workflow of the prior art is as follows:

[0004] (1) User input

[0005] The user asks a question or request in natural language, for example: "What was the total copper production of ABC Company in May?".

[0006] (2) Text parsing

[0007] The input text is first parsed to identify keywords, phrases, intents, and entities, and Natural Language Processing (NLP) techniques such as word segmentation, part-of-speech tagging, and named entity recognition (NER) are used to extract and understand important information in the query.

[0008] (3) Intent Recognition

[0009] The system identifies the intent of the query, including selection (SELECT), counting (COUNT), update (UPDATE), etc., and determines the mapping relationship with the entities in the database (such as tables and column names).

[0010] (4) SQL generation

[0011] The SQL query generated using the above techniques is built based on the user's original text input, including JOIN operations (if different tables need to be associated), WHERE clauses (for filtering results), GROUP BY statements (for aggregation operations), etc.

[0012] (5) Execute SQL query

[0013] The generated SQL query is executed on the database, and the execution result is the data returned by the database, usually in a table form.

[0014] (6) Results display

[0015] The returned results are presented in a format that the user can understand, which involves converting the table into a natural language summary or displaying it in a graphical interface.

[0016] The existing technology currently has the following problems:

[0017] (1) Strict question format requirements. The current process of generating SQL based on natural language requires that the natural language has strict format requirements, including query conditions, time ranges, etc., and cannot support a broad question-and-answer model.

[0018] (2) The large model itself does not have sufficient understanding of the types of mine products and data indicators, and is unable to generate results that meet actual needs.

[0019] (3) The current generated result format is relatively simple and only supports data table format, which cannot meet the needs of diverse visualization scenarios. Summary of the invention

[0020] In order to solve the technical problems mentioned in the above background technology, the present invention proposes a large-model-based mine production data question-answering and visualization method and system to solve the above technical problems.

[0021] According to one aspect of the present invention, a method for question-answering and visualization of mine production data based on a large model is proposed, comprising:

[0022] S1. Establish an intention comparison table. The intention comparison table pre-stores preset fuzzy questions and preset problem processing methods input by the user. The preset fuzzy questions and the preset problem processing methods form a mapping relationship. The preset fuzzy questions include question statements that do not clearly point out the preset production data indicators. The preset problem processing methods include production data query steps, production data processing steps, and text descriptions of production data display methods used to solve the preset fuzzy problems. Among them, the production data query step includes a text description of querying the preset production data indicators in the preset production data table, and the production data processing step includes further summarizing the text description of the preset production data indicators contained in the production data query step. The display methods include text, tables, charts, and files; store the intention comparison table in ElasticSearch, and vectorize and store it in the vector database at the same time;

[0023] S2. Establish an actual production data table containing field names, field descriptions and value ranges corresponding to preset production data indicators;

[0024] S3, based on the actual user input question, a first mapping relationship set is obtained by vector matching in the vector database, and based on each mapping relationship in the first mapping relationship set, a corresponding second mapping relationship is obtained by keyword matching in ElasticSearch, and each mapping relationship in the first mapping relationship set is concatenated with the corresponding second mapping relationship to form a prompt word;

[0025] S4. Use the field names corresponding to the actual production data table and the preset production data indicators to replace the preset production data table and the preset production data indicators included in the prompt words respectively;

[0026] S5, inputting the user's actual input question, the actual production data table and the prompt words into the big model, and generating script code using the big model;

[0027] S6. Execute the script code and send the display method generated after the script code is executed to the front-end rendering.

[0028] Through the above technical solution, an intent comparison table containing fuzzy questions and preset question processing methods is established; an actual production data table containing field names, field descriptions and value ranges corresponding to preset production data indicators is established, and the production data table and the intent comparison table are bound. At the same time, the questions actually input by the user are matched in the intent comparison table to obtain mapping relationships, and the questions actually input by the user are input into the big model together with the mapping relationship and value range. The intent comparison table enables the big model to accept more natural language input, and does not require users to follow a strict question format. The binding of the production comparison table and the intent comparison table helps the big model to better understand and process production data, so that the model is no longer limited to general fields, but can more deeply understand and process data and indicators of specific industries; combined with vector databases and ElasticSearch, user questions and corresponding answers can be matched more accurately, improving the system's response quality and user satisfaction, so that the big model can answer a wider range of questions and have better freedom; it also provides a variety of display methods and generates corresponding script codes to meet more diverse visualization needs.

[0029] In some specific embodiments, the preset production data indicators include enterprise name, region, business year, month and day, element, output, ore output, ore metal output, ore output grade, ore input, selected metal output, selected grade and concentrate output.

[0030] In some specific embodiments, step S1 includes receiving a storage time set by a user, storing the intent comparison table in ElasticSearch according to the storage time, and storing it in a vector database in a vectorized manner. This facilitates the subsequent question-and-answer process to provide the relevant comparison description content as part of the prompt word to the big model through RAG search enhancement methods such as vector matching and keyword matching, so that the big model can process the process and results according to the needs of the actual scenario.

[0031] In some specific embodiments, the summary in step S1 includes summation, average value, maximum value and minimum value.

[0032] In some specific embodiments, step S3 includes:

[0033] S31, obtaining the question actually input by the user;

[0034] S32, using the actual user input question to perform vector matching in the vector database to obtain a first mapping relationship set, and obtaining a preset problem processing method for each mapping relationship in the first mapping relationship set;

[0035] S33, extracting the preset production data indicators included in the preset problem processing method of each mapping relationship in the first mapping relationship set as keywords, and using the keywords to perform keyword matching in ElasticSearch to obtain a second mapping relationship;

[0036] S34: concatenate the first mapping relationship and the second mapping relationship into a prompt word.

[0037] In some specific embodiments, step S34 includes comparing the content of the first mapping relationship with the content of the second mapping relationship; if the content of the first mapping relationship is the same as the content of the second mapping relationship, the first mapping relationship is retained as the prompt word; if the content of the first mapping relationship is different from the content of the second mapping relationship, the first mapping relationship and the second mapping relationship are spliced ​​into the prompt word. Combining the vector database and ElasticSearch can more accurately match the user's questions with the corresponding answers, improve the system's response quality and user satisfaction, and enable the large model to answer a wider range of questions and have better freedom.

[0038] In some specific embodiments, step S5 includes inputting the script code processing instructions together with the user's actual input questions, the actual production data table and the prompt words into the large model, and the script code processing instructions include the generation form of the script code and the generation requirements of the script code.

[0039] In some specific embodiments, step S6 includes:

[0040] S61, in response to determining that the script code execution completes the production data processing step, and the display mode corresponding to the script code is a table, determine whether the data volume after the production data processing step exceeds a preset threshold, if it exceeds, set the display mode corresponding to the script code to a file; if it does not exceed, keep the display mode corresponding to the script code as a table; if the display mode corresponding to the script code is an icon, generate the JS code of the ECharts chart;

[0041] S62, render the corresponding form through the front end. If it is text or table in Markdown format, render it directly. If it is the JS code of ECharts chart, call ECharts component for rendering; if it is a file, return the download link for the user to click. Through S61, the display method can be dynamically adjusted according to the amount of processed data. When the amount of data exceeds a certain threshold, choose to display it in file form, which helps to avoid performance problems caused by loading too much data on the front end, such as page freeze or response delay. Provide more diverse data display methods through S62 to meet diverse visualization scenarios.

[0042] According to a second aspect of the present invention, a large model-based mine production data question-answering and visualization system is proposed, the system comprising:

[0043] A construction module is configured to establish an intent comparison table, the intent comparison table pre-stores preset fuzzy questions and preset problem processing methods input by the user, the preset fuzzy questions and the preset problem processing methods form a mapping relationship, the preset fuzzy questions include question statements that do not clearly point out the preset production data indicators, and the preset problem processing methods include production data query steps, production data processing steps, and text descriptions of production data display methods used to solve the preset fuzzy problems; wherein the production data query step includes a text description of querying the preset production data indicators in the preset production data table, the production data processing step includes further summarizing the text descriptions of the preset production data indicators included in the production data query step, and the display methods include text, tables, charts, and files; the intent comparison table is stored in ElasticSearch, and vectorized and stored in a vector database at the same time; and an actual production data table containing field names, field descriptions, and value ranges corresponding to the preset production data indicators is established;

[0044] A matching module is configured to obtain a first mapping relationship set by performing vector matching in a vector database based on the question actually input by the user, obtain a corresponding second mapping relationship by performing keyword matching in ElasticSearch based on each mapping relationship in the first mapping relationship set, and concatenate each mapping relationship in the first mapping relationship set with the corresponding second mapping relationship to form a prompt word;

[0045] A binding module is configured to replace the preset production data table and the preset production data indicator included in the prompt word with the field names corresponding to the actual production data table and the preset production data indicator respectively;

[0046] A generation module is configured to input the user's actual input question, the actual production data table and the prompt words into the big model, and generate script code using the big model;

[0047] The execution module is configured to execute the script code and send the display method generated after the script code is executed to the front-end rendering.

[0048] According to a third aspect of the present invention, a computer-readable storage medium is provided, on which one or more computer programs are stored. When the one or more computer programs are executed by a computer processor, any of the above methods is implemented.

[0049] The present invention proposes a method and system for question-answering and visualization of mine production data based on a large model, and the technical effects thereof are:

[0050] Through the above technical solution, an intention comparison table containing fuzzy questions and preset question processing methods is established; an actual production data table containing field names, field descriptions and value ranges corresponding to preset production data indicators is established, and the production data table and the intention comparison table are bound. At the same time, the questions actually input by the user are matched in the vector database and ElasticSearch to obtain mapping relationships, and the questions actually input by the user are input into the big model together with the mapping relationship and value range. The intention comparison table enables the big model to accept more natural language input, and does not require users to follow a strict question format. The binding of the production comparison table and the intention comparison table helps the big model to better understand and process production data, so that the model is no longer limited to general fields, but can more deeply understand and process data and indicators of specific industries; combined with the vector database and ElasticSearch, it can more accurately match user questions with corresponding answers, improve the system's response quality and user satisfaction, and enable the big model to answer a wider range of questions and have better freedom; it also provides a variety of display methods and generates corresponding script codes to meet more diverse visualization needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and together with the description are used to explain the principles of the present invention. Other embodiments and many expected advantages of the embodiments will be readily appreciated as they become better understood by reference to the following detailed description. Other features, objects and advantages of the present application will become more apparent by reading the detailed description of the non-limiting embodiments made with reference to the following drawings:

[0052] Figure 1 It is a flowchart of a method for question-answering and visualization of mine production data based on a large model in one embodiment of the present application;

[0053] Figure 2 It is a flowchart of an embodiment of the present application according to which a user input question is matched with an intention comparison table;

[0054] Figure 3 It is a schematic diagram of prompt words used to input a large model in an embodiment of the present application;

[0055] Figure 4 This is a schematic diagram of the script code generated by the large model of the embodiment of the present application;

[0056] Figure 5 It is a diagram schematic diagram generated after executing the script code in the embodiment of the present application;

[0057] Figure 6 It is a structural schematic diagram of a mine production data question-answering and visualization system based on a large model in one embodiment of the present application;

[0058] Figure 7 It is a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION

[0059] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0060] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0061] According to a large model-based mine production data question-answering and visualization method according to an embodiment of the present application, Figure 1 FIG. 1 is a flowchart of a method for question-answering and visualization of mine production data based on a large model according to an embodiment of the present application. Figure 1 As shown, the method includes:

[0062] S1. Establish an intent comparison table. The intent comparison table pre-stores preset fuzzy questions and preset problem processing methods input by the user. The preset fuzzy questions and the preset problem processing methods form a mapping relationship. The preset fuzzy questions include question statements that do not clearly point out the preset production data indicators. The preset problem processing methods include production data query steps, production data processing steps and production data display method text descriptions used to solve the preset fuzzy problems. Among them, the production data query step includes a text description of querying the preset production data indicators in the preset production data table, and the production data processing step includes further summarizing the text description of the preset production data indicators contained in the production data query step. The display methods include text, tables, charts and files; the intent comparison table is stored in ElasticSearch, and vectorized and stored in the vector database at the same time.

[0063] Specifically, the preset production data indicators include enterprise name, region, business year, month and day, element, output, ore output, ore metal output, ore output grade, ore selection quantity, selected metal quantity, selected grade and concentrate quantity.

[0064] Specifically, step S1 includes receiving the storage time set by the user, storing the intent comparison table in ElasticSearch according to the storage time, and storing it in the vector database in a vectorized manner. In the subsequent question-and-answer process, through RAG search enhancement methods such as vector matching and keyword matching, the relevant comparison description content is provided to the big model as part of the prompt word, so that the big model can process the process and results according to the needs of the actual scenario.

[0065] As an example, the intent comparison table is shown in Table 1:

[0066] Table 1

[0067] Preset fuzzy questions Preset problem handling method Production in February If this type of question does not specify which indicators are being queried, the sum of the output indicators of various elements of all production units can be displayed in a bar chart Copper production this month This type of question does not specify the production unit. You can obtain the data indicators of the current unit of the questioner based on the unit of the questioner.

[0068] S2. Establish an actual production data table containing the field names, field descriptions and value ranges corresponding to the preset production data indicators.

[0069] As an example, the production data table dwd_mining_data is represented as follows: company_name: company name, including xx Co., Ltd., area: region, enums (domestic|foreign), biz_year: business year, such as '2023', biz_month: business month, such as '2023-02', biz_date: business date, such as '2023-02-01', element_name: element, such as 'gold', select_metal_ pro: output, unit: kilogram, ore_removal_amt: ore output, unit: kilogram, metal_removal_amt: ore metal output, unit: kilogram, removal_grade: ore grade, such as: 0.5, selected_ore_amt: selected ore output, unit: kilogram, select_metal_amt: selected metal output, unit: kilogram, selected_grade: selected grade, such as: 0.5, conc_amt: concentrate output, unit: kilogram.

[0070] S3. Based on the actual user input question, a first mapping relationship set is obtained by vector matching in the vector database. Based on each mapping relationship in the first mapping relationship set, a corresponding second mapping relationship is obtained by keyword matching in ElasticSearch. Each mapping relationship in the first mapping relationship set is concatenated with the corresponding second mapping relationship to form a prompt word.

[0071] Specifically, step S3 includes:

[0072] S31, obtaining the question actually input by the user;

[0073] S32, using the actual user input question to perform vector matching in the vector database to obtain a first mapping relationship set, and obtaining a preset problem processing method for each mapping relationship in the first mapping relationship set;

[0074] S33, extracting the preset production data indicators included in the preset problem processing method of each mapping relationship in the first mapping relationship set as keywords, and using the keywords to perform keyword matching in ElasticSearch to obtain a second mapping relationship;

[0075] S34, concatenate the first mapping relationship and the second mapping relationship into a prompt word. Figure 2 shown.

[0076] Specifically, step S34 includes comparing the content of the first mapping relationship with the content of the second mapping relationship; if the content of the first mapping relationship is the same as the content of the second mapping relationship, the first mapping relationship is retained as the prompt word; if the content of the first mapping relationship is different from the content of the second mapping relationship, the first mapping relationship and the second mapping relationship are spliced ​​into the prompt word. Combining the vector database and ElasticSearch can more accurately match the user's questions with the corresponding answers, improve the system's response quality and user satisfaction, and enable the large model to answer a wider range of questions and have better freedom.

[0077] As a first example, the implementation examples of steps S31-S34 are as follows:

[0078] S31. Obtain the user's actual input question "Changes in copper production of yy Julong Copper in 2023";

[0079] S32, using the actual user input question to match the vector in the vector database to obtain a first mapping relationship set, and obtaining a preset problem processing method "production trend analysis - calculate the total monthly production, and present it in a line graph" for each mapping relationship in the first mapping relationship set;

[0080] S33, extracting the preset production data indicator "output" included in the preset problem processing method of each mapping relationship in the first mapping relationship set as a keyword, and using the keyword matching of "output" in ElasticSearch to obtain the second mapping relationship "output - output calculation method takes the sum of output in the preset production data table within the statistical period";

[0081] S34. Compare the contents of the first mapping relationship and the second mapping relationship. If the contents of the first mapping relationship and the second mapping relationship are different, the first mapping relationship and the second mapping relationship are concatenated into a prompt word, namely, "1) Production trend analysis - calculate the total monthly production and present it in a line graph 2) Production - the production calculation method is the total production in the preset production data table within the statistical period".

[0082] As a second example, the implementation examples of steps S31-S34 are as follows:

[0083] S31. Obtain the actual input question from the user: "yy Julong Copper's copper production in 2023";

[0084] S32, using the actual user input question to obtain a first mapping relationship set by vector matching in the vector database, and obtaining a preset problem processing method for each mapping relationship in the first mapping relationship set, such as "output - output calculation method is the sum of the output in the preset production data table within the statistical period";

[0085] S33, extracting the preset production data indicator "output" included in the preset problem processing method of each mapping relationship in the first mapping relationship set as a keyword, and using the keyword to match the keyword in ElasticSearch to obtain the second mapping relationship, such as "output - the output calculation method takes the sum of the output in the preset production data table within the statistical period";

[0086] S34. Compare the contents of the first mapping relationship and the second mapping relationship. If the contents of the first mapping relationship and the second mapping relationship are the same, retain the first mapping relationship as the prompt word, that is, "1) Output - the output calculation method is the sum of the output in the preset production data table within the statistical period."

[0087] S4. Use the field names corresponding to the actual production data table and the preset production data indicators to replace the preset production data table and the preset production data indicators included in the prompt words respectively;

[0088] As an example, the implementation example of step S4 is as follows:

[0089] The prompt word is "Output - the output calculation method is the sum of the output in the preset production data table during the statistical period"; the preset production data table "Preset production data table" string and the preset production data indicator "Output" included in the prompt word are replaced with the field names corresponding to the actual production data table and the preset production data indicators, which is expressed as "Output - the output calculation method is the sum of select_metal_pro in dwd_mining_data during the statistical period".

[0090] S5. Input the user's actual input questions, actual production data table and prompt words into the big model, and use the big model to generate script code.

[0091] Specifically, step S5 includes inputting the script code processing instructions together with the user's actual input questions, the actual production data table and the prompt words into the large model, and the script code processing instructions include the generation form of the script code and the generation requirements of the script code.

[0092] As an example, the user's actual input question, the value range in the actual production data table, the script code processing instructions and the prompt words are input into the large model. Figure 3 As shown in the figure, it contains fuzzy questions input by users. The fuzzy questions include the question sentence "Production situation in February" which does not clearly indicate the query condition field of production data, the actual production data table "Table structure description is: {{Structure description}}", and the prompt word "For problem analysis ideas, please refer to the following description: Question: {{ Figure 1}}Solution: {{Idea 1}}Problem: {{ Figure 2Solution: {{Idea 2}}" and script code processing instructions "Please remember: 1. You only need to return Python code, do not include any markdown symbols or descriptions, and ensure that all returned content can be directly executed in the Python executor; 2. The program must meet the requirements of background automatic execution, and do not pop up a graphical interface", use the large model to generate executable script code such as Figure 4 shown.

[0093] S6. Execute the script code and send the display method generated after the script code is executed to the front-end rendering.

[0094] Specifically, step S6 includes:

[0095] S61, in response to determining that the script code execution completes the production data processing step, and the display mode corresponding to the script code is a table, determine whether the data volume after the production data processing step exceeds a preset threshold, if it exceeds, set the display mode corresponding to the script code to a file; if it does not exceed, keep the display mode corresponding to the script code as a table; if the display mode corresponding to the script code is an icon, generate the JS code of the ECharts chart;

[0096] S62, render the corresponding form through the front end. If it is text or table in Markdown format, render it directly. If it is the JS code of ECharts chart, call ECharts component for rendering; if it is a file, return the download link for the user to click. Through S61, the display method can be dynamically adjusted according to the amount of processed data. When the amount of data exceeds a certain threshold, choose to display it in file form, which helps to avoid performance problems caused by loading too much data on the front end, such as page freeze or response delay. Provide more diverse data display methods through S62 to meet diverse visualization scenarios.

[0097] As an example, executing Figure 4 The executable script code in Figure 5 The copper production trend chart of xxxxxxxxxx Co., Ltd. from January to June 2023 is shown.

[0098] Through the above technical solution, an intention comparison table containing fuzzy questions and preset question processing methods is established; an actual production data table containing field names, field descriptions and value ranges corresponding to preset production data indicators is established, and the production data table and the intention comparison table are bound. At the same time, the questions actually input by the user are matched in the vector database and ElasticSearch to obtain mapping relationships, and the questions actually input by the user are input into the big model together with the mapping relationship and value range. The intention comparison table enables the big model to accept more natural language input, and does not require users to follow a strict question format. The binding of the production comparison table and the intention comparison table helps the big model to better understand and process production data, so that the model is no longer limited to general fields, but can more deeply understand and process data and indicators of specific industries; combined with the vector database and ElasticSearch, it can more accurately match user questions with corresponding answers, improve the system's response quality and user satisfaction, and enable the big model to answer a wider range of questions and have better freedom; it also provides a variety of display methods and generates corresponding script codes to meet more diverse visualization needs.

[0099] Reference below Figure 6 , Figure 6 is a schematic diagram of a large model-based mine production data question-answering and visualization system according to an embodiment of the present application, such as Figure 6 As shown, the system includes:

[0100] The construction module 601 is configured to establish an intention comparison table, which pre-stores preset fuzzy questions and preset problem processing methods input by the user, and the preset fuzzy questions and the preset problem processing methods form a mapping relationship. The preset fuzzy questions include question statements that do not clearly point out the preset production data indicators. The preset problem processing methods include production data query steps, production data processing steps, and text descriptions of production data display methods used to solve the preset fuzzy problems; wherein the production data query step includes a text description of querying the preset production data indicators in the preset production data table, and the production data processing step includes further summarizing the text descriptions of the preset production data indicators included in the production data query step, and the display methods include text, tables, charts, and files; the intention comparison table is stored in ElasticSearch, and vectorized and stored in a vector database at the same time; and an actual production data table containing field names, field descriptions, and value ranges corresponding to the preset production data indicators is established;

[0101] Matching module 602 is configured to obtain a first mapping relationship set by vector matching in a vector database based on the question actually input by the user, obtain a corresponding second mapping relationship by keyword matching in ElasticSearch based on each mapping relationship in the first mapping relationship set, and concatenate each mapping relationship in the first mapping relationship set with the corresponding second mapping relationship to form a prompt word;

[0102] The binding module 603 is configured to replace the preset production data table and the preset production data indicator included in the prompt word with the field names corresponding to the actual production data table and the preset production data indicator respectively;

[0103] The generating module 604 is configured to input the user's actual input question, the actual production data table and the prompt words into the big model, and generate the script code using the big model;

[0104] The execution module 605 is configured to execute the script code and send the display method generated after the script code is executed to the front-end rendering.

[0105] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 suitable for implementing an electronic device of an embodiment of the present application. Figure 7 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0106] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0107] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0108] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable storage medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus, or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus, or a device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wireline, optical cable, RF, etc., or any suitable combination of the foregoing.

[0109] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0110] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0111] The modules involved in the embodiments of the present application may be implemented by software or by hardware.

[0112] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or it may exist independently and not be assembled into the electronic device. The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by the electronic device, the electronic device: S1, establishes an intention comparison table, the intention comparison table pre-stores the preset fuzzy problems and preset problem processing methods input by the user, and the preset fuzzy problems and the preset problem processing methods constitute a mapping relationship. The preset fuzzy problems include problem statements that do not clearly point out the preset production data indicators. The preset problem processing methods include production data query steps, production data processing steps, and production data display methods used to solve the preset fuzzy problems. The text description; wherein the production data query step includes a text description of querying the preset production data indicators in the preset production data table, and the production data processing step includes further summarizing the text description of the preset production data indicators contained in the production data query step, and the display method includes text, tables, charts, and files; the intention comparison table is stored in ElasticSearch, and vectorize and store them in the vector database at the same time; establish an actual production data table containing the field names, field descriptions and value ranges corresponding to the preset production data indicators; obtain a first mapping relationship set based on the user's actual input question in the vector database by vector matching, and obtain the corresponding second mapping relationship based on each mapping relationship in the first mapping relationship set by keyword matching in ElasticSearch, and splice each mapping relationship in the first mapping relationship set with the corresponding second mapping relationship to form a prompt word; use the actual production data table and the field names corresponding to the preset production data indicators to replace the preset production data table and the preset production data indicators included in the prompt word respectively; input the user's actual input question, the actual production data table and the prompt word into the big model together, and use the big model to generate script code; execute the script code, and send the display method generated after the script code is executed to the front-end rendering.

[0113] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A method for question-answering and visualization of mine production data based on a large model, characterized in that: include: S1. Establish an intention comparison table, which pre-stores preset fuzzy questions and preset problem processing methods input by the user, and the preset fuzzy questions and the preset problem processing methods form a mapping relationship. The preset fuzzy questions include question statements that do not clearly point out the preset production data indicators, and the preset problem processing methods include production data query steps, production data processing steps, and text descriptions of production data display methods used to solve the preset fuzzy problems; wherein the production data query step includes a text description of querying the preset production data indicators in a preset production data table, and the production data processing step includes further summarizing the text descriptions of the preset production data indicators contained in the production data query step, and the display methods include text, tables, charts, and files; store the intention comparison table in ElasticSearch, and vectorize and store it in a vector database at the same time; S2. Establishing an actual production data table including field names, field descriptions and value ranges corresponding to the preset production data indicators; S3, obtaining the actual user input question; using the actual user input question to obtain a first mapping relationship set by vector matching in the vector database, and obtaining a preset problem processing method for each mapping relationship in the first mapping relationship set; extracting the preset production data indicator included in the preset problem processing method for each mapping relationship in the first mapping relationship set as a keyword, and using the keyword to obtain a second mapping relationship by keyword matching in the ElasticSearch; splicing the first mapping relationship and the second mapping relationship into a prompt word; S4, using the field names corresponding to the actual production data table and the preset production data indicators to replace the preset production data table and the preset production data indicators included in the prompt word respectively; S5, inputting the actual user input question, the actual production data table and the prompt word into the big model, and generating script code using the big model; S6. Execute the script code. In response to determining that the script code has completed the production data processing step and the display method corresponding to the script code is a table, determine whether the data volume after the production data processing step exceeds a preset threshold. If it exceeds, set the display method corresponding to the script code to a file; if it does not exceed, keep the display method corresponding to the script code as a table; if the display method corresponding to the script code is an icon, generate the JS code of the ECharts chart; perform corresponding rendering through the front end. If it is Markdown text or a table, render it directly; if it is the JS code of the ECharts chart, call the ECharts component for rendering; if it is a file, return a download link for the user to click.

2. The method for question-answering and visualization of mine production data based on a large model according to claim 1, characterized in that: The preset production data indicators include enterprise name, region, business year, month and day, element, output, ore output, ore output metal content, ore output grade, ore selection volume, selected metal content, selected grade and concentrate volume.

3. The method for question-answering and visualization of mine production data based on a large model according to claim 1, characterized in that: Step S1 includes receiving a storage time set by a user, storing the intent comparison table in ElasticSearch according to the storage time, and vectorizing and storing it in a vector database.

4. The method for question-answering and visualization of mine production data based on a large model according to claim 1, characterized in that: The summary in step S1 includes sum, average, maximum and minimum values.

5. The method for question-answering and visualization of mine production data based on a large model according to claim 1, characterized in that: Step S3 of combining the first mapping relationship and the second mapping relationship into a prompt word includes comparing the contents of the first mapping relationship and the second mapping relationship; if the contents of the first mapping relationship and the second mapping relationship are the same, retaining the first mapping relationship as the prompt word; If the contents of the first mapping relationship and the second mapping relationship are different, the first mapping relationship and the second mapping relationship are concatenated into a prompt word.

6. The method for question-answering and visualization of mine production data based on a large model according to claim 1, characterized in that: Step S5 includes inputting the script code processing instructions together with the user's actual input questions, the actual production data table and the prompt words into the large model, and the script code processing instructions include the generation form of the script code and the generation requirements of the script code.

7. A system for question-answering and visualization of mine production data based on a large model, characterized in that: The system comprises: A construction module is configured to establish an intention comparison table, wherein the intention comparison table pre-stores preset fuzzy questions and preset problem processing methods input by a user, wherein the preset fuzzy questions and the preset problem processing methods form a mapping relationship, wherein the preset fuzzy questions include question statements that do not clearly indicate preset production data indicators, and the preset problem processing methods include production data query steps, production data processing steps, and a text description of a production data display method used to solve the preset fuzzy questions; wherein the production data query step includes a text description of querying the preset production data indicators in a preset production data table, and the production data processing step includes further summarizing the text description of the preset production data indicators contained in the production data query step, and the display method includes text, tables, charts, and files; the intention comparison table is stored in ElasticSearch, and vectorized and stored in a vector database at the same time; and an actual production data table containing field names, field descriptions, and value ranges corresponding to the preset production data indicators is established; A matching module is configured to obtain a question actually input by a user; obtain a first mapping relationship set by using the question actually input by the user to perform vector matching in the vector database, and obtain a preset problem processing method for each mapping relationship in the first mapping relationship set; extract a preset production data indicator included in the preset problem processing method for each mapping relationship in the first mapping relationship set as a keyword, and obtain a second mapping relationship by using the keyword to perform keyword matching in the ElasticSearch; and splice the first mapping relationship and the second mapping relationship into a prompt word; A binding module is configured to replace the preset production data table and the preset production data indicator included in the prompt word with the field names corresponding to the actual production data table and the preset production data indicator respectively; A generating module is configured to input the user's actual input question, the actual production data table and the prompt word into the big model, and generate script code using the big model; An execution module is configured to execute the script code. In response to determining that the script code has completed the production data processing step and the display method corresponding to the script code is a table, it is determined whether the data volume after the production data processing step exceeds a preset threshold. If it exceeds, the display method corresponding to the script code is set to a file; if it does not exceed, the display method corresponding to the script code is retained as a table; if the display method corresponding to the script code is an icon, the JS code of the ECharts chart is generated; the corresponding form of rendering is performed through the front end. If it is Markdown text or a table, it is directly rendered; if it is the JS code of the ECharts chart, the ECharts component is called for rendering; if it is a file, a download link is returned for the user to click.

8. A computer-readable storage medium having one or more computer programs stored thereon, characterized in that: When the one or more computer programs are executed by a computer processor, the method according to any one of claims 1 to 6 is implemented.