Intelligent number asking method and system based on large model and storage medium

By introducing a combination method of large model and vector database in the intelligent number-based query system, the problem of low accuracy of intelligent number-based query is solved, efficient and accurate SQL number-based query script generation and data query are achieved, and the overall performance of intelligent number-based query is significantly improved.

CN120067130APending Publication Date: 2025-05-30BEIJING UNISOUND INFORMATION TECH CO LTD +7
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510126942.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-27
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, the accuracy of intelligent number of questions is low, and the accuracy of SQL number of questions is insufficient, resulting in limited efficiency and accuracy of intelligent number of questions.

Method used

Using a smart question-based method based on big model, the vector database matches the question-based query requirements, recalls the associated database and SQL examples, and combines the question-based query questions with the recall data, inputs the big model to generate an SQL question-based script, and finally performs data query and rendering in the local database.

Benefits of technology

It improves the accuracy of SQL question counting script generation, enhances the accuracy and efficiency of intelligent question counting, and can obtain valuable data information more quickly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067130A_ABST
    Figure CN120067130A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent question number method and system based on a large model and a storage medium, and the method comprises the steps: matching a question number query demand with a vector database, and obtaining associated recall data; combining the question number query question with the associated recall data to obtain question number prompt information; inputting the question number prompt information into a large model for script generation to obtain an SQL question number script, and sending the SQL question number script to a local database for data query to obtain target data; and performing data rendering on the target data to obtain rendered data, and displaying the rendered data. According to the embodiment of the invention, the associated recall data corresponding to the question number query demand is recalled through the content query capability of the vector database, and the SQL question number script is automatically generated through the script generation capability of the large model, so that the generation accuracy of the SQL question number script is effectively improved, and the accuracy of intelligent question number is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to an intelligent question number method, system and storage medium based on a large model. Background Art

[0002] In today's digital age, data in various industries has grown exponentially. Massive amounts of data are generated in enterprise operations, scientific research experiments, social activities, etc., such as transaction records on e-commerce platforms, case data in the medical field, etc. In the face of massive data, traditional data query and analysis methods are inefficient and it is difficult to quickly obtain valuable information. The intelligent question number technology has become an urgent need for efficiently processing massive data.

[0003] In the existing intelligent question number process, generally, a data matching method is used to generate an SQL question number script, resulting in a low accuracy rate of generating the SQL question number script and reducing the accuracy of the intelligent question number. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide an intelligent question number method, system and storage medium based on a large model to solve the problem of low accuracy of intelligent question number in the prior art.

[0005] The embodiments of the present invention are implemented as follows. An intelligent question number method based on a large model, the method includes:

[0006] Obtain the question number query requirement, and match the question number query requirement with a vector database to obtain associated recall data, where the associated recall data includes an associated database and an associated SQL example;

[0007] Obtain the question number query problem, and combine the question number query problem with the associated recall data to obtain question number prompt information;

[0008] Input the question number prompt information into a large model to generate an SQL question number script, and send the SQL question number script to a local database for data query to obtain target data;

[0009] Render the target data to obtain rendered data, and display the rendered data.

[0010] Preferably, matching the question number query requirement with a vector database to obtain associated recall data includes:

[0011] Perform text conversion on the question number query requirement to obtain a question number query text, and perform word segmentation on the question number query text to obtain text query word segments;

[0012] Perform stemming on the word segmentation of the text query to obtain the text query stem, and perform vector conversion on the text query stem to obtain the stem vector;

[0013] Combine the stem vectors to obtain the question number requirement vector, and match the question number requirement vector with the database vectors in the vector database to obtain the requirement similarity;

[0014] If any of the requirement similarities is greater than the similarity threshold, determine the database vector corresponding to the requirement similarity as the target requirement vector, and determine the data corresponding to the target requirement vector as the associated recall data.

[0015] Preferably, combine the question number query problem with the associated recall data to obtain the question number prompt information, including:

[0016] Obtain the data descriptions of the associated database and the associated SQL example, and insert the associated database, the associated SQL example, and the data description into the question number prompt template;

[0017] Obtain the transition statement corresponding to the question number prompt template, and add the question number query problem to the question number prompt template according to the transition statement to obtain the question number prompt information.

[0018] Preferably, before inputting the question number prompt information into the large model for script generation, it further includes:

[0019] Obtain the question number prompt samples, and perform feature extraction on the question number prompt samples to obtain the data sample features and the SQL sample features;

[0020] Perform vector conversion on the data sample features and the SQL sample features to obtain the data sample vectors and the SQL sample vectors, and fuse the data sample vectors and the SQL sample vectors to obtain the sample fusion vector;

[0021] Perform script prediction according to the sample fusion vector to obtain the SQL prediction script, and determine the model loss according to the SQL prediction script;

[0022] Update the parameters of the large model according to the model loss until the large model converges, and output the converged large model.

[0023] Preferably, send the SQL question number script to the local database for data query to obtain the target data, including:

[0024] Create a cursor object, and perform script adjustment on the SQL question number script according to the database type of the local database;

[0025] Send the SQL query script after script adjustment to the local database according to the execution method of the cursor object, and execute the SQL query script after script adjustment in the local database to obtain the target data.

[0026] Preferably, perform data rendering on the target data to obtain rendered data, including:

[0027] Obtain the data type of the target data, and determine the rendering style according to the data type;

[0028] Determine a style chart library according to the rendering style and the data type, and match the data parameters of the target data with the style chart library to obtain a target rendering chart;

[0029] Perform data conversion on the target data according to the chart parameters of the target rendering chart, and fill the target data after data conversion into the target rendering chart to obtain the rendered data.

[0030] Preferably, after sending the SQL query script to the local database for data query to obtain the target data, it further includes:

[0031] Receive the modification information of the target data and the SQL query script from the user, and optimize the parameters of the large model according to the modification information.

[0032] Another object of the embodiments of the present invention is to provide an intelligent query system based on a large model, and the system includes:

[0033] A data matching module, configured to obtain a query requirement, and match the query requirement with a vector database to obtain associated recall data, where the associated recall data includes an associated database and an associated SQL example;

[0034] A data combination module, configured to obtain a query question, and combine the query question with the associated recall data to obtain a query prompt message;

[0035] A data query module, configured to input the query prompt message into a large model to generate an SQL query script, send the SQL query script to the local database for data query to obtain target data;

[0036] A data display module, configured to perform data rendering on the target data to obtain rendered data, and display the rendered data.

[0037] Preferably, the data matching module is further configured to:

[0038] Perform text conversion on the query requirement for the number of questions to obtain a text query for the number of questions, and perform word segmentation on the text query for the number of questions to obtain text query word segments;

[0039] Perform stemming extraction on the text query word segments to obtain text query stems, and perform vector conversion on the text query stems to obtain stem vectors;

[0040] Combine the stem vectors to obtain a vector for the question number requirement, and match the vector for the question number requirement with the database vectors in the vector database to obtain a requirement similarity;

[0041] If any of the requirement similarities is greater than the similarity threshold, determine the database vector corresponding to the requirement similarity as the target requirement vector, and determine the data corresponding to the target requirement vector as the associated recalled data.

[0042] In the embodiments of the present invention, through the content query ability of the vector database, the associated recalled data corresponding to the query requirement for the number of questions is recalled, and through the script generation ability of the large model, an SQL question number script is automatically generated, effectively improving the accuracy of generating the SQL question number script and improving the accuracy of intelligent question numbering. Description of the Drawings

[0043] Figure 1 is a flowchart of an intelligent question numbering method based on a large model provided by the first embodiment of the present invention;

[0044] Figure 2 is a schematic structural diagram of an intelligent question numbering system based on a large model provided by the second embodiment of the present invention;

[0045] Figure 3 is a specific implementation schematic diagram of an intelligent question numbering system based on a large model provided by the second embodiment of the present invention;

[0046] Figure 4 is a schematic structural diagram of a terminal device provided by the third embodiment of the present invention. Detailed Description of the Embodiments

[0047] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0048] In order to illustrate the technical solutions described in the present invention, the following will be described through specific embodiments.

[0049] Embodiment 1

[0050] Please refer to Figure 1, is a flowchart of the intelligent question number method based on a large model provided by the first embodiment of the present invention. This intelligent question number method based on a large model can be applied to any device or system. The intelligent question number method based on a large model includes the steps:

[0051] Step S10, obtain the question number query requirement, and match the question number query requirement with the vector database to obtain associated recall data;

[0052] Among them, the associated recall data includes an associated database and an associated SQL example. The associated database is a database resource associated with the question number query requirement, and the associated SQL example is an SQL statement associated with the question number query requirement.

[0053] Optionally, matching the question number query requirement with the vector database to obtain associated recall data includes:

[0054] Perform text conversion on the question number query requirement to obtain a question number query text, and perform word segmentation on the question number query text to obtain text query word segments; among them, by performing text conversion on the question number query requirement, the question number query requirement can be effectively converted into a text format of the question number query text, removing special characters in the question number query text, such as punctuation marks (periods, commas, exclamation marks, etc.), HTML tags (if any, such as in some web page input scenarios), extra spaces, etc. Use a word segmentation tool (such as a rule-based word segmenter or a deep learning word segmentation model, such as Jieba word segmentation, etc.) to split the question number query text into individual words or tokens. For example, for the question number query text "Display all user information in the user table", it may be segmented into "Display", "user table", "in", "all", "user information;

[0055] Perform stemming on the text query word segments to obtain text query stems, and perform vector conversion on the text query stems to obtain stem vectors; among them, convert the text query word segments into their basic forms (stems);

[0056] Combine the stem vectors to obtain a question number requirement vector, and match the question number requirement vector with the database vectors in the vector database to obtain a requirement similarity; among them, calculate the similarity between the question number requirement vector and the database vectors to obtain a requirement similarity;

[0057] If any of the requirement similarities is greater than the similarity threshold, determine the database vector corresponding to the requirement similarity as the target requirement vector, and determine the data corresponding to the target requirement vector as the associated recall data; among them, the similarity threshold can be set according to requirements. If the requirement similarity is greater than the similarity threshold, it is determined that the data corresponding to the database vector of the requirement similarity is data associated with the question number query requirement.

[0058] Step S20: Obtain the question number query question, and combine the question number query question with the associated recall data to obtain a question number prompt message;

[0059] Among them, the question number query question is used to represent the user's question about the information that needs to be feedback for the current intelligent question number. By combining the question number query question with the associated recall data, it effectively facilitates the subsequent script generation operation of the large model for the question number query question and the associated recall data.

[0060] Optionally, combining the question number query question with the associated recall data to obtain a question number prompt message includes:

[0061] Obtain the data descriptions of the associated database and the associated SQL example, and insert the associated database, the associated SQL example, and the data descriptions into the question number prompt template; among them, the associated SQL example is interpreted in detail to understand its functions and purposes, and the tables, fields, conditions, and SQL syntax features involved in the SQL example (such as JOIN operations, WHERE clauses, etc.) are marked to obtain the data description;

[0062] Obtain the transition statement corresponding to the question number prompt template, and add the question number query question to the question number prompt template according to the transition statement to obtain the question number prompt message; among them, the question number prompt template is matched with the transition query table to obtain the transition statement, and the transition query table stores the corresponding relationship between different question number prompt templates and the corresponding transition statements.

[0063] Step S30: Input the question number prompt message into the large model for script generation to obtain an SQL question number script, and send the SQL question number script to the local database for data query to obtain the target data;

[0064] Among them, by inputting the question number prompt message into the large model for script generation, the SQL question number script is automatically generated based on the large model, which improves the accuracy of the SQL question number script generation.

[0065] Optionally, before inputting the question number prompt message into the large model for script generation, it further includes:

[0066] Obtain a question number prompt sample, and perform feature extraction on the question number prompt sample to obtain a data sample feature and an SQL sample feature;

[0067] Perform vector transformation on the data sample features and the SQL sample features to obtain a data sample vector and an SQL sample vector, and fuse the data sample vector and the SQL sample vector to obtain a sample fusion vector; wherein, by fusing the data sample vector and the SQL sample vector, the sample fusion vector can effectively represent the relevance between the data and the SQL in the question number prompt sample;

[0068] Perform script prediction based on the sample fusion vector to obtain an SQL prediction script, and determine the model loss based on the SQL prediction script; wherein, during the script prediction process, the database information is used as background knowledge for generating the SQL script, the SQL sample is used as an example guide, and the user question is used as the core task to analyze the relationship between the data, the SQL script, and the question;

[0069] Update the parameters of the large model according to the model loss until the large model converges, and output the converged large model.

[0070] Further, send the SQL question number script to the local database for data query to obtain target data, including:

[0071] Create a cursor object, and perform script adjustment on the SQL question number script according to the database type of the local database; wherein, the script adjustment methods for different database types are different. In this step, match the database type with the adjustment query table to obtain the script adjustment method, and perform script adjustment on the SQL question number script based on the script adjustment method. The adjustment query table stores the corresponding relationship between different database types and the corresponding script adjustment methods. The cursor object is a tool for executing the SQL question number script and processing the result set;

[0072] Send the script-adjusted SQL question number script to the local database according to the execution method of the cursor object, and execute the script-adjusted SQL question number script in the local database to obtain the target data; wherein, use the execution method of the cursor object (such as the execute() method) to send the SQL question number script to the local database for statement execution.

[0073] Even further, after sending the SQL question number script to the local database for data query to obtain target data, it further includes:

[0074] Receive the modification information of the user on the target data and the SQL question number script, and optimize the parameters of the large model according to the modification information; wherein, the modification information includes opinions such as adjusting the query structure, adding or modifying indexes, etc. Optimizing the parameters of the large model through the modification information effectively improves the accuracy of the large model script generation.

[0075] Step S40: Render the target data to obtain rendered data, and display the rendered data.

[0076] Among them, by rendering the target data, the display effect of the target data is effectively improved.

[0077] Optionally, rendering the target data to obtain rendered data includes:

[0078] Obtain the data type of the target data, and determine the rendering style according to the data type; among them, by matching the data type with the style query table, the rendering style is obtained, and the style query table stores the rendering styles corresponding to different data types;

[0079] Determine the style chart library according to the rendering style and the data type, match the data parameters of the target data with the style chart library to obtain the target rendering chart, perform data conversion on the target data according to the chart parameters of the target rendering chart, and fill the target data after data conversion into the target rendering chart to obtain the rendered data; among them, by performing data conversion on the target data according to the chart parameters of the target rendering chart, the accuracy of filling the target data is effectively improved. After filling the target data after data conversion into the target rendering chart, call the rendering method corresponding to the target rendering chart to perform image rendering to obtain the target rendering chart.

[0080] In this embodiment, through the content query ability of the vector database, the associated recall data corresponding to the question query requirement is recalled, and through the script generation ability of the large model, the SQL question query script is automatically generated, effectively improving the accuracy of generating the SQL question query script and improving the accuracy of intelligent question query.

[0081] Embodiment 2

[0082] Please refer to Figure 2 , which is a schematic structural diagram of the intelligent question query system 100 based on a large model provided by the second embodiment of the present invention, including:

[0083] The data matching module 10 is used to obtain the question query requirement and match the question query requirement with the vector database to obtain associated recall data, and the associated recall data includes an associated database and an associated SQL example.

[0084] Optionally, the data matching module 10 is further used to: perform text conversion on the question query requirement to obtain a question query text, and perform word segmentation on the question query text to obtain text query word segments;

[0085] Perform stemming on the word segmentation of the text query to obtain the text query stem, and perform vector transformation on the text query stem to obtain the stem vector;

[0086] Combine the stem vectors to obtain the question number demand vector, and match the question number demand vector with the database vectors in the vector database to obtain the demand similarity;

[0087] If any of the demand similarities is greater than the similarity threshold, determine the database vector corresponding to the demand similarity as the target demand vector, and determine the data corresponding to the target demand vector as the associated recall data.

[0088] The data combination module 11 is used to obtain the question number query problem, and combine the question number query problem with the associated recall data to obtain the question number prompt information.

[0089] Optionally, the data combination module 11 is further used to: obtain the data descriptions of the associated database and the associated SQL example, and insert the associated database, the associated SQL example, and the data description into the question number prompt template;

[0090] Obtain the transition statement corresponding to the question number prompt template, and add the question number query problem to the question number prompt template according to the transition statement to obtain the question number prompt information.

[0091] The data query module 12 is used to input the question number prompt information into the large model for script generation to obtain the SQL question number script, and send the SQL question number script to the local database for data query to obtain the target data.

[0092] Optionally, the data query module 12 is further used to: obtain the question number prompt samples, and perform feature extraction on the question number prompt samples to obtain the data sample features and the SQL sample features;

[0093] Perform vector transformation on the data sample features and the SQL sample features to obtain the data sample vector and the SQL sample vector, and fuse the data sample vector and the SQL sample vector to obtain the sample fusion vector;

[0094] Perform script prediction according to the sample fusion vector to obtain the SQL prediction script, and determine the model loss according to the SQL prediction script;

[0095] Update the parameters of the large model according to the model loss until the large model converges, and output the converged large model.

[0096] Further, the data query module 12 is further configured to: create a cursor object, and adjust the SQL query script according to the database type of the local database;

[0097] Send the SQL query script after script adjustment to the local database according to the execution mode of the cursor object, and execute the SQL query script after script adjustment in the local database to obtain the target data.

[0098] Furthermore, the data query module 12 is further configured to: receive the modification information of the target data and the SQL query script by the user, and optimize the parameters of the large model according to the modification information.

[0099] The data display module 13 is configured to perform data rendering on the target data to obtain rendered data, and display the rendered data.

[0100] Optionally, the data display module 13 is further configured to: obtain the data type of the target data, and determine the rendering style according to the data type;

[0101] Determine a style chart library according to the rendering style and the data type, and match the data parameters of the target data with the style chart library to obtain a target rendering chart;

[0102] Perform data conversion on the target data according to the chart parameters of the target rendering chart, and fill the target data after data conversion into the target rendering chart to obtain the rendered data.

[0103] Please refer to Figure 3 , in this embodiment, the query SQL examples related to the database are maintained through a vector database. When the user queries data in natural language, the query question is vectorized and retrieved, and the relevant SQL examples are recalled. In the prompt, the SQL examples are added and sent to the large model for SQL script generation to improve the accuracy of the generated SQL script. Specifically:

[0104] Step 1. Maintain the database information, common query statements, and corresponding SQL scripts in the vector database;

[0105] Step 2. When the user performs intelligent query using natural language, recall the relevant database and SQL examples of the question from the vector database;

[0106] Step 3. Assemble the relevant database information, SQL examples, and the user's query question into a prompt;

[0107] Step 4. Send the prompt to the large model for understanding and generating an SQL script;

[0108] Step 5. Send the SQL script to the database to obtain relevant data;

[0109] Step 6. After the front-end display page obtains the relevant data, render it in the form of a chart for display;

[0110] Step 7. When the SQL script is inaccurate, after the data analyst writes the correct SQL script, add it to the vector database;

[0111] Repeat steps 2 to 6 to verify the optimized intelligent question-answering results.

[0112] In this embodiment, by utilizing the relevant content query ability of the vector database, retrieve the relevant SQL examples of the user's query instruction, and combine with the large model to improve the accuracy of the intelligent question-answering scenario of the large model; solve the problem of inaccurate data query SQL script in the large model generation architecture, without the need to retrain the large model by fine-tuning, and greatly reduce the optimization cycle.

[0113] In this embodiment, through the content query ability of the vector database, recall the associated recalled data corresponding to the question-answering query requirement, and automatically generate the SQL question-answering script through the script generation ability of the large model, effectively improving the accuracy of the generated SQL question-answering script and the accuracy of intelligent question-answering.

[0114] Embodiment Three

[0115] Figure 4 It is a structural block diagram of a terminal device 2 provided by the third embodiment of the present application. As Figure 4 shown, the terminal device 2 of this embodiment includes: a processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the processor 20, such as a program for the intelligent question-answering method based on the large model. When the processor 20 executes the computer program 22, it implements the steps in each of the above embodiments of the intelligent question-answering method based on the large model.

[0116] Exemplarily, the computer program 22 can be divided into one or more modules, the one or more modules are stored in the memory 21, and are executed by the processor 20 to complete the present application. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 22 in the terminal device 2. The terminal device may include, but is not limited to, the processor 20 and the memory 21.

[0117] The so-called processor 20 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0118] The memory 21 may be an internal storage unit of the terminal device 2, such as the hard disk or memory of the terminal device 2. The memory 21 may also be an external storage device of the terminal device 2, such as a plug-in hard disk equipped on the terminal device 2, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 21 may also include both the internal storage unit of the terminal device 2 and the external storage device. The memory 21 is used to store the computer program and other programs and data required by the terminal device. The memory 21 may also be used to temporarily store data that has been output or is to be output.

[0119] In addition, in each embodiment of the present application, the various functional modules may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0120] When an integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium can be non-volatile or volatile. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of this application, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable storage medium can include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.

[0121] The above-mentioned embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of this application, and should all be included in the protection scope of this application.

Claims

1. An intelligent questioning method based on a large model, characterized in that: The method comprises: Obtaining a number query requirement, and matching the number query requirement with a vector database to obtain associated recall data, wherein the associated recall data includes an associated database and an associated SQL example; Obtaining a question for question number query, and combining the question number query question with the associated recall data to obtain question number prompt information; Input the query prompt information into the big model to generate a script to obtain an SQL query script, and send the SQL query script to the local database to query the data to obtain the target data; The target data is rendered to obtain rendering data, and the rendering data is displayed.

2. The intelligent questioning method based on a large model as claimed in claim 1, characterized in that: Matching the number query requirement with the vector database to obtain associated recall data includes: Performing text conversion on the number query demand to obtain a number query text, and performing word segmentation on the number query text to obtain text query word segmentation; Performing stem extraction on the text query word segmentation to obtain a text query stem, and performing vector conversion on the text query stem to obtain a stem vector; Combining the stem vectors to obtain a question number demand vector, and matching the question number demand vector with a database vector in the vector database to obtain demand similarity; If any of the demand similarities is greater than a similarity threshold, the database vector corresponding to the demand similarity is determined as a target demand vector, and the data corresponding to the target demand vector is determined as associated recall data.

3. The intelligent questioning method based on a large model as claimed in claim 1, characterized in that: The question number query question and the associated recall data are combined to obtain question number prompt information, including: Obtaining data descriptions of the associated database and the associated SQL example, and inserting the associated database, the associated SQL example and the data description into a question prompt template; A transition sentence corresponding to the question prompt template is obtained, and the question query question is added to the question prompt template according to the transition sentence to obtain the question prompt information.

4. The intelligent questioning method based on a large model as claimed in claim 1, characterized in that: Before inputting the question prompt information into the large model for script generation, the method further includes: Obtaining a question prompt sample, and performing feature extraction on the question prompt sample to obtain data sample features and SQL sample features; Performing vector conversion on the data sample features and the SQL sample features to obtain a data sample vector and an SQL sample vector, and fusing the data sample vector and the SQL sample vector to obtain a sample fusion vector; Perform script prediction according to the sample fusion vector to obtain an SQL prediction script, and determine the model loss according to the SQL prediction script; The parameters of the large model are updated according to the model loss until the large model converges, and the converged large model is output.

5. The intelligent questioning method based on a large model as claimed in claim 1, characterized in that: Send the SQL query script to the local database for data query to obtain target data, including: Creating a cursor object, and adjusting the SQL query script according to the database type of the local database; The SQL query script adjusted by the script is sent to the local database according to the execution mode of the cursor object, and the SQL query script adjusted by the script is executed in the local database to obtain the target data.

6. The intelligent questioning method based on a large model as claimed in claim 1, characterized in that: Rendering the target data to obtain rendered data includes: Acquire the data type of the target data, and determine the rendering style according to the data type; Determine a style chart library according to the rendering style and the data type, and match the data parameters of the target data with the style chart library to obtain a target rendering chart; The target data is converted according to the chart parameters of the target rendering chart, and the target data after the data conversion is filled into the target rendering chart to obtain the rendering data.

7. The intelligent questioning method based on a large model as claimed in claim 1, characterized in that: Sending the SQL query script to the local database for data query, after obtaining the target data, further includes: Receive the user's modification information on the target data and the SQL query script, and optimize the parameters of the large model according to the modification information.

8. An intelligent questioning system based on a large model, characterized in that: The system comprises: A data matching module is used to obtain a number query requirement and match the number query requirement with a vector database to obtain associated recall data, wherein the associated recall data includes an associated database and an associated SQL example; A data combination module, used for obtaining a question number query question, and combining the question number query question with the associated recall data to obtain question number prompt information; A data query module is used to input the query prompt information into the big model to generate a script, obtain an SQL query script, and send the SQL query script to a local database to query data and obtain target data; The data display module is used to render the target data, obtain the rendered data, and display the rendered data.

9. The intelligent questioning system based on a large model as claimed in claim 8, characterized in that: The data matching module is also used for: Performing text conversion on the number query demand to obtain a number query text, and performing word segmentation on the number query text to obtain text query word segmentation; Performing stem extraction on the text query word segmentation to obtain a text query stem, and performing vector conversion on the text query stem to obtain a stem vector; Combining the stem vectors to obtain a question number demand vector, and matching the question number demand vector with a database vector in the vector database to obtain demand similarity; If any of the demand similarities is greater than a similarity threshold, the database vector corresponding to the demand similarity is determined as a target demand vector, and the data corresponding to the target demand vector is determined as associated recall data.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Medical text feature extraction method and system combined with NPL and large model, and medium

    CN120910255A