Financial product query method, device and equipment and storage medium
By using a large language model, user-input financial product query questions are transformed into filtering conditions and sorting rules, solving the problem of high complexity in understanding user intent in traditional models. This improves the accuracy and efficiency of financial product queries and provides professional analytical assistance and in-depth insights.
Patent Information
- Application Number
- CN202511702618.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-02-27
AI Technical Summary
In the field of investment research, after users input query parameters, traditional models have high complexity in understanding user intent and generating query statements, and there are problems such as insufficient user understanding or ambiguity leading to incorrect query statements and weak complex query capabilities.
By using a large language model, the financial product query questions input by users are transformed into filtering conditions and sorting rules. Then, NL2SQL technology is used to transform them into filtering query objects and sorting query objects, generating accurate query statements for financial product queries.
It improves the accuracy and efficiency of financial product inquiries, enabling accurate and effective searches for financial products and providing professional analytical support and in-depth insights.
Smart Images

Figure CN121579549A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of investment research technology, and in particular to a method, apparatus, device and storage medium for querying financial products. Background Technology
[0002] In the field of investment research, after a user inputs query parameters, the system usually relies on traditional models to understand the user's intent and generate query statements, which is highly complex. In addition, there are problems such as generating incorrect query statements due to insufficient understanding or ambiguity by the user, and weak ability to handle complex queries. Summary of the Invention
[0003] The main purpose of this application is to provide a method, apparatus, device and storage medium for querying financial products, aiming to solve the technical problem of how to accurately and effectively query financial products.
[0004] To achieve the above objectives, this application provides a method for querying financial products, which includes the following steps: Based on the filtering intent category corresponding to the financial product query question entered by the user, the financial product query question is converted into filtering conditions and sorting rules; The filtering conditions are converted into filtering query objects, and the sorting rules are converted into sorting query objects; A query statement is generated based on the filtered query objects and the sorted query objects, and a financial product query is performed based on the query statement.
[0005] Optionally, the step of converting the financial product query question into filtering conditions and sorting rules based on the filtering intent category corresponding to the user's input financial product query question includes: Determine the descriptions of the filtering and sorting tools based on the preset product database; The user inputs a financial product query question, the corresponding filtering intent category for the financial product query question, and the description of the filtering tool, which are then input into the large language model to obtain the filtering conditions. The financial product query question, the filtering intent category, and the ranking tool description are input into the large language model to obtain the ranking rules.
[0006] Optionally, determining the filtering tool description and sorting tool description based on a preset product database includes: Determine the data format information based on the preset product database; The description of the filtering tool is determined based on the preset filtering format and the data format information. The preset filtering format includes: filtering fields, filtering relationships, and filtering values. The sorting tool description is determined according to a preset sorting format, which includes: sorting field, sorting order, and sorting quantity.
[0007] Optionally, converting the filtering conditions into filtering query objects and the sorting rules into sorting query objects includes: The filter fields, filter relationships, and filter values in the filter conditions are transformed to obtain the filter query object; Determine whether the sorting rule is empty, and obtain the determination result; Based on the judgment result, the sorting rule is transformed to obtain the sorted query object.
[0008] Optionally, the step of transforming the filter fields, filter relationships, and filter values in the filter conditions to obtain the filter query object includes: Perform a correctness check on the filter fields in the filter conditions to obtain the correctness check result; The selected values are validated for legality to obtain the validation results. If both the correctness and legality verification results are passed, the filtering conditions are converted into filtering query objects.
[0009] Optionally, the step of transforming the sorting rule based on the judgment result to obtain the sorted query object includes: If the judgment result indicates that the sorting rule is empty, the sorting field is determined according to the filtering conditions; If the sorting field is empty, the sorting rule is transformed based on the default sorting field, the preset sorting condition, and the preset sorting quantity to obtain the sorting query object; If the judgment result is that the sorting rule is not empty, check whether the sorting field in the sorting rule can be sorted; If so, the sorting rule is transformed based on the preset sorting conditions and the preset sorting quantity to obtain the sorted query object.
[0010] Optionally, before converting the financial product query question into filtering conditions and sorting rules based on the filtering intent category corresponding to the user's input financial product query question, the method further includes: The length of the historical dialogue context corresponding to the financial product query entered by the user is compared with a preset threshold to obtain the comparison result; If the comparison result indicates that the length of the historical dialogue context is greater than the preset threshold, the financial product query question is rewritten using a large language model to obtain the rewritten question. The modified question is identified using the large language model to obtain the filtering intent category; If the comparison result indicates that the length of the historical dialogue context is less than or equal to the preset threshold, the financial product query question is identified using the large language model to obtain the filtering intent category.
[0011] Furthermore, to achieve the above objectives, this application also provides a financial product inquiry device, the financial product inquiry device comprising: The question conversion module is used to convert the financial product query question into filtering conditions and sorting rules according to the filtering intent category corresponding to the user's input financial product query question; The rule conversion module is used to convert the filtering conditions into filtering query objects and the sorting rules into sorting query objects; The product query module is used to generate query statements based on the filtered query objects and the sorted query objects, and to perform financial product queries based on the query statements.
[0012] In addition, to achieve the above objectives, this application also proposes a financial product query device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the financial product query method described above.
[0013] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the financial product query method described above.
[0014] This application converts the user's input financial product query question into filtering conditions and sorting rules based on the filtering intent category corresponding to the query question. Then, the filtering conditions are converted into filtering query objects, and the sorting rules are converted into sorting query objects. Finally, a query statement is generated based on the filtering and sorting query objects, and financial product queries are performed based on the query statement. This application first converts the user's input financial product query question into filtering conditions and sorting rules, abstracting the user's question into filtering conditions and sorting rules, thus improving the accuracy of filtering condition identification. Then, a query statement is generated based on the converted filtering and sorting query objects, enabling accurate and effective financial product queries. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the first embodiment of the financial product inquiry method of this application; Figure 2 This is a schematic diagram of the filtering intent recognition process in one embodiment of the financial product query method of this application; Figure 3 This is a schematic diagram of the financial product search process according to an embodiment of the financial product search method of this application; Figure 4 This is a flowchart illustrating the second embodiment of the financial product query method of this application; Figure 5 This is a flowchart illustrating the process of obtaining filtering conditions and sorting rules in one embodiment of the financial product query method of this application. Figure 6 This is a flowchart illustrating the third embodiment of the financial product inquiry method of this application; Figure 7 This is a schematic diagram illustrating the process of determining and sorting query objects in an embodiment of the financial product query method of this application. Figure 8 This is a structural block diagram of the first embodiment of the financial product query device of this application; Figure 9 This is a schematic diagram of the structure of a financial product query device in the hardware operating environment involved in the embodiments of this application.
[0018] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0019] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0020] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0021] The main solution of this application embodiment is: converting the financial product query question into filtering conditions and sorting rules according to the filtering intent category corresponding to the user's input financial product query question; converting the filtering conditions into filtering query objects and the sorting rules into sorting query objects; generating a query statement based on the filtering query objects and the sorting query objects, and performing financial product queries based on the query statement.
[0022] In the field of investment research, after a user inputs query parameters, the system usually relies on traditional models to understand the user's intent and generate query statements, which is highly complex. In addition, there are problems such as generating incorrect query statements due to insufficient understanding or ambiguity by the user, and weak ability to handle complex queries.
[0023] This application converts the user's input financial product query question into filtering conditions and sorting rules based on the filtering intent category corresponding to the query question. Then, the filtering conditions are converted into filtering query objects, and the sorting rules are converted into sorting query objects. Finally, a query statement is generated based on the filtering and sorting query objects, and financial product queries are performed based on the query statement. This application first converts the user's input financial product query question into filtering conditions and sorting rules, abstracting the user's question into filtering conditions and sorting rules, thus improving the accuracy of filtering condition identification. Then, a query statement is generated based on the converted filtering and sorting query objects, enabling accurate and effective financial product queries.
[0024] It should be noted that the executing entity of this application can be a computing service device with data processing, network communication and program execution functions, such as a computer.
[0025] Based on this, the embodiments of this application provide a method for querying financial products, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the financial product query method of this application.
[0026] In this embodiment, the financial product query method includes the following steps: Step S10: Convert the financial product query question into filtering conditions and sorting rules according to the filtering intent category corresponding to the user's input financial product query question.
[0027] Understandably, in the investment research field, users can input financial product query questions into the big data model, such as "What are the funds with relatively high returns in XX Bank?" Inputting financial product query questions into the big data model can yield corresponding filtering intent categories, such as public fund filtering, wealth management filtering, private equity product filtering, etc.
[0028] In the specific implementation, the financial product query can be converted into filtering conditions filter_criteria_list and sorting rules order_request based on the filtering intent category. The filtering conditions may include basic information of financial products, return and risk indicators, holding analysis indicators, product tags, etc., and the sorting rules may be sorted by return rate from largest to smallest.
[0029] Furthermore, to quickly obtain the filtering intent category, in this embodiment, before step S10, the method further includes: comparing the length of the historical dialogue context corresponding to the user-input financial product query question with a preset threshold to obtain a comparison result; if the comparison result is that the length of the historical dialogue context is greater than the preset threshold, rewriting the financial product query question using a large language model to obtain a rewritten question; identifying the rewritten question using the large language model to obtain a filtering intent category; and if the comparison result is that the length of the historical dialogue context is less than or equal to the preset threshold, identifying the financial product query question using the large language model to obtain a filtering intent category.
[0030] Understandably, this embodiment can combine the user's current financial product query question with their historical dialogue context information to perform coarse-grained question category identification for financial product query questions, aiming to quickly define the scope of the user's core needs.
[0031] It should be understood that, referring to Figure 2 , Figure 2 This is a schematic diagram illustrating the filtering intent recognition process of one embodiment of the financial product query method of this application, as shown below. Figure 2 As shown, the historical dialogue context corresponding to the user's input financial product query can be extracted from the persistent memory of the large language model. When the information is too lengthy or contains a lot of irrelevant details, the length of the historical dialogue context will exceed a preset threshold. To ensure classification efficiency and accuracy, the financial product query can be rewritten using the large language model LLM. For example, the core requirements can be extracted, and repetitive or secondary information can be ignored. The rewritten query is then identified by the large language model LLM to obtain the filtering intent category, which includes, but is not limited to, the following categories: public fund filtering, wealth management filtering, and private equity product filtering. When the length of the historical dialogue context is less than or equal to the preset threshold, the original financial product query and the historical dialogue context can be input into the large language model to obtain the filtering intent category.
[0032] Step S20: Convert the filtering conditions into filtering query objects and the sorting rules into sorting query objects.
[0033] Understandably, NL2SQL (Natural Language to SQL) is an artificial intelligence technology that uses natural language processing to convert users' spoken questions into executable SQL query statements. Compared to this technology, the large language model itself has a higher accuracy in tool call capabilities. Therefore, this embodiment abandons the traditional NL2SQL approach and uses the large language model to abstract the financial product query questions entered by users into filtering and sorting query objects.
[0034] Step S30: Generate a query statement based on the filtered query objects and the sorted query objects, and perform a financial product query based on the query statement.
[0035] It should be understood that ES query SQL statements can be constructed based on the filtered and sorted query objects, and financial product queries can be performed based on the query statements.
[0036] Understandably, the expert thought chain is a high-level reasoning framework that simulates in-depth, systematic, and critical thinking by experts. It goes beyond simple step-by-step demonstrations, emphasizing structured decomposition, multi-perspective analysis, in-depth application of domain knowledge, and systematic consideration of uncertainty and alternative solutions. It is primarily used to enhance the credibility of artificial intelligence models (especially large language models) on complex problems and to provide users with more professional analytical assistance. This embodiment, based on a financial product comparison and interpretation scenario, designs an expert thought chain framework that includes elements such as scenario expert knowledge, comparison and interpretation approaches, and expression requirements, along with supporting online debugging, optimization, and management infrastructure for the expert thought chain.
[0037] In the specific implementation, refer to Figure 3 , Figure 3 This is a schematic diagram of the financial product search process according to an embodiment of the financial product search method of this application, as shown below. Figure 3 As shown, this embodiment uses the products and product information selected in the previous step, i.e., the query statement, to obtain an expert thinking chain framework in real time based on the subdivided product types. This framework is created / modified by the thinking chain, and then debugged and stored in the database. It constructs prompts and, based on the original financial product query question, generates compliant analysis results through a large language model (LLM). The answers not only cover a comprehensive comparative analysis of product data but also incorporate in-depth insights and professional advice. Compared to simply listing and selecting products, the above method in this embodiment fully demonstrates the system's deep analytical capabilities in the field of financial question answering.
[0038] This embodiment converts the user's input financial product query question into filtering conditions and sorting rules based on the filtering intent category corresponding to the query question. Then, the filtering conditions are converted into filtering query objects, and the sorting rules are converted into sorting query objects. Finally, a query statement is generated based on the filtering and sorting query objects, and a financial product query is performed based on the query statement. This embodiment first converts the user's input financial product query question into filtering conditions and sorting rules, abstracting the user's question into filtering conditions and sorting rules, improving the accuracy of filtering condition identification. Then, a query statement is generated based on the converted filtering and sorting query objects, thereby enabling accurate and effective financial product queries.
[0039] refer to Figure 4 , Figure 4 This is a flowchart illustrating the second embodiment of the financial product query method of this application.
[0040] Based on the first embodiment described above, in this embodiment, step S10 includes: Step S101: Determine the description of the filtering tool and the sorting tool based on the preset product database.
[0041] Understandably, the preset product database may include a pre-set library containing product data, such as basic product information, profit and risk data, etc. Based on the preset product database, descriptions for filtering and sorting tools can be determined. The filtering tool description may include information such as data formats related to filtering criteria, and the sorting tool description may include information such as data formats related to sorting.
[0042] Furthermore, in order to accurately obtain the descriptions of the filtering tool and the sorting tool, in this embodiment, step S101 includes: determining data format information based on a preset product database; determining the description of the filtering tool based on a preset filtering format and the data format information, wherein the preset filtering format includes: filtering fields, filtering relationships, and filtering values; and determining the description of the sorting tool based on a preset sorting format, wherein the preset sorting format includes: sorting fields, sorting order, and sorting quantity.
[0043] It should be understood that the data format information can be determined based on the preset product database. Elasticsearch's schema typically includes index mappings, which contain field names, data types, and possibly other attributes (such as whether they are indexed or stored). In filtering scenarios, we don't need all the details, only key information, such as field names and data types (and possible relationships, such as nested objects or parent-child relationships). To reduce prompt length, allow for model fine-tuning on a single GPU, and improve inference speed, the schema mapping information is compressed into a key / value pair of Strings without affecting model accuracy.
[0044] Understandably, the preset filter format and data format information can be used as the filter tool description `filter_criteria_list`. The preset filter format means that the `filter_criteria_list` parameter is in JSON list format, where each `filter_criteria` is in the format: `{{"field":"","op":"","values":[]}}`, where `field` represents the filter field, `op` represents the filter relationship, and `values` represents the filter value. The LLM is used to extract the filter conditions from the problem, and appropriate fields are selected according to the Elasticsearch schema information to generate the filter parameters. In the tool description information, the model can be constrained to recognize parameters according to the following requirements: If necessary, please pay attention to the conversion of percentages (%) to decimal types, and convert Chinese characters to decimals, for example, convert 20% and 20% to 0.2; the filter relationship field `op` must be strictly selected from `in`, `all_match`, and `closed_between`; `in`: indicates that the values listed in `values` only need to satisfy one of these conditions, and it is an OR operation. all_match: indicates that all options listed in values must be satisfied simultaneously, which is an AND operation; closed_between: indicates that the value is within the range represented by value. If the upper or lower limit is not explicitly specified, it will be null.
[0045] In the specific implementation, the sorting tool description `order_request` can be determined according to the preset sorting format, including the sorting field `orderby`, the sorting order `order`, and the number of sorts `num`. The preset sorting format is: `{"orderby":"","order":"","num":""}`. `orderby` is filled with the corresponding field, `order` is filled with either `asc` or `desc`, and `num` is the number of sorts; if empty, it is null.
[0046] Step S102: Input the user's financial product query question, the filtering intent category corresponding to the financial product query question, and the description of the filtering tool into the large language model to obtain the filtering conditions.
[0047] Understandably, referring to Figure 5 , Figure 5 This is a flowchart illustrating the process of obtaining filtering conditions and sorting rules in one embodiment of the financial product query method of this application, as shown below. Figure 5 As shown, the tool description for identifying filtering criteria can include the `filter_criteria_list` parameter and the `order_request` parameter, i.e., the filtering tool description and the sorting tool description. To obtain the filtering tool description, it is also necessary to consider: 1. Elasticsearch schema information; 2. Supplementary explanations of field information; 3. Extraction rules for filtering criteria, etc. The user-input financial product query question, filtering intent category, and filtering tool description are input into the Large Language Model (LLM) to obtain the filtering criteria. Annotated corpora can also be input into the Large Language Model (LLM) for supervised fine-tuning of instructions.
[0048] Step S103: Input the financial product query question, the filtering intent category, and the ranking tool description into the large language model to obtain the ranking rules.
[0049] It should be understood that, as Figure 5 As shown, the financial product query question, filtering intent category, and ranking tool description can be input into the Large Language Model (LLM). This involves inputting the user's question and the `order_request` parameter into the LLM to obtain the ranking rules. For example, a user's financial product query question might be: "The top five mutual funds with high returns and heavy holdings in ×× Bank." This can be parameterized as: `{ "filter_criteria_list": [ { "field": "heavy_stock", "op": "in", "values": ["×× Bank"]} ], "order_request": { "orderby": "y1_return", "order": "desc", "num": 5}}`, which includes the filtering criteria and ranking rules.
[0050] This embodiment determines the descriptions of filtering and ranking tools based on a preset product database. Then, it inputs the user's financial product query question, the corresponding filtering intent category, and the filtering tool description into a large language model to obtain filtering conditions. Next, it inputs the financial product query question, the filtering intent category, and the ranking tool description into the large language model to obtain ranking rules. This embodiment improves the accuracy of filtering condition recognition by inputting the user's financial product query question, filtering intent category, filtering tool description, and ranking tool description into the large language model.
[0051] refer to Figure 6 , Figure 6 This is a flowchart illustrating the third embodiment of the financial product query method of this application.
[0052] Based on the above embodiments, in this embodiment, step S20 includes: Step S201: Transform the filter fields, filter relationships, and filter values in the filter conditions to obtain the filter query object.
[0053] Furthermore, in order to accurately obtain the target query object, in this embodiment, step S201 includes: performing a correctness check on the filter field in the filter condition to obtain a correctness check result; performing a validity check on the filter value to obtain a validity check result; and, if the correctness check result is valid and the validity check result is valid, converting the filter condition into a target query object.
[0054] Understandably, for the filtering conditions identified by the large language model, a verification and error-tolerance mechanism can be implemented. Specifically, the correctness of the filtering fields can be verified first, and a correctness verification result can be obtained. In one feasible embodiment, the filtering fields are compared with fields in a preset database. If the filtering field exists in the preset database, the correctness verification is considered successful. Then, the validity of the filtering values is verified, and a validity verification result can be obtained. In one feasible embodiment, it can be determined whether the filtering value is within the range specified by the filtering fields. If so, the validity verification is considered successful. In addition, the filtering values can also be processed by converting abbreviations to full names and correcting typos.
[0055] In the specific implementation, if both the correctness and validity checks pass, the filtering conditions are transformed into filtering query objects. In one feasible embodiment, for each `filter_criteria`, different filtering query objects are constructed based on the filtering relation (op), the filtering field (field), and the filtering values (values). For example, when the filtering relation is 'in', the filtering condition is transformed into a Terms query object, indicating that the filtering field should match any value in the value list (equivalent to the IN operation in SQL). When the filtering relation is 'closed_between', the passed values are transformed into two valid boundary values, and then a Range query object is returned, indicating that the field's filtering value is between the closed interval [gte, lte] (i.e., greater than or equal to the first value and less than or equal to the second value). When the filtering relation is 'all_match', a Bool query object (combined query) is returned, containing multiple Term queries (one for each value), indicating that the filtering field must match all given values (equivalent to an AND combination).
[0056] Step S202: Determine whether the sorting rule is empty, and obtain the determination result.
[0057] It should be understood that for sorting rules identified by a large language model, it can be determined whether the sorting rule is empty. In one feasible embodiment, if any one of the sorting fields orderby, sorting order, and sorting quantity num in the sorting rule is empty, it can be determined that the sorting rule is empty.
[0058] Step S203: Based on the judgment result, the sorting rule is transformed to obtain the sorting query object.
[0059] Furthermore, in order to effectively convert the sorting rules, in this embodiment, step S203 includes: if the judgment result is that the sorting rule is empty, determining the sorting field according to the filtering conditions; if the sorting field is empty, converting the sorting rule based on the default sorting field, the preset sorting conditions, and the preset sorting quantity to obtain a sorted query object; if the judgment result is that the sorting rule is not empty, checking whether the sorting field in the sorting rule can be sorted; if so, converting the sorting rule based on the preset sorting conditions and the preset sorting quantity to obtain a sorted query object.
[0060] Understandably, referring to Figure 7 , Figure 7 This is a schematic diagram illustrating the process of determining and sorting query objects in an embodiment of the financial product query method of this application, as shown below. Figure 7As shown, for filtering conditions, the filtering fields can be validated first. After the validation passes, the value can be validated and the ES query can be used to complete the validation. Then, the filtering conditions can be converted into ES query condition objects, i.e., filtering query objects.
[0061] It should be understood that, as Figure 7 As shown, for sorting rules, we can first determine if the sorting rule is empty. If so, we can first determine the sorting field based on the filter conditions. Specifically, we can obtain the first sortable field of the filter conditions as the sorting field. We can first determine the sortable fields among the filter fields in the filter conditions, and then use the first sortable field as the sorting field. Next, we can determine if the sorting field is empty. If so, we can transform the sorting rule based on the default sorting field, preset sorting conditions, and preset sorting quantity to obtain the sorted query object. Specifically, we can manually set the default sorting field and add sorting conditions and the number of returned rows to the Elasticsearch query object. In addition, if the sorting rule is not empty, we can check whether the sorting field in the sorting rule can be sorted, that is, check whether the field is sortable. If so, we can transform the sorting rule based on the preset sorting conditions and preset sorting quantity to obtain the sorted query object. If not, we can obtain the first sortable field in the filter conditions as the sorting field and perform subsequent operations. Finally, we generate a query statement based on the transformed filter query object and sorted query object, that is, construct the Elasticsearch Query DSL and execute the query to obtain the query results corresponding to the financial product query question.
[0062] This embodiment transforms the filter fields, filter relationships, and filter values in the filter conditions to obtain the filter query object. Then, it determines whether the sorting rule is empty, obtains the judgment result, and transforms the sorting rule based on the judgment result to obtain the sorted query object. This embodiment improves the accuracy of subsequent query statement generation by transforming the filter conditions and sorting rules to obtain the filter query object and sorted query object respectively.
[0063] Reference Figure 8 , Figure 8 This is a structural block diagram of the first embodiment of the financial product query device of this application.
[0064] like Figure 8 As shown, the financial product query device proposed in this application includes: Question conversion module 10 is used to convert the financial product query question into filtering conditions and sorting rules according to the filtering intent category corresponding to the financial product query question entered by the user; Rule conversion module 20 is used to convert the filtering conditions into filtering query objects and the sorting rules into sorting query objects; The product query module 30 is used to generate a query statement based on the filtered query objects and the sorted query objects, and to perform financial product queries based on the query statement.
[0065] This embodiment converts the user's input financial product query question into filtering conditions and sorting rules based on the filtering intent category corresponding to the query question. Then, the filtering conditions are converted into filtering query objects, and the sorting rules are converted into sorting query objects. Finally, a query statement is generated based on the filtering and sorting query objects, and a financial product query is performed based on the query statement. This embodiment first converts the user's input financial product query question into filtering conditions and sorting rules, abstracting the user's question into filtering conditions and sorting rules, improving the accuracy of filtering condition identification. Then, a query statement is generated based on the converted filtering and sorting query objects, thereby enabling accurate and effective financial product queries.
[0066] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this application. In practical applications, those skilled in the art can select some or all of it to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0067] In addition, for technical details not described in detail in this embodiment, please refer to the financial product query method provided in any embodiment of this application, which will not be repeated here.
[0068] Based on the first embodiment of the financial product query device described in this application, a second embodiment of the financial product query device of this application is proposed.
[0069] In this embodiment, the question conversion module 10 is further configured to determine the description of the filtering tool and the description of the sorting tool based on a preset product database; input the financial product query question input by the user and the description of the filtering tool into a large language model to obtain filtering conditions; and input the financial product query question and the description of the sorting tool into the large language model to obtain sorting rules.
[0070] Furthermore, the problem conversion module 10 is also used to determine data format information based on a preset product database; determine a filtering tool description based on a preset filtering format and the data format information, wherein the preset filtering format includes: filtering fields, filtering relationships, and filtering values; and determine a sorting tool description based on a preset sorting format, wherein the preset sorting format includes: sorting fields, sorting order, and sorting quantity.
[0071] Furthermore, the rule conversion module 20 is also used to convert the filter fields, filter relationships and filter values in the filter conditions to obtain a filter query object; determine whether the sorting rule is empty and obtain a judgment result; and convert the sorting rule according to the judgment result to obtain a sort query object.
[0072] Furthermore, the rule conversion module 20 is also used to perform correctness verification on the filter field in the filter condition and obtain a correctness verification result; perform legality verification on the filter value and obtain a legality verification result; and, if the correctness verification result is passed and the legality verification result is passed, convert the filter condition into a filter query object.
[0073] Furthermore, the rule conversion module 20 is also used to determine the sorting field according to the filtering conditions when the judgment result is that the sorting rule is empty; if the sorting field is empty, the sorting rule is converted based on the default sorting field, the preset sorting conditions, and the preset sorting quantity to obtain a sorted query object; if the judgment result is that the sorting rule is not empty, the module checks whether the sorting field in the sorting rule can be sorted; if so, the sorting rule is converted based on the preset sorting conditions and the preset sorting quantity to obtain a sorted query object.
[0074] Furthermore, the question conversion module 10 is also used to compare the length of the historical dialogue context corresponding to the financial product query question input by the user with a preset threshold to obtain a comparison result; if the comparison result is that the length of the historical dialogue context is greater than the preset threshold, the financial product query question is rewritten using a large language model to obtain a rewritten question; the rewritten question is identified using the large language model to obtain a filtering intent category; if the comparison result is that the length of the historical dialogue context is less than or equal to the preset threshold, the financial product query question is identified using the large language model to obtain a filtering intent category.
[0075] Other embodiments or specific implementations of the financial product query device of this application can be found in the above-described method embodiments, and will not be repeated here.
[0076] This application provides a financial product query device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the financial product query method in the first embodiment described above.
[0077] The following is for reference. Figure 9The diagram illustrates a structural schematic of a financial product query device suitable for implementing embodiments of this application. The financial product query device in this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 9 The financial product inquiry device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0078] like Figure 9 As shown, the financial product query device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the financial product query device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the financial product inquiry device to communicate wirelessly or wiredly with other devices to exchange data. Although the figures show financial product inquiry devices with various systems, it should be understood that implementing or having all of the systems shown is not required. More or fewer systems may be implemented alternatively.
[0079] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0080] The financial product query device provided in this application, employing the financial product query method described in the above embodiments, can solve the technical problem of how to accurately and effectively query financial products. Compared with the prior art, the beneficial effects of the financial product query device provided in this application are the same as those of the financial product query method provided in the above embodiments, and other technical features of this financial product query device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0081] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0082] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0083] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the financial product query method in the above embodiments.
[0084] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0085] The aforementioned computer-readable storage medium may be included in the financial product query device; or it may exist independently and not be assembled into the financial product query device.
[0086] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a financial product query device, cause the financial product query device to: convert the financial product query question into filtering conditions and sorting rules according to the filtering intent category corresponding to the user-input financial product query question; convert the filtering conditions into filtering query objects and the sorting rules into sorting query objects; generate a query statement based on the filtering query objects and the sorting query objects, and perform a financial product query based on the query statement.
[0087] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. These programming languages include object-oriented programming languages—such as Python, Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0089] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0090] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described financial product query method, thereby solving the technical problem of how to accurately and effectively query financial products. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the financial product query method provided in the above embodiments, and will not be repeated here.
[0091] The above description is only a part of the embodiments of this application and does not limit the scope of protection of this application. All equivalent structural transformations made under the technical concept of this application and using the content of this application specification and drawings, or direct / indirect applications in other related technical fields, are included in the scope of protection of this application.
Claims
1. A method for querying financial products, characterized in that, The method for querying financial products includes the following steps: Based on the filtering intent category corresponding to the financial product query question entered by the user, the financial product query question is converted into filtering conditions and sorting rules; The filtering conditions are converted into filtering query objects, and the sorting rules are converted into sorting query objects; A query statement is generated based on the filtered query objects and the sorted query objects, and a financial product query is performed based on the query statement.
2. The financial product inquiry method as described in claim 1, characterized in that, The step of converting the financial product query question into filtering conditions and sorting rules based on the filtering intent category corresponding to the user's input financial product query question includes: Determine the descriptions of the filtering and sorting tools based on the preset product database; The user inputs a financial product query question, the corresponding filtering intent category for the financial product query question, and the description of the filtering tool, which are then input into the large language model to obtain the filtering conditions. The financial product query question, the filtering intent category, and the ranking tool description are input into the large language model to obtain the ranking rules.
3. The financial product inquiry method as described in claim 2, characterized in that, The step of determining the filtering tool description and sorting tool description based on the preset product database includes: Determine the data format information based on the preset product database; The description of the filtering tool is determined based on the preset filtering format and the data format information. The preset filtering format includes: filtering fields, filtering relationships, and filtering values. The sorting tool description is determined according to a preset sorting format, which includes: sorting field, sorting order, and sorting quantity.
4. The financial product inquiry method as described in claim 1, characterized in that, The step of converting the filtering conditions into filtering query objects and the sorting rules into sorting query objects includes: The filter fields, filter relationships, and filter values in the filter conditions are transformed to obtain the filter query object; Determine whether the sorting rule is empty, and obtain the determination result; Based on the judgment result, the sorting rule is transformed to obtain the sorted query object.
5. The financial product inquiry method as described in claim 4, characterized in that, The process of transforming the filter fields, filter relationships, and filter values in the filter conditions to obtain the filter query object includes: Perform a correctness check on the filter fields in the filter conditions to obtain the correctness check result; The selected values are validated for legality to obtain the validation results. If both the correctness and legality verification results are passed, the filtering conditions are converted into filtering query objects.
6. The financial product inquiry method as described in claim 4, characterized in that, The step of transforming the sorting rule based on the judgment result to obtain the sorted query object includes: If the judgment result indicates that the sorting rule is empty, the sorting field is determined according to the filtering conditions; If the sorting field is empty, the sorting rule is transformed based on the default sorting field, the preset sorting condition, and the preset sorting quantity to obtain the sorting query object; If the judgment result is that the sorting rule is not empty, check whether the sorting field in the sorting rule can be sorted; If so, the sorting rule is transformed based on the preset sorting conditions and the preset sorting quantity to obtain the sorted query object.
7. The financial product inquiry method as described in any one of claims 1 to 6, characterized in that, Before converting the financial product query question into filtering conditions and sorting rules based on the filtering intent category corresponding to the user's input financial product query question, the method further includes: The length of the historical dialogue context corresponding to the financial product query entered by the user is compared with a preset threshold to obtain the comparison result; If the comparison result indicates that the length of the historical dialogue context is greater than the preset threshold, the financial product query question is rewritten using a large language model to obtain the rewritten question. The modified question is identified using the large language model to obtain the filtering intent category; If the comparison result indicates that the length of the historical dialogue context is less than or equal to the preset threshold, the financial product query question is identified using the large language model to obtain the filtering intent category.
8. A financial product inquiry device, characterized in that, The financial product inquiry device includes: The question conversion module is used to convert the financial product query question into filtering conditions and sorting rules according to the filtering intent category corresponding to the user's input financial product query question; The rule conversion module is used to convert the filtering conditions into filtering query objects and the sorting rules into sorting query objects; The product query module is used to generate query statements based on the filtered query objects and the sorted query objects, and to perform financial product queries based on the query statements.
9. A financial product inquiry device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the financial product query method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the financial product query method as described in any one of claims 1 to 7.