Financial index query method and device, computer equipment and medium

By disassembling the financial indicator query task and processing it using natural language processing and large language models, identifying the target association relationship and matching interfaces, the problem of low accuracy of financial indicator query is solved, and more accurate query results are achieved.

CN119988455APending Publication Date: 2025-05-13E FUND MANAGEMENT CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510003288.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the prior art, the accuracy of financial indicator query is low, especially when identifying the target and indicator name to be queried, which leads to inaccurate query results.

Method used

By dismantling the financial indicator query task into indicator recall task, target subject recall task and target association recognition task, natural language processing and large language model are used for task processing, identify target association relationship and interface matching, and finally splicing interface messages for interface calls to obtain query results.

Benefits of technology

It improves the accuracy of financial indicator query, can more accurately obtain the target subject, indicator and call interface, and accurately identify the associated target through the target association relationship identification, thereby improving the reliability of query results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988455A_ABST
    Figure CN119988455A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and discloses a financial index query method and device, computer equipment and a medium, and the method comprises the steps: firstly obtaining a financial index query task in a natural language form; secondly, disassembling the task to obtain an index recall task, an object subject recall task and an object association relationship identification task; performing interface matching based on an object relationship identification result of the object association relationship identification task to obtain an interface recall result; performing interface message splicing according to the index recall result, the subject recall result and the interface recall result to obtain a to-be-called interface message; and finally, calling an interface to obtain a financial index query result. Through recall of the subject, the index and the interface of the subject, the subject, the index and the called interface of the subject can be more accurately obtained, and through identification of the association relationship of the subject, the associated subject and the matched interface can be accurately identified, so that the accuracy of financial index query is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a financial indicator query method, device, computer equipment and medium. Background Art

[0002] The query of financial indicators is an important function to support researchers and investment managers in conducting quantitative research. By obtaining and accurately analyzing financial indicators in real time, we can effectively capture market opportunities, identify potential investment risks, optimize capital allocation, and improve the overall efficiency of asset management.

[0003] In the related art, financial indicator queries can be based on natural language and queried from background services. However, ambiguity is prone to occur when identifying the names of the objects and indicators to be queried, resulting in low accuracy of the query results.

[0004] Therefore, it is urgent to propose a new financial indicator query method. Summary of the invention

[0005] The present application provides a financial indicator query method, apparatus, computer equipment and medium, which solve the technical problem of low accuracy of financial indicator query in related technologies and achieve the technical effect of improving query accuracy.

[0006] In order to achieve the above objectives, the main technical solutions adopted in this application include:

[0007] In a first aspect, an embodiment of the present application provides a financial indicator query method, the method comprising:

[0008] Obtain financial indicator query tasks in natural language form;

[0009] Decomposing the financial indicator query task into an indicator recall task, a target subject recall task and a target association relationship identification task;

[0010] Performing interface matching based on the target relationship recognition result of the target association relationship recognition task to obtain an interface recall result;

[0011] According to the indicator recall result of the indicator recall task, the subject recall result of the subject recall task, and the interface recall result, interface message splicing is performed to obtain the interface message to be called;

[0012] An interface call is performed based on the interface message to be called to obtain a financial indicator query result corresponding to the financial indicator query task.

[0013] Optionally, performing interface matching based on the target relationship identification result of the target association relationship identification task to obtain an interface recall result includes:

[0014] determining a query type based on the relationship identification result;

[0015] Vectorizing the query statement corresponding to the financial indicator query task to obtain query statement vector data;

[0016] Recalling a plurality of candidate interfaces from an interface vector database according to the query statement vector data;

[0017] The query type is used to screen multiple candidate interfaces to obtain the interface recall result.

[0018] Optionally, the interface message splicing is performed according to the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain the interface message to be called, including:

[0019] In response to a feedback operation on the recall result of the target subject, determining a target subject;

[0020] Using the subject of the target object and the relationship identification result to query, obtain related objects;

[0021] Based on the indicator recall result, the subject of the target object, the associated object and the interface recall result, interface message splicing is performed to obtain the interface message to be called.

[0022] Optionally, the performing interface message splicing based on the indicator recall result, the subject of the target object, the associated object and the interface recall result to obtain the interface message to be called includes:

[0023] The indicator recall result and the interface recall result are selected by a large language model to obtain a matching indicator and a matching interface;

[0024] Determine a message format specification based on the interface recall result;

[0025] According to the message format specification, interface message splicing is performed on the matching index, the main body of the target object, the associated object and the matching interface to obtain the interface message to be called.

[0026] Optionally, the interface message splicing is performed according to the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain the interface message to be called, including:

[0027] According to the indicator recall result of the indicator recall task, the subject recall result of the subject recall task, and the interface recall result, interface message splicing is performed to obtain a candidate interface message;

[0028] In response to the selection operation of the candidate interface message, the interface message to be called that meets the user's intention is determined.

[0029] Optionally, the interface recall result includes a message processing strategy; the interface call based on the to-be-called interface message to obtain a financial indicator query result corresponding to the financial indicator query task includes:

[0030] Performing an interface call based on the interface message to be called to obtain a structured query result;

[0031] The structured query result is standardized and a pivot table is generated according to the message processing strategy to obtain the financial indicator query result.

[0032] Optionally, the method further comprises:

[0033] Displaying the query results of the financial indicators;

[0034] When the financial indicator query result does not meet the user's expectations, the financial indicator query task is re-decomposed to obtain a new indicator recall task, a new target subject recall task and a new target association relationship identification task, so as to generate a new interface message to be called.

[0035] In a second aspect, an embodiment of the present application provides a financial indicator query device, the device comprising:

[0036] A query task acquisition module, used to acquire financial indicator query tasks in natural language form;

[0037] A task decomposition module is used to decompose the financial indicator query task into an indicator recall task, a target subject recall task and a target association relationship identification task;

[0038] An interface matching module, used to perform interface matching based on the target relationship recognition result of the target association relationship recognition task to obtain an interface recall result;

[0039] A message splicing module, used to perform interface message splicing according to the indicator recall result of the indicator recall task, the subject recall result of the subject recall task, and the interface recall result to obtain the interface message to be called;

[0040] The interface calling module is used to perform an interface calling based on the interface message to be called to obtain a financial indicator query result corresponding to the financial indicator query task.

[0041] In a third aspect, an embodiment of the present application provides a computer device, including:

[0042] A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method described in any of the above embodiments by executing the computer instructions.

[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the method described in any of the above embodiments.

[0044] In the embodiment of the present application, firstly, a financial indicator query task in the form of natural language is obtained; secondly, the financial indicator query task is task-decomposed to obtain an indicator recall task, a target subject recall task and a target association relationship identification task; then, interface matching is performed based on the target relationship identification result of the target association relationship identification task to obtain an interface recall result; then, interface message splicing is performed based on the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain an interface message to be called; finally, an interface call is performed based on the interface message to be called to obtain a financial indicator query result corresponding to the financial indicator query task. Through the recall of the target subject, indicator and interface, the target subject, indicator and the called interface can be obtained more accurately, and through the target association relationship identification, the associated target can be accurately identified, thereby improving the accuracy of the financial indicator query. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1a A flowchart of a financial indicator query method provided in an embodiment of this specification;

[0047] Figure 1b A flowchart of a financial indicator query method provided in an embodiment of this specification;

[0048] Figure 1c A flowchart of the subject recall provided in the embodiments of this specification;

[0049] Figure 2 A flowchart of a financial indicator query method provided in an embodiment of this specification;

[0050] Figure 3 A flowchart of a financial indicator query method provided in an embodiment of this specification;

[0051] Figure 4 A flowchart of a financial indicator query method provided in an embodiment of this specification;

[0052] Figure 5 A flowchart of a financial indicator query method provided in an embodiment of this specification;

[0053] Figure 6 A flowchart of a financial indicator query method provided in an embodiment of this specification;

[0054] Figure 7 A flowchart of a financial indicator query method provided in an embodiment of this specification;

[0055] Figure 8 A schematic diagram of a financial indicator query device provided in an embodiment of this specification;

[0056] Fig. 9 A schematic diagram of the structure of a computer device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0058] Among the related technologies, financial indicator queries are performed using natural language as a carrier. Some of them mine data from text databases. It is necessary to vectorize and store text information such as research reports and news, and associate it with the most relevant data based on user questions. The timeliness of this technology is poor and may not be able to reflect the latest financial trends in a timely manner.

[0059] Some of them extract data from the database and use the Text2SQL capability to generate executable SQL that matches the user's questions and complies with the database table specifications based on the database table information, and finally execute and obtain the data. The data type of this technology is relatively simple, and it is difficult to support the acquisition of complex indicators, and the data is less professional.

[0060] Some of them call data from the backend interface, convert user questions into structured data based on the text-to-structured-data capability, and call them as HTTP messages. The data in this type of technology is highly professional and timely, but when identifying the name of the query target and the name of the indicator, ambiguity is prone to occur, resulting in deviations in the query results; and the returned message formats vary, and are often nested, making data extraction difficult.

[0061] Based on this, the present application provides a financial indicator query method, firstly, obtaining a financial indicator query task in the form of natural language; secondly, performing task decomposition on the financial indicator query task to obtain an indicator recall task, a target subject recall task and a target association relationship identification task; then, performing interface matching based on the target relationship identification result of the target association relationship identification task to obtain an interface recall result; then, performing interface message splicing based on the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain an interface message to be called; finally, performing an interface call based on the interface message to be called to obtain a financial indicator query result corresponding to the financial indicator query task. Through the recall of the target subject, indicator and interface, the target subject, indicator and the called interface can be obtained more accurately, and through the target association relationship identification, the associated target can be accurately identified, thereby improving the accuracy of the financial indicator query.

[0062] After obtaining the structured query results, the method can also standardize the structured query results and generate a pivot table through a message processing strategy, thereby making the financial indicator query results more concise and easy for users to intuitively understand and analyze.

[0063] According to an embodiment of the present application, an embodiment of a financial indicator query method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0064] See also Figure 1a and Figure 1b In this embodiment, a financial indicator query method is provided, the method comprising:

[0065] S110. Acquire a financial indicator query task in natural language form.

[0066] Among them, the financial indicator query task can be a user's financial indicator query type question, including the target subject, related targets, target correlation relationship and indicators, such as "the price-earnings ratio of xx fund and its top constituent stocks". In this financial indicator query problem, "xx fund" is the target subject, "its top constituent stocks" are the related targets, "xx fund and its top constituent stocks" are the target correlation relationship, and "price-earnings ratio" is the indicator.

[0067] Specifically, financial indicator query tasks can be input through natural language text or voice input and then converted into text form.

[0068] S120, decomposing the financial indicator query task into an indicator recall task, a target subject recall task and a target association relationship identification task.

[0069] Among them, the indicator recall task can search for similar indicators in the indicator vector database based on the indicators identified in the financial indicator query task.

[0070] Specifically, the main processing steps of the indicator recall task are as follows:

[0071] 1) Obtain the current financial indicator query task, and understand the semantics of the current financial indicator query task based on the historical financial indicator query task.

[0072] 2) Use the prompt word engineering of the large language model to obtain the indicators in the current financial indicator query task. For example, the prompt word can be "As a financial analysis assistant, I am responsible for extracting the query indicators based on the user's financial indicator query task. Financial indicator query task description: {Please enter the financial indicator query task description}. Note: You need to identify the financial indicator based on the context provided by the task description."

[0073] 3) Vectorize the indicators through the embedding model (such as OpenAI's Ada model and Tao-8k model) to obtain indicator vectorized data.

[0074] 4) Based on the similarity comparison with the indicator vectorized data, multiple candidate indicators are recalled from the indicator vector database.

[0075] The target subject recall task can perform an exact match query in the target database based on the target subject identified in the financial indicator query task, or search for similar target subjects in the target vector database.

[0076] Specifically, see Figure 1c The main steps of the subject recall are as follows:

[0077] 1) Obtain the current financial indicator query task, and understand the semantics of the current financial indicator query task based on the historical financial indicator query task.

[0078] 2) Use the prompt word engineering of the large language model to obtain the name of the target in the current financial indicator query task. For example, the prompt word can be "As a financial analysis assistant, responsible for extracting the name of the queried target based on the user's financial indicator query task. Financial indicator query task description: {xx fund and its top constituent stocks' price-earnings ratio in the last six months}. Note: You need to identify the most relevant target name based on the context provided in the task description." For example, the name instance of "the yield trend of the CSI 300 ETF and its linked funds in the past year" is "CSI 300 ETF and its linked funds".

[0079] 3) Use Few-shot Prompt to obtain the subject in the current name instance. For example, Few-shot Prompt can be:

[0080] As a financial analysis assistant, it is responsible for extracting the name of the target entity of the query based on the user's financial indicator query task.

[0081] Example 1:

[0082] Input: "The P / E ratio of xx fund and its top constituent stocks in the last six months"

[0083] Output: "xx fund"

[0084] Example 2:

[0085] Input: "The yield trend of CSI 300 ETF and its linked funds in the past year"

[0086] Output: "SSE 300 ETF".

[0087] 4) Query the subject in the subject database, which can be queried by strict matching. When the subject strictly matches the query, the unique subject is obtained. It is understandable that if the subject identification and other information are needed in the interface message, it can be queried together.

[0088] 5) When the target subject strictly matches the query but fails, it is necessary to obtain a similar target subject. Specifically, the target subject is vectorized through an embedding model (such as OpenAI's Ada model and Tao-8k model) to obtain the target subject vectorized data. Based on the similarity comparison, multiple candidate target subjects are recalled from the target vector database. It is understandable that if the target subject's identification and other information are needed in the interface message, they can be recalled together.

[0089] The target association relationship identification task can obtain the target subject and the association relationship between the target subject and the associated target based on the financial indicator query task. According to the name of the target subject, its query type can be obtained, and the query type can be stocks, funds, indexes, bonds, etc. For example, after extracting the target subject "xx fund" from "the price-earnings ratio of xx fund and its top constituent stocks", it can be determined that the query type of the target subject is fund. The target association relationship can be "xx fund and its constituent stocks", "xx index and its linked fund", etc. According to the target association relationship, the query type of the associated target can be obtained.

[0090] S130 , performing interface matching based on the target relationship identification result of the target association relationship identification task to obtain an interface recall result.

[0091] The target relationship recognition result includes the query type of the target subject and the associated target.

[0092] Specifically, we can first vectorize the query statements corresponding to the financial indicator query task based on context semantics to obtain query statement vectorized data; then perform a similarity comparison between the query statement vectorized data and the interface feature data in the interface vector database to obtain multiple similar interfaces. Since each interface has a corresponding interface query type (such as stocks, funds, indexes, futures, etc.), we can match the corresponding type of interface for recall based on the query type in the target relationship recognition result.

[0093] S140. Perform interface message splicing according to the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain the interface message to be called.

[0094] Specifically, when the target subject can be accurately matched in the target database, since the target subject is unique, the target database can be queried based on the target subject and the target association relationship to obtain the information of the associated target, such as the name and identifier of the associated target. In other embodiments, multiple candidate target subjects are recalled in the target vector database, and the unique target subject can be determined through user feedback, and then the target database can be queried based on the target subject and the target association relationship to obtain the information of the associated target, such as the name and identifier of the associated target.

[0095] Furthermore, based on the user questions and context semantics corresponding to the financial indicator query task, the interface recall results, the subject, the related subjects and the indicator recall results, the large language model can select the most matching interface and indicator, and perform interface message splicing according to the interface message format specification to obtain the interface message to be called.

[0096] S150: Perform an interface call based on the interface message to be called to obtain a financial indicator query result corresponding to the financial indicator query task.

[0097] Among them, the financial indicator query results can be the indicator query results of the target entity and the related targets.

[0098] Specifically, the interface message to be called is sent to the background service for interface calling, for example, the interface message to be called can be sent to the background service for interface calling via HTTP request. After the interface call is successful, the financial indicator query result corresponding to the financial indicator query task is returned.

[0099] In the above embodiment, firstly, a financial indicator query task in the form of natural language is obtained; secondly, the financial indicator query task is task-decomposed to obtain an indicator recall task, a target subject recall task and a target association relationship identification task; then, interface matching is performed based on the target relationship identification result of the target association relationship identification task to obtain an interface recall result; then, interface message splicing is performed based on the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain an interface message to be called; finally, an interface call is performed based on the interface message to be called to obtain a financial indicator query result corresponding to the financial indicator query task. By recalling the target subject, indicator and interface, the target subject, indicator and the called interface can be obtained more accurately, and by identifying the target association relationship, the associated target can be accurately identified, thereby improving the accuracy of the financial indicator query.

[0100] See also Figure 2 In some embodiments, interface matching is performed based on the target relationship identification result of the target association relationship identification task to obtain an interface recall result, including:

[0101] S210: Determine the query type based on the relationship identification result.

[0102] S220. Vectorize the query statement corresponding to the financial indicator query task to obtain query statement vector data.

[0103] S230. Recall multiple candidate interfaces from the interface vector database according to the query statement vector data.

[0104] S240. Filter multiple candidate interfaces using the query type to obtain an interface recall result.

[0105] The query type may be stocks, funds, bonds, futures, etc. The query statement vector data is data obtained by vectorizing the query statement.

[0106] Specifically, first, based on the relationship identification result, the name of the target entity can be obtained, thereby obtaining its query type. For example, after extracting the target entity "xx fund" from "xx fund and its top constituent stock price-earnings ratio", it can be determined that the query type of the target entity is fund. Secondly, based on the target association relationship, the query type of the associated target can be obtained. For example, from "xx index and its linked fund", it can be obtained that the query type of the associated target is fund.

[0107] To perform interface matching, we first vectorize the query statement through an embedding model (such as OpenAI's Ada model and Tao-8k model) to obtain query statement vector data. It is understandable that when vectorizing the query statement, in addition to considering the user's current question, it is also necessary to combine the user's historical questions in order to understand the current question more accurately from a semantic point of view.

[0108] Furthermore, based on similarity comparison, multiple candidate interfaces and related attributes of each interface, such as interface description, interface path, interface query type, interface applicable scenario, etc., are recalled from the interface vector database.

[0109] Furthermore, the query type obtained from the relationship identification result is used to filter the "interface query type" value of the candidate interface to obtain the interface recall result.

[0110] In the above embodiment, the candidate interfaces are screened according to the query type, and the interfaces that do not match the required query type are filtered out, thereby obtaining the interface recall result and improving the accuracy of interface matching.

[0111] See also Figure 3 In some embodiments, the interface message is spliced ​​according to the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain the interface message to be called, including:

[0112] S310: In response to a feedback operation on a recall result of a target subject, determine a target subject.

[0113] S320: Query using the subject and relationship recognition results of the target object to obtain related objects.

[0114] S330: Based on the indicator recall result, the subject of the target object, the associated object and the interface recall result, the interface message is spliced ​​to obtain the interface message to be called.

[0115] The subject of the target object can be the subject of the subject to be queried reported by the user. The interface message to be called is spliced ​​according to the recall result, and the request message is formed by integrating the relevant data. These messages contain the most relevant content filtered out from the recalled content, and on this basis, the structured data for transmission to the target interface is constructed.

[0116] Specifically, since the financial indicator query task is described in natural language, the target subject can first be queried in the corresponding target database for strict matching. If there is no result in strict matching, the target subject is vectorized, and then multiple candidate target subjects are recalled from the corresponding target vector database through similarity comparison. For example, after obtaining the financial indicator query task "the price-to-book ratio of xx fund and its top constituent stocks", the target subject "xx fund" is queried in the fund database for strict matching. If it can be found, "xx fund" is the target subject. On the contrary, if it is not found, "xx fund" needs to be vectorized, and then recalled from the fund vector database through similarity comparison. Generally, multiple candidate target subjects that meet the similarity comparison conditions can be recalled. In order to improve the accuracy of financial indicator queries, the target target subject can be determined from the candidate target subjects based on user feedback operations. It is understandable that if the identifier of the target subject (i.e., the ID of the target subject) is used in the interface call, the identifier should also be recalled when the interface is recalled so as to be used when generating the interface message to be called.

[0117] Furthermore, based on the acquisition of the target subject, the relationship recognition results are used to query the related targets in the target database. For example, in the financial indicator query task "the price-to-book ratio of xx fund and its top constituent stocks", the top constituent stocks of xx fund are related targets. By querying in the target database, the information of each top constituent stock can be obtained.

[0118] Furthermore, based on the indicator recall results, the subject of the target, the associated subject, and the interface recall results, the interface message splicing can be performed according to the interface specification to obtain the interface message to be called. For example, based on the recall indicator with the highest similarity, the recall interface with the highest similarity, the subject of the target, and the associated subject, the interface message splicing can be performed according to the interface specification of the recall interface with the highest similarity to obtain the interface message to be called.

[0119] See also Figure 4 In some embodiments, the interface message is spliced ​​based on the indicator recall result, the target subject, the associated subject and the interface recall result to obtain the interface message to be called, including:

[0120] S410. Select the indicator recall results and the interface recall results through a large language model to obtain matching indicators and matching interfaces.

[0121] S420. Determine a message format specification based on the interface recall result.

[0122] S430: perform interface message splicing on the matching index, the subject of the target object, the associated object and the matching interface according to the message format specification to obtain the interface message to be called.

[0123] The matching indicator may be the most relevant query indicator selected from the indicator recall results according to the financial indicator query task and the recall information. The matching interface may be an interface suitable for executing the financial indicator query task selected from the interface recall results according to the financial indicator query task and the recall information, including the query interface of the subject and the query interface of the associated subject.

[0124] Specifically, the indicator recall results, target subject, related subject and interface recall results can be input into a large language model (such as OpenAI's GPT-4 series and Alibaba's Tongyi Qianwen series). The large language model can select based on information such as financial indicator query tasks, indicator recall results and interface attributes in the interface recall results to obtain matching indicators and matching interfaces.

[0125] Furthermore, each interface in the interface recall result carries a Json Schema specification, which can be used as a description template for the interface request message. After the matching interface is determined, the corresponding Json Schema specification can be determined. The large language model can perform interface message splicing on the matching indicators, the subject of the target object, the associated object and the matching interface according to the Json Schema specification to obtain the interface message to be called.

[0126] See also Figure 5 In some embodiments, the interface message is spliced ​​according to the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain the interface message to be called, including:

[0127] S510 . Perform interface message splicing according to the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain a candidate interface message.

[0128] S520: In response to the selection operation on the candidate interface message, determine the interface message to be called that meets the user's intention.

[0129] Specifically, the indicator recall results, the subject of the target, the associated subject, and the interface recall results can be input into a large language model (such as OpenAI's GPT-4 series and Alibaba's Tongyi Qianwen series). The large language model can select based on information such as financial indicator query tasks, indicator recall results, and interface attributes in the interface recall results to obtain matching indicators and matching interfaces. Furthermore, each interface in the interface recall result carries a Json Schema specification, which can be used as a description template for the interface request message. After the matching interface is determined, the corresponding Json Schema specification can be determined. The large language model can perform interface message splicing for matching indicators, the subject of the target, the associated subject, and the matching interface according to the Json Schema specification to obtain candidate interface messages. Furthermore, the large model can summarize the information in the candidate interface message and display it to the user so that the user can provide feedback. Exemplarily, the user can select the summary information as correct or incorrect. If the user selects the summary information as correct, the candidate interface message can be determined as the interface message to be called that meets the user's intention; if the user selects the summary information as incorrect, the user needs to further feedback relevant information.

[0130] According to the relevant information of user feedback, the financial indicator query task is adjusted to obtain a new financial indicator query task; then the new financial indicator query task is decomposed to obtain a new indicator recall task, a new target subject recall task and a new target association relationship identification task, and interface matching is performed based on the new target relationship identification result to obtain a new interface recall result, and interface message splicing is performed according to the new indicator recall result, the new subject recall result and the new interface recall result to obtain a new candidate interface message; then the information in the new candidate interface message is summarized and displayed to the user for user feedback. If the user feedback summary information is incorrect, the above process is repeated until the user feedback is correct and the corresponding interface message to be called is obtained.

[0131] In some implementations, after the user feedback that the candidate interface message is correct, the candidate interface message needs to be fine-tuned according to the interface specification. Exemplarily, the fine-tuning may include external data injection, such as replacing certain parameters in the candidate interface message with corresponding identifiers instead of using natural language descriptions.

[0132] See also Figure 6 In some embodiments, the interface recall result includes a message processing strategy; an interface call is performed based on the interface message to be called, and a financial indicator query result corresponding to the financial indicator query task is obtained, including:

[0133] S610: Perform an interface call based on the interface message to be called to obtain a structured query result.

[0134] S620: Standardize the structured query results and generate a pivot table according to the message processing strategy to obtain financial indicator query results.

[0135] Among them, the structured query result can be a message returned by the background service query. The message is organized into a structured format, such as JSON format, and often contains nested content. This message format is not easy for users to understand, nor is it easy for large language models to understand. It needs to be processed in a certain way before being displayed to the user.

[0136] The message processing strategy can be a strategy for standardizing the structured query results and generating pivot tables. The standardization strategy can be a strategy for flattening the data in the returned message, that is, converting a multidimensional data structure (such as a nested JSON object) into a two-dimensional table format so that each record is flat and avoids nested structures. The pivot table strategy can be a strategy for filtering data and aggregating the data of multiple targets, and displaying them in a two-dimensional table to facilitate subsequent data analysis and visualization. The financial indicator query result can be a structured query result processed using the message processing strategy, and displayed to users in the form of a two-dimensional table.

[0137] Specifically, first, the interface message to be called is sent to the background service for interface calling. For example, the interface message to be called can be sent to the background service for interface calling through HTTP request. After the interface call is successful, the structured query result is returned. Then, the structured query result is flattened according to the standardized processing strategy in the message processing strategy, and then the data of multiple targets are filtered and aggregated according to the pivot table strategy in the message processing strategy to obtain the financial indicator query result.

[0138] In the above embodiment, by applying the message processing strategy to standardize the structured query results and generate a pivot table, the financial indicator query results can be made more concise and easy to understand and process by the large language model. At the same time, the processed data enables users to understand and analyze more intuitively, thereby improving the efficiency of data analysis.

[0139] See also Figure 7 In some embodiments, the financial indicator query method further includes:

[0140] S710. Display the financial indicator query results.

[0141] S720. When the financial indicator query result does not meet the user's expectations, the financial indicator query task is re-decomposed to obtain a new indicator recall task, a new target subject recall task and a new target association relationship identification task, so as to generate a new interface message to be called.

[0142] Specifically, after receiving the financial indicator query result, the big model displays the financial indicator query result to the user, and the user can provide feedback on the accuracy of the financial indicator query result. For example, the user can choose whether the financial indicator query result meets expectations. If the user selects the summary information as meeting expectations, the financial indicator query result can be further analyzed in the form of questions and answers; if the user selects that the financial indicator query result does not meet expectations, the user can submit feedback information.

[0143] The financial indicator query task is adjusted according to the user's feedback information to obtain a new financial indicator query task; then the new financial indicator query task is decomposed to obtain a new indicator recall task, a new target subject recall task and a new target association relationship identification task, and interface matching is performed based on the new target relationship identification result to obtain a new interface recall result, and interface message splicing is performed according to the new indicator recall result, the new subject recall result and the new interface recall result to obtain a new candidate interface message; then the information in the new candidate interface message is summarized and displayed to the user for user feedback. If the user feedback summary information is incorrect, the above process is repeated until the user feedback is correct and the corresponding new interface message to be called is obtained.

[0144] See also Figure 8 In this embodiment, a financial indicator query device 800 is provided. The financial indicator query device 800 includes:

[0145] A query task acquisition module 810 is used to acquire a financial indicator query task in a natural language form;

[0146] The task decomposition module 820 is used to decompose the financial indicator query task into an indicator recall task, a target subject recall task and a target association relationship identification task;

[0147] The interface matching module 830 is used to perform interface matching based on the target relationship identification result of the target association relationship identification task to obtain an interface recall result;

[0148] The message splicing module 840 is used to perform interface message splicing according to the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain the interface message to be called;

[0149] The interface calling module 850 is used to perform an interface call based on the interface message to be called, and obtain a financial indicator query result corresponding to the financial indicator query task.

[0150] In some implementations, the interface matching module 830 further includes:

[0151] A query type determination unit, configured to determine a query type based on a relationship recognition result;

[0152] A vectorization module is used to vectorize the query statements corresponding to the financial indicator query task to obtain query statement vector data;

[0153] A candidate interface recall unit, used to recall multiple candidate interfaces from an interface vector database according to the query statement vector data;

[0154] The query type is used to filter multiple candidate interfaces to obtain the interface recall result.

[0155] In some implementations, the message splicing module 840 further includes:

[0156] a target subject determination unit, configured to determine the target subject in response to a feedback operation on the target subject recall result;

[0157] A related target acquisition unit, used to query using the subject and relationship recognition results of the target target to obtain the related targets;

[0158] The message splicing unit is used to perform interface message splicing based on the indicator recall result, the target subject, the associated subject and the interface recall result to obtain the interface message to be called.

[0159] In some implementations, the message splicing module 840 further includes:

[0160] The indicator and interface matching unit is used to select the indicator recall results and the interface recall results through a large language model to obtain matching indicators and matching interfaces;

[0161] A message format specification determination unit, used to determine a message format specification based on an interface recall result;

[0162] The message splicing unit is used to perform interface message splicing on the matching index, the subject of the target object, the associated object and the matching interface according to the message format specification to obtain the interface message to be called.

[0163] In some implementations, the message splicing module 840 further includes:

[0164] A candidate message determination unit is used to perform interface message splicing according to the indicator recall result of the indicator recall task, the target subject recall result of the target subject recall task, and the interface recall result to obtain a candidate interface message;

[0165] The message to be called determining unit is used to determine the interface message to be called that meets the user's intention in response to the selection operation of the candidate interface message.

[0166] In some implementations, the interface recall result includes a message processing strategy; the interface calling module 850 further includes:

[0167] A result acquisition unit, used to perform an interface call based on the interface message to be called to obtain a structured query result;

[0168] The message processing unit is used to perform standardization processing on the structured query results and generate a pivot table according to the message processing strategy to obtain the financial indicator query results.

[0169] In some implementations, the financial indicator query device 800 further includes:

[0170] The query result display module is used to display the query results of financial indicators;

[0171] The task re-decomposition module is used to re-decompose the financial indicator query task when the financial indicator query result does not meet the user's expectations, and obtain new indicator recall tasks, new target subject recall tasks and new target association relationship identification tasks to generate new interface messages to be called.

[0172] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0173] The financial indicator query device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0174] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application, such as Fig. 9 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.

[0175] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0176] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0177] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0178] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0179] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0180] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0181] The embodiment of the present application also provides a computer-readable storage medium. The above method according to the embodiment of the present application can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0182] The embodiment of the present application provides a computer program product, which includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of any embodiment of the present application.

[0183] Although the embodiments of the present application are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.

[0184] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0185] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0186] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0187] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0188] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0189] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0190] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0191] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0192] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

[0193] Although the embodiments of the present application have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A financial indicator query method, characterized in that: The method comprises: Obtain financial indicator query tasks in natural language form; Decomposing the financial indicator query task into an indicator recall task, a target subject recall task and a target association relationship identification task; Performing interface matching based on the target relationship recognition result of the target association relationship recognition task to obtain an interface recall result; According to the indicator recall result of the indicator recall task, the subject recall result of the subject recall task, and the interface recall result, interface message splicing is performed to obtain the interface message to be called; An interface call is performed based on the interface message to be called to obtain a financial indicator query result corresponding to the financial indicator query task.

2. The method according to claim 1, characterized in that The interface matching is performed based on the target relationship identification result of the target association relationship identification task to obtain the interface recall result, including: determining a query type based on the relationship identification result; Vectorizing the query statement corresponding to the financial indicator query task to obtain query statement vector data; Recalling a plurality of candidate interfaces from an interface vector database according to the query statement vector data; The query type is used to screen multiple candidate interfaces to obtain the interface recall result.

3. The method according to claim 1, characterized in that The interface message splicing is performed according to the indicator recall result of the indicator recall task, the subject recall result of the subject recall task, and the interface recall result to obtain the interface message to be called, including: In response to a feedback operation on the recall result of the target subject, determining a target subject; Using the subject of the target object and the relationship identification result to query, obtain related objects; Based on the indicator recall result, the subject of the target object, the associated object and the interface recall result, interface message splicing is performed to obtain the interface message to be called.

4. The method according to claim 3, characterized in that The step of performing interface message splicing based on the indicator recall result, the subject of the target object, the associated object and the interface recall result to obtain the interface message to be called includes: The indicator recall result and the interface recall result are selected by a large language model to obtain a matching indicator and a matching interface; Determine a message format specification based on the interface recall result; According to the message format specification, interface message splicing is performed on the matching index, the main body of the target object, the associated object and the matching interface to obtain the interface message to be called.

5. The method according to claim 1, characterized in that: The interface message splicing is performed according to the indicator recall result of the indicator recall task, the subject recall result of the subject recall task, and the interface recall result to obtain the interface message to be called, including: According to the indicator recall result of the indicator recall task, the subject recall result of the subject recall task, and the interface recall result, interface message splicing is performed to obtain a candidate interface message; In response to the selection operation of the candidate interface message, the interface message to be called that meets the user's intention is determined.

6. The method according to claim 1, characterized in that The interface recall result includes a message processing strategy; the interface call is performed based on the interface message to be called to obtain a financial indicator query result corresponding to the financial indicator query task, including: Performing an interface call based on the interface message to be called to obtain a structured query result; The structured query result is standardized and a pivot table is generated according to the message processing strategy to obtain the financial indicator query result.

7. The method according to claim 1, characterized in that The method further comprises: Displaying the query results of the financial indicators; When the financial indicator query result does not meet the user's expectations, the financial indicator query task is re-decomposed to obtain a new indicator recall task, a new target subject recall task and a new target association relationship identification task, so as to generate a new interface message to be called.

8. A financial indicator query device, characterized in that: The device comprises: A query task acquisition module, used to acquire financial indicator query tasks in natural language form; A task decomposition module is used to decompose the financial indicator query task into an indicator recall task, a target subject recall task and a target association relationship identification task; An interface matching module, used to perform interface matching based on the target relationship recognition result of the target association relationship recognition task to obtain an interface recall result; A message splicing module, used to perform interface message splicing according to the indicator recall result of the indicator recall task, the subject recall result of the subject recall task, and the interface recall result to obtain the interface message to be called; The interface calling module is used to perform an interface calling based on the interface message to be called to obtain a financial indicator query result corresponding to the financial indicator query task.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.

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 computer to execute the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Retrieval method and device based on hybrid vector model and readable storage medium

    CN120508573A

  • Retrieval method, device and readable storage medium based on hybrid vector model

    CN120508573B