Fund data query method and device, electronic equipment and storage medium

By judging the completeness of the fund data query problems entered by users and modifying historical dialogue information, a complete SQL query statement is generated, which solves the problem of inaccurate fund data query results in the existing technology, and achieves more accurate and reliable query results.

CN119597789APending Publication Date: 2025-03-11CHINA POST INFORMATION TECH (BEIJING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411669592.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The existing fund data query solution has the problem of inaccurate fund data query results, which is mainly because the query problems entered by users may be incomplete, resulting in missing information and incorrect results.

Method used

By judging whether the fund data query problem entered by the user is complete. If it is incomplete, historical dialogue information is obtained and the query problem is modified based on this to ensure its integrity. Then the complete problem is transformed into a structured query language (SQL), generate the corresponding data query statement, and execute the statement to obtain the query result.

Benefits of technology

By modifying and judging the completeness of fund data query problems, the accuracy of query results is ensured, and the accuracy and reliability of fund data query results are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597789A_ABST
    Figure CN119597789A_ABST
Patent Text Reader

Abstract

The invention discloses a fund data query method and device, electronic equipment and a storage medium. The method comprises the following steps: in response to a fund data query problem input by a user, judging whether the fund data query problem is complete or not; under the condition that the fund data query problem is incomplete, historical dialogue information is obtained, the fund data query problem is modified based on the historical dialogue information, and a complete fund data query problem is obtained; performing structured query language conversion on the complete fund data query problem to obtain a data query statement corresponding to the complete fund data query problem; and executing the data query statement corresponding to the complete fund data query problem to obtain a fund data query result corresponding to the fund data query problem. According to the technical scheme, the fund data query problem is modified, so that the fund data query problem is complete, the accuracy of the fund data query problem is improved, and the accuracy of a fund data query result 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 a fund data query method, device, electronic device and storage medium. Background Art

[0002] Traditional data query methods rely on users to master Structured Query Language (SQL) expertise, which is a high barrier for users with non-technical backgrounds. In order to lower this barrier, Text-to-SQL technology came into being, which allows users to ask questions in natural language, and the system automatically converts these questions into SQL queries, thereby simplifying the data query process.

[0003] In a multi-round dialogue scenario of fund data query, as the number of dialogue rounds increases, the missing information in the fund data query question may lead to incorrect fund data query results.

[0004] In the process of implementing the present invention, it is found that there are at least the following technical problems in the prior art: the existing fund data query solution has the problem of inaccurate fund data query results. Summary of the invention

[0005] The present invention provides a fund data query method, device, electronic equipment and storage medium to improve the accuracy of fund data query results.

[0006] According to one aspect of the present invention, there is provided a fund data query method, comprising:

[0007] In response to a fund data query question input by a user, determining whether the fund data query question is complete;

[0008] In the case where the fund data query question is incomplete, obtaining historical dialogue information, and modifying the fund data query question based on the historical dialogue information to obtain a complete fund data query question;

[0009] Converting the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question;

[0010] The data query statement corresponding to the complete fund data query question is executed to obtain the fund data query result corresponding to the fund data query question.

[0011] According to another aspect of the present invention, there is provided a fund data query device, comprising:

[0012] A fund data query question judgment module, used to respond to the fund data query question input by the user and judge whether the fund data query question is complete;

[0013] A fund data query question modification module, used for obtaining historical dialogue information when the fund data query question is incomplete, and modifying the fund data query question based on the historical dialogue information to obtain a complete fund data query question;

[0014] A structured query language conversion module, used to convert the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question;

[0015] The data query statement query module is used to execute the data query statement corresponding to the complete fund data query question to obtain the fund data query result corresponding to the fund data query question.

[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0017] at least one processor;

[0018] and a memory communicatively coupled to the at least one processor;

[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the fund data query method described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the fund data query method described in any embodiment of the present invention when executed.

[0021] The technical solution of the embodiment of the present invention determines whether the fund data query question is complete by responding to the fund data query question input by the user. If the fund data query question is incomplete, historical dialogue information is obtained, and then the fund data query question is modified based on the historical dialogue information to obtain a complete fund data query question, and the complete fund data query question is converted into a structured query language to obtain a data query statement corresponding to the complete fund data query question, and the data query statement corresponding to the complete fund data query question is executed to obtain a fund data query result corresponding to the fund data query question. The above technical solution makes the fund data query question complete by modifying the fund data query question, thereby improving the accuracy of the fund data query question, and then improving the accuracy of the fund data query result.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a flow chart of a fund data query method provided according to the first embodiment of the present invention;

[0025] Figure 2 is a flow chart of a fund data query method provided according to Embodiment 2 of the present invention;

[0026] Figure 3 is a flow chart of a fund data query method provided according to Embodiment 3 of the present invention;

[0027] Figure 4 is a flow chart of a fund data query method provided according to a fourth embodiment of the present invention;

[0028] Figure 5 is a flow chart of a fund data query method provided according to Embodiment 5 of the present invention;

[0029] Figure 6 is a schematic diagram of the structure of a fund data query device provided according to Embodiment 6 of the present invention;

[0030] Figure 7 It is a structural schematic diagram of an electronic device for implementing the fund data query method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0033] Embodiment 1

[0034] Figure 1 This is a flow chart of a fund data query method provided in the first embodiment of the present invention. This embodiment is applicable to the case where a user queries fund data in real time through a question-and-answer dialogue. The method can be executed by a fund data query device, which can be implemented in the form of hardware and / or software. The fund data query device can be configured in electronic devices such as terminals and / or servers. Figure 1 As shown, the method includes:

[0035] S110. In response to a fund data query question input by a user, determining whether the fund data query question is complete.

[0036] In the embodiment of the present invention, the fund data query question refers to a natural language question for querying fund data such as fund products, fund managers or fund companies.

[0037] Exemplarily, the fund data query question entered by the user in the dialog box may be "What is the management fee of Fund A?" or "What is the average annualized return of this fund?", etc., which are not specifically limited here.

[0038] Specifically, the judgment rules for whether the fund data query question is complete may include but are not limited to: whether the fund data query question lacks the fund name or the fund company name, etc. For example, if the fund data query question lacks the fund name or the fund company name, the fund data query question is considered incomplete.

[0039] S120: When the fund data query question is incomplete, historical dialogue information is obtained, and the fund data query question is modified based on the historical dialogue information to obtain a complete fund data query question.

[0040] In the embodiment of the present invention, the historical dialogue information refers to the fund data query questions inputted by the user in the past, and the number of the historical dialogue information may be one or more, which is not specifically limited here. The operation of modifying the fund data query question based on the historical dialogue information includes one or more operations of adding, deleting and replacing words, etc., which is not specifically limited here.

[0041] Exemplarily, the fund data query question may be "What is the average annualized return of this fund?", and the historical dialogue information may be "What is the management fee of Fund A?". The "this only" in the fund data query question may be modified to "A" to make the fund data query question complete.

[0042] It should be noted that when the fund data query question is incomplete, the fund data query question is modified according to the historical dialogue information, thereby realizing the reference to the historical dialogue information, so that the modified fund data query question conforms to the context of the dialogue context, thereby improving the accuracy of the fund data query question.

[0043] S130: Convert the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question.

[0044] In the embodiment of the present invention, the structured query language conversion refers to converting the complete fund data query question into an SQL query statement to establish a connection between the natural language and the database.

[0045] For example, a complete fund data query question may be “What is the average annualized return of Fund A?”, and a data query statement corresponding to the complete fund data query question may be “SELECT average annualized return FROM database WHERE NAME=A”.

[0046] S140: Execute a data query statement corresponding to the complete fund data query question to obtain a fund data query result corresponding to the fund data query question.

[0047] Exemplarily, executing "SELECT average annualized return FROM database WHERE NAME=A", the fund data query result corresponding to the fund data query question may be "4.19%".

[0048] In some optional embodiments, after executing the data query statement corresponding to the complete fund data query question and obtaining the fund data query result corresponding to the fund data query question, it also includes: assembling the fund data query question and the fund data query result to obtain a question and answer result prompt word; inputting the question and answer result prompt word into the large language model to obtain the answer result corresponding to the fund data query question.

[0049] Among them, the question and answer result prompt words are reference information that guides the large language model to output the answer results corresponding to the fund data query questions.

[0050] For example, the fund data query question may be "What is the average annualized return of fund A?", the fund data query result may be "4.19%", and the assembled question and answer result prompt may be "Generate the answer result corresponding to the fund data query question based on the reference sample.

[0051] Reference example: Historical fund data query question: What is the average annualized return of Fund F? The fund data query result of the historical fund data query question: 3.27%; the corresponding answer result of the historical fund data query question: The average annualized return of Fund F is 3.27%.

[0052] Current fund data query question: What is the average annualized return of Fund A?

[0053] Fund data query results for the current fund data query question: 4.19%;

[0054] The answer result corresponding to the current fund data query question: "

[0055] Furthermore, the prompt words of the above question and answer results are input into the large language model, and the large language model can output "the average annualized return of Fund A is 4.19%", wherein the large language model can be Qwen or chatGLM, etc., which is not specifically limited here.

[0056] The technical solution of the embodiment of the present invention determines whether the fund data query question is complete by responding to the fund data query question input by the user. If the fund data query question is incomplete, historical dialogue information is obtained, and then the fund data query question is modified based on the historical dialogue information to obtain a complete fund data query question, and the complete fund data query question is converted into a structured query language to obtain a data query statement corresponding to the complete fund data query question, and the data query statement corresponding to the complete fund data query question is executed to obtain a fund data query result corresponding to the fund data query question. The above technical solution makes the fund data query question complete by modifying the fund data query question, thereby improving the accuracy of the fund data query question, and then improving the accuracy of the fund data query result.

[0057] Embodiment 2

[0058] Figure 2A flowchart of a fund data query method provided in Embodiment 2 of the present invention, the method of this embodiment can be combined with each optional solution in the fund data query method provided in the above embodiment. The fund data query method provided in this embodiment is further optimized. Optionally, the determination of whether the fund data query question is complete includes: inputting the fund data query question into a large language model to obtain the intent category of the fund data query question; and determining whether the fund data query question is complete based on the intent category of the fund data query question.

[0059] like Figure 2 As shown, the method includes:

[0060] S210 . In response to a fund data query question input by a user, the fund data query question is input into a large language model to obtain an intent category of the fund data query question.

[0061] S220: Determine whether the fund data query question is complete based on the intent category of the fund data query question.

[0062] S230: When the fund data query question is incomplete, historical dialogue information is obtained, and the fund data query question is modified based on the historical dialogue information to obtain a complete fund data query question.

[0063] S240: Convert the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question.

[0064] S250: Execute a data query statement corresponding to the complete fund data query question to obtain a fund data query result corresponding to the fund data query question.

[0065] In the embodiment of the present invention, the intent categories may include fund product information query, fund company information query, fund manager information query, and data screening according to specified conditions, etc., which are not specifically limited here. It should be noted that the fund data query question is fully judged based on the intent category of the fund data query question, which realizes the classification of the fund data query question complete judgment, makes the fund data query question complete judgment more targeted, and thus improves the accuracy of the fund data query question complete judgment.

[0066] Optionally, judging whether the fund data query question is complete based on the intent category of the fund data query question includes: when the fund data query question is a fund product information query intent category, judging whether the fund data query question includes the fund name and the fund field to be queried; if the fund name and / or the fund field to be queried are missing, the fund data query question is incomplete; when the fund data query question is a fund company information query intent category, judging whether the fund data query question includes the fund company name and the fund field to be queried; if the fund company name and / or the fund field to be queried are missing, the fund data query question is incomplete; when the fund data query question is a fund manager information query intent category, judging whether the fund data query question includes the fund manager name and the fund field to be queried; if the fund manager name and / or the fund field to be queried are missing, the fund data query question is incomplete; when the fund data query question is a data filtering intent category according to specified conditions, judging whether the fund data query question includes the filtering field and filtering condition; if the filtering field and / or filtering condition are missing, the fund data query question is incomplete.

[0067] Exemplarily, in the case where the fund data query question is of the fund product information query intent category, if the fund data query question is "What is the average annualized return of this fund?", then the fund data query question lacks the fund name; in the case where the fund data query question is of the fund company information query intent category, if the fund data query question is "Fund Company A has?", then the fund data query question lacks the queried fund field; in the case where the fund data query question is of the fund manager information query intent category, if the fund data query question is "How many years of work has this fund manager had?", then the fund data query question lacks the fund manager's name; in the case where the fund data query question is of the data filtering intent category according to specified conditions, if the fund data query question is "What are the funds with management fee rates greater than 0.5?", where the filtering field is "management fee rate" and the filtering condition is "greater than 0.5", then the fund data query question contains the filtering field and the filtering condition, and the fund data query question is complete.

[0068] The technical solution of the embodiment of the present invention obtains the intent category of the fund data query question by inputting the fund data query question into a large language model, and then judges whether the fund data query question is complete based on the intent category of the fund data query question, thereby realizing the classification of the complete judgment of the fund data query question, making the complete judgment of the fund data query question more targeted, thereby improving the accuracy of the complete judgment of the fund data query question.

[0069] Embodiment 3

[0070] Figure 3A flowchart of a fund data query method provided in Embodiment 3 of the present invention, the method of this embodiment can be combined with the various optional schemes in the fund data query method provided in the above embodiments. The fund data query method provided in this embodiment is further optimized. Optionally, the fund data query question is modified based on the historical dialogue information to obtain a complete fund data query question, including: when the historical dialogue information and the fund data query question have the same intent category, generating question completion prompt words based on the historical dialogue information and the fund data query question; inputting the question completion prompt words into a large language model to obtain a complete fund data query question.

[0071] like Figure 3 As shown, the method includes:

[0072] S310: In response to a fund data query question input by a user, determine whether the fund data query question is complete.

[0073] S320: When the fund data query question is incomplete, obtain historical dialogue information; when the historical dialogue information and the fund data query question have the same intent category, generate a question completion prompt word based on the historical dialogue information and the fund data query question.

[0074] S330: Input the question completion prompt words into the large language model to obtain a complete fund data query question.

[0075] S340: Convert the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question.

[0076] S350: Execute a data query statement corresponding to the complete fund data query question to obtain a fund data query result corresponding to the fund data query question.

[0077] In the embodiment of the present invention, the number of historical dialogue information can be multiple. Specifically, according to the last-in-first-out principle, the intent category of each historical dialogue information is judged in turn. When the intent category of the historical dialogue information and the fund data query question is the same, a question completion prompt word is generated according to the historical dialogue information and the fund data query question, and the question completion prompt word is input into the large language model to obtain a complete fund data query question. When the intent category of the historical dialogue information and the fund data query question are different, it can be returned and prompted to the user to manually complete the input fund data query question.

[0078] Among them, the question completion prompt word refers to the reference information that guides the large language model to output a complete fund data query question.

[0079] Exemplarily, the question completion prompt words may be as follows:

[0080] {"prompt":

[0081] """

[0082] The intent category of the current fund data query question is to query fund product information. The current fund data query question lacks the fund name or query field. Please refer to the following example to complete the current fund data query question based on historical conversation information.

[0083] Example 1:

[0084] Previous questions: What is the full name of the securities of China Asset Management?

[0085] current question: What is his hosting rate?

[0086] Your response: What is the custody fee rate of China Asset Management Fund?

[0087] Example 2:

[0088] Previous questions: What is the full name of the securities of the 002901 fund?

[0089] current question: What is the abbreviation of his fund?

[0090] Your response:What is the abbreviation of the 002901 fund?

[0091] Example 3:

[0092] Previous questions: Who is the fund manager of Invesco Great Wall Jingyi Double Profit C?

[0093] current question: Which fund has the highest management fee?

[0094] Your response: Which fund has the highest management fee?

[0095] Previous questions:{What is the management fee of Fund A?}

[0096] current input:{What is the average annualized return of this fund?}

[0097] Your response:"""}

[0098] In the above question completion prompt words, "What is the management fee of Fund A?" represents the historical conversation information, and "What is the average annualized return of this fund?" represents the fund data query question. Further, the above question completion prompt words are input into the large language model to obtain the complete fund data query question: "What is the average annualized return of Fund A?".

[0099] The technical solution of the embodiment of the present invention realizes the reference to the historical dialogue information of the same intent category, so that the modified fund data query question conforms to the context of the dialogue context, thereby improving the accuracy of the fund data query question.

[0100] Embodiment 4

[0101] Figure 4 A flow chart of a fund data query method provided for Embodiment 4 of the present invention, the method of this embodiment can be combined with the various optional schemes in the fund data query method provided in the above embodiments. The fund data query method provided in this embodiment has been further optimized. Optionally, the complete fund data query question is converted into a structured query language to obtain a data query statement corresponding to the complete fund data query question, including: obtaining a fund data query statement similar to the complete fund data query question; assembling a fund data query statement similar to the complete fund data query question and the complete fund data query question to obtain a query statement generation prompt word; inputting the query statement generation prompt word into a large language model to obtain a data query statement corresponding to the complete fund data query question.

[0102] like Figure 4 As shown, the method includes:

[0103] S410: In response to a fund data query question input by a user, determine whether the fund data query question is complete.

[0104] S420: When the fund data query question is incomplete, historical dialogue information is obtained, and the fund data query question is modified based on the historical dialogue information to obtain a complete fund data query question.

[0105] S430: Obtain a fund data query statement similar to the complete fund data query question.

[0106] S440: Assemble a fund data query statement similar to the complete fund data query question and the complete fund data query question to obtain a query statement generation prompt word.

[0107] S450: Input the query statement generation prompt word into the large language model to obtain the data query statement corresponding to the complete fund data query question.

[0108] S460: Execute a data query statement corresponding to the complete fund data query question to obtain a fund data query result corresponding to the fund data query question.

[0109] In the embodiment of the present invention, the fund data query statement refers to an SQL query statement similar to a complete fund data query question.

[0110] For example, a complete fund data query question may be "What is the management fee of fund A?", and a fund data query statement similar to the complete fund data query question may be "SELECT management fee FROM database WHERE NAME=B" or "SELECT management fee FROM database WHERE NAME=*", wherein "SELECT management fee FROM database WHERE NAME=B" corresponds to the question "What is the management fee of fund B?", and "SELECT management fee FROM database WHERE NAME=*" corresponds to the question "What is the management fee of fund *?", where * represents the fund name after masking. It should be noted that after masking the fund name, "What is the management fee?" is given more weight than "fund A" when calculating the similarity, thereby improving the accuracy of the obtained similar fund data query statements.

[0111] Optionally, obtaining a fund data query statement similar to a complete fund data query question includes: performing a vectorization operation on the complete fund data query question to obtain a feature vector corresponding to the complete fund data query question; performing a vectorization operation on each historical fund data query question in a structured query language question and answer library to obtain a feature vector corresponding to each historical fund data query question; determining a cosine similarity between each historical fund data query question and the complete fund data query question based on the feature vector corresponding to the complete fund data query question and the feature vector corresponding to each historical fund data query question; sorting the historical fund data query statements in the structured query language question and answer library based on the cosine similarity between each historical fund data query question and the complete fund data query question; and obtaining a fund data query statement similar to the complete fund data query question from the structured query language question and answer library based on the sorting result.

[0112] In an embodiment of the present invention, the structured query language question and answer database includes multiple SQL question and answer pairs, and each SQL question and answer pair includes a historical fund data query question and a historical fund data query statement corresponding to the historical fund data query question.

[0113] For example, the data format in the SQL question-answer pair may be as follows:

[0114] {"question":*What is the fund's management fee? ,

[0115] "sql": SELECT management fee FROM database WHERE NAME = *}.

[0116] Among them, question represents the historical fund data query question, and sql represents the historical fund data query statement.

[0117] It should be noted that the larger the cosine similarity, the more similar the historical fund data query problem is to the complete fund data query problem, and the smaller the cosine similarity, the less similar the historical fund data query problem is to the complete fund data query problem.

[0118] Exemplarily, the complete fund data query question can be vectorized through the embedding model to obtain the feature vector corresponding to the complete fund data query question; each historical fund data query question in the structured query language question and answer library can be vectorized through the embedding model to obtain the feature vector corresponding to each historical fund data query question; based on the feature vector corresponding to the complete fund data query question and the feature vector corresponding to each historical fund data query question, the cosine similarity between each historical fund data query question and the complete fund data query question is determined; further, according to the cosine similarity between each historical fund data query question and the complete fund data query question, the historical fund data query statements in the structured query language question and answer library can be sorted in descending order; the top N historical fund data query statements in the sorting are taken as fund data query statements similar to the complete fund data query question.

[0119] In the embodiment of the present invention, the query statement generation prompt word refers to reference information that guides the large language model to output the SQL query statement.

[0120] Exemplarily, the query statement generation prompt word may be:

[0121] {"prompt":

[0122] """

[0123] Generate data query statements based on the reference examples.

[0124] Example:

[0125] Questions: *What is the fund's management fee?

[0126] sql: SELECT management fee FROM database WHERE NAME = *;

[0127] current input:{What is the management fee of Fund A?}

[0128] Your response:"""}.

[0129] Among them, current input represents a complete fund data query problem. Further, the query statement generation prompt words are input into the large language model to obtain a data query statement corresponding to the complete fund data query problem: SELECT management fee FROM database WHERE NAME=A.

[0130] The technical solution of the embodiment of the present invention obtains fund data query sentences similar to the complete fund data query question, and then assembles the fund data query sentences similar to the complete fund data query question and the complete fund data query question to obtain query sentence generation prompt words, and then inputs the query sentence generation prompt words into the large language model, thereby effectively improving the accuracy and reliability of data query sentences.

[0131] Embodiment 5

[0132] Figure 5 This is a flow chart of a fund data query method provided in Embodiment 5 of the present invention. The method in this embodiment is a preferred example of the above embodiments. Figure 5 As shown, the method includes:

[0133] Step 1: The user enters the fund data query question in the dialog box.

[0134] Step 2: Identify the intent category of the input fund data query question, and identify the intent categories corresponding to multiple historical dialogue information.

[0135] Step 3: Perform integrity check on the fund data query question. If the fund data query question is incomplete, execute step 4; if the fund data query question is complete, execute step 6.

[0136] Step 4: If the historical conversation information is the same as the intent category of the fund data query question, execute step 5; otherwise, prompt the user to complete the fund data query question.

[0137] Step 5: Modify the fund data query question according to the historical conversation information to obtain a complete fund data query question.

[0138] Step 6: Perform semantic similarity retrieval on the complete fund data query question in the structured query language question-answering database to obtain fund data query statements similar to the complete fund data query question.

[0139] Step 7: Assemble the fund data query statement similar to the complete fund data query question and the complete fund data query question to obtain the query statement generation prompt word, and then input the query statement generation prompt word into the large language model to obtain the data query statement (i.e., SQL query statement) corresponding to the complete fund data query question.

[0140] Step 8: Query the fund product database based on the SQL query statement to obtain the fund data query result.

[0141] Step 9: Assemble the fund data query question and the fund data query result to obtain the question and answer result prompt word.

[0142] Step 10: Input the prompt words of the question and answer result into the large language model to obtain the answer result corresponding to the fund data query question.

[0143] Step 11: Return and display the answer results corresponding to the fund data query questions in the dialog box.

[0144] The technical solution of the embodiment of the present invention improves the accuracy of the fund data query question and further improves the accuracy of the fund data query result by modifying the fund data query question, and further improves the quality of the prompt words generated by the query statement through semantic similarity retrieval, thereby improving the accuracy of the SQL query statement and further improving the accuracy of the fund data query result.

[0145] Embodiment 6

[0146] Figure 6 This is a schematic diagram of the structure of a fund data query device provided by Embodiment 6 of the present invention. Figure 6 As shown, the device comprises:

[0147] The fund data query question determination module 610 is used to determine whether the fund data query question is complete in response to the fund data query question input by the user;

[0148] A fund data query question modification module 620 is used to obtain historical dialogue information when the fund data query question is incomplete, and modify the fund data query question based on the historical dialogue information to obtain a complete fund data query question;

[0149] The structured query language conversion module 630 is used to convert the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question;

[0150] The data query statement query module 640 is used to execute the data query statement corresponding to the complete fund data query question to obtain the fund data query result corresponding to the fund data query question.

[0151] The technical solution of the embodiment of the present invention determines whether the fund data query question is complete by responding to the fund data query question input by the user. If the fund data query question is incomplete, historical dialogue information is obtained, and then the fund data query question is modified based on the historical dialogue information to obtain a complete fund data query question, and the complete fund data query question is converted into a structured query language to obtain a data query statement corresponding to the complete fund data query question, and the data query statement corresponding to the complete fund data query question is executed to obtain a fund data query result corresponding to the fund data query question. The above technical solution makes the fund data query question complete by modifying the fund data query question, thereby improving the accuracy of the fund data query question, and then improving the accuracy of the fund data query result.

[0152] In some optional implementations, the fund data query problem determination module 610 includes:

[0153] A question intention category prediction unit, used for inputting the fund data query question into a large language model to obtain the intention category of the fund data query question;

[0154] The query question completeness judgment unit is used to judge whether the fund data query question is complete based on the intention category of the fund data query question.

[0155] In some optional implementations, the query question completeness determination unit may also be used to:

[0156] In the case where the fund data query question is a fund product information query intention category, determining whether the fund data query question includes a fund name and a queried fund field; if the fund name and / or the queried fund field is missing, the fund data query question is incomplete;

[0157] In the case where the fund data query question is a fund company information query intention category, determining whether the fund data query question includes the fund company name and the queried fund field; if the fund company name and / or the queried fund field are missing, the fund data query question is incomplete;

[0158] In the case where the fund data query question is a fund manager information query intention category, determining whether the fund data query question includes the fund manager name and the queried fund field; if the fund manager name and / or the queried fund field are missing, the fund data query question is incomplete;

[0159] In the case where the fund data query question is intended to filter data categories according to specified conditions, it is determined whether the fund data query question contains filtering fields and filtering conditions. If the filtering fields and / or filtering conditions are missing, the fund data query question is incomplete.

[0160] In some optional implementations, the fund data query question modification module 620 includes:

[0161] a question completion prompt word generating unit, configured to generate question completion prompt words based on the historical dialogue information and the fund data query question when the historical dialogue information and the fund data query question have the same intention category;

[0162] The fund data query question improvement unit is used to input the question improvement prompt words into the large language model to obtain a complete fund data query question.

[0163] In some optional implementations, the structured query language conversion module 630 includes:

[0164] A similar query statement acquisition unit, used to acquire a fund data query statement similar to the complete fund data query question;

[0165] A query statement generation prompt word assembling unit, used to assemble a fund data query statement similar to the complete fund data query question and the complete fund data query question to obtain a query statement generation prompt word;

[0166] The data query statement prediction unit is used to input the query statement generation prompt word into the large language model to obtain the data query statement corresponding to the complete fund data query question.

[0167] In some optional implementations, the similar query statement obtaining unit may also be used to:

[0168] Performing a vectorization operation on the complete fund data query problem to obtain a feature vector corresponding to the complete fund data query problem;

[0169] Perform vectorization operations on each historical fund data query question in the structured query language question-answering database to obtain feature vectors corresponding to each historical fund data query question;

[0170] Determine the cosine similarity between each historical fund data query question and the complete fund data query question based on the feature vector corresponding to the complete fund data query question and the feature vectors corresponding to each historical fund data query question;

[0171] Based on the cosine similarity between each historical fund data query question and the complete fund data query question, sorting the historical fund data query statements in the structured query language question-answering database;

[0172] Based on the ranking results, a fund data query statement similar to the complete fund data query question is obtained from the structured query language question and answer library.

[0173] In some optional implementations, the fund data query device further includes:

[0174] A question and answer result prompt word generation module, used for assembling the fund data query question and the fund data query result to obtain a question and answer result prompt word;

[0175] The answer result generation module is used to input the question and answer result prompt words into the large language model to obtain the answer result corresponding to the fund data query question.

[0176] The fund data query device provided in the embodiment of the present invention can execute the fund data query method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0177] Embodiment 7

[0178] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0179] like Figure 7As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The I / O interface 15 is also connected to the bus 14.

[0180] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0181] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a fund data query method, which includes:

[0182] In response to a fund data query question input by a user, determining whether the fund data query question is complete;

[0183] In the case where the fund data query question is incomplete, obtaining historical dialogue information, and modifying the fund data query question based on the historical dialogue information to obtain a complete fund data query question;

[0184] Converting the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question;

[0185] The data query statement corresponding to the complete fund data query question is executed to obtain the fund data query result corresponding to the fund data query question.

[0186] In some embodiments, the fund data query method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the fund data query method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the fund data query method in any other appropriate manner (e.g., by means of firmware).

[0187] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0188] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0189] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0190] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0191] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0192] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0193] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0194] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A fund data query method, characterized in that: include: In response to a fund data query question input by a user, determining whether the fund data query question is complete; In the case where the fund data query question is incomplete, obtaining historical dialogue information, and modifying the fund data query question based on the historical dialogue information to obtain a complete fund data query question; Converting the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question; The data query statement corresponding to the complete fund data query question is executed to obtain the fund data query result corresponding to the fund data query question.

2. The method according to claim 1, characterized in that The determining whether the fund data query question is complete includes: Inputting the fund data query question into a large language model to obtain the intent category of the fund data query question; Whether the fund data query question is complete is determined based on the intent category of the fund data query question.

3. The method according to claim 2, characterized in that The determining whether the fund data query question is complete based on the intent category of the fund data query question includes: In the case where the fund data query question is a fund product information query intention category, determining whether the fund data query question includes a fund name and a queried fund field; if the fund name and / or the queried fund field is missing, the fund data query question is incomplete; In the case where the fund data query question is a fund company information query intention category, determining whether the fund data query question includes the fund company name and the queried fund field; if the fund company name and / or the queried fund field are missing, the fund data query question is incomplete; In the case where the fund data query question is a fund manager information query intention category, determining whether the fund data query question includes the fund manager name and the queried fund field; if the fund manager name and / or the queried fund field are missing, the fund data query question is incomplete; In the case where the fund data query question is intended to filter data categories according to specified conditions, it is determined whether the fund data query question contains filtering fields and filtering conditions. If the filtering fields and / or filtering conditions are missing, the fund data query question is incomplete.

4. The method according to claim 1, characterized in that The fund data query question is modified based on the historical dialogue information to obtain a complete fund data query question, including: In the case where the historical dialogue information and the fund data query question have the same intent category, generating a question completion prompt word based on the historical dialogue information and the fund data query question; The question completion prompt words are input into the large language model to obtain a complete fund data query question.

5. The method according to claim 1, characterized in that The converting the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question includes: Obtain a fund data query statement similar to the complete fund data query question; Assembling a fund data query statement similar to the complete fund data query question and the complete fund data query question to obtain a query statement generation prompt word; The query statement generation prompt word is input into the large language model to obtain the data query statement corresponding to the complete fund data query question.

6. The method according to claim 5, characterized in that The obtaining of a fund data query statement similar to the complete fund data query question includes: Performing a vectorization operation on the complete fund data query problem to obtain a feature vector corresponding to the complete fund data query problem; Perform vectorization operations on each historical fund data query question in the structured query language question-answering database to obtain feature vectors corresponding to each historical fund data query question; Determine the cosine similarity between each historical fund data query question and the complete fund data query question based on the feature vector corresponding to the complete fund data query question and the feature vectors corresponding to each historical fund data query question; Based on the cosine similarity between each historical fund data query question and the complete fund data query question, sorting the historical fund data query statements in the structured query language question-answering database; Based on the ranking results, a fund data query statement similar to the complete fund data query question is obtained from the structured query language question and answer library.

7. The method according to any one of claims 1 to 6, characterized in that: After executing the data query statement corresponding to the complete fund data query question and obtaining the fund data query result corresponding to the fund data query question, the method further includes: Assembling the fund data query question and the fund data query result to obtain a question and answer result prompt word; The question and answer result prompt words are input into the large language model to obtain the answer result corresponding to the fund data query question.

8. A fund data query device, characterized in that: include: A fund data query question judgment module, used to respond to the fund data query question input by the user and judge whether the fund data query question is complete; A fund data query question modification module, used for obtaining historical dialogue information when the fund data query question is incomplete, and modifying the fund data query question based on the historical dialogue information to obtain a complete fund data query question; A structured query language conversion module, used to convert the complete fund data query question into a structured query language to obtain a data query statement corresponding to the complete fund data query question; The data query statement query module is used to execute the data query statement corresponding to the complete fund data query question to obtain the fund data query result corresponding to the fund data query question.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; Wherein, the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the fund data query method described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the fund data query method according to any one of claims 1 to 7 when executed.