Data processing method and device and computer equipment

The process of receiving user input data by splitting the generation model and generating output results is to determine the target API interface and query conditions, obtain query results and determine output results, and use the analysis and data processing capabilities of the two generation models to solve the problem. The problem of low fault tolerance of the generation model and poor output quality achieve higher quality output results.

CN119441550AActive Publication Date: 2025-02-14BEIJING PACTERA JINXIN TECH LTD

Patent Information

Application Number
CN202411533910.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-14
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

In the prior art, the process of generating the output results of models is almost redundant and fault-tolerant, which leads to the model being unable to fully understand user needs, many request failures, and poor quality of output results.

Method used

By inputting the user's input data, target intent and pre-selected interface list into the generation model, the target API interface and query conditions are obtained, and the query conditions are further entered into the target API interface for query, obtain the query results, and the query results and input data are input again Generate the model for data processing to generate the final output result.

Benefits of technology

This improves the fault tolerance of the generative model, enhances the quality of the output results, and reduces the probability that the structured data generation failure or the generation of unstandard results in the request failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441550A_ABST
    Figure CN119441550A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of big data processing, in particular to a data processing method and device and computer equipment. The method comprises the steps that screening is conducted from a preset query API list according to a target intention, a pre-selected interface list is obtained, the target intention is determined based on input data of a user, and the pre-selected interface list comprises all query API interfaces associated with the target intention; inputting the input data, the target intention and the pre-selected interface list into a generative model to obtain a target API interface and a query condition output by the generative model; inputting the query condition into the target API interface for query to obtain a query result fed back by the target API interface; and inputting the query result and the input data into the generative model for data processing to obtain a data processing result. By adopting the method, the error-tolerant rate of the generated model can be improved, so that the quality of an output result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of big data processing, and in particular to a data processing method, apparatus and computer equipment. Background Art

[0002] With the continuous development and progress of large model-related products, the demand for processing large amounts of background knowledge and precise context based on large models is increasing, so RAG (Retrieval-Augmented Generation) technology has emerged. RAG is a natural language processing method that combines information retrieval and text generation. It retrieves external knowledge bases to provide contextual information for the LLM (Large Language Model) generation model, so that the generation model can generate more accurate and relevant text responses. In related technologies, the user's input information is parsed by the generation model to determine the database and query parameters to be queried, and further generates SQL-formatted query code based on the query parameters and sends it to the relevant database for data query. The database feeds back the query results to the generation model in the form of code, and the generation model generates output results based on the query results and feeds them back to the user.

[0003] However, in the related art, since the generation model directly parses the user's input information to obtain the database and query parameters that need to be queried, the performance requirements of the generation model are extremely high; this leads to the fact that in the related art, the process of generating output results by the generation model has almost no redundant fault tolerance; it often happens that the model cannot fully understand the user's needs, resulting in request failures, resulting in poor quality of the generated output results.

[0004] Therefore, how to improve the error tolerance of the generated model and thus improve the quality of the output results is an urgent problem that needs to be solved. Summary of the invention

[0005] Based on this, it is necessary to provide a data processing method, device and computer equipment that can improve the fault tolerance of the generated model and thus improve the quality of the output results in response to the above technical problems.

[0006] In a first aspect, the present application provides a data processing method, comprising:

[0007] Filtering from a preset query API list according to a target intent to obtain a pre-selected interface list, wherein the target intent is determined based on user input data, and the pre-selected interface list includes various query API interfaces associated with the target intent;

[0008] Input the input data, the target intent and the pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model;

[0009] Input the query condition into the target API interface to perform a query, and obtain the query result fed back by the target API interface;

[0010] The query result and the input data are input into the generation model for data processing to obtain a data processing result.

[0011] In one embodiment, the step of inputting the input data, the target intent, and the pre-selected interface list into a generation model to obtain the target API interface and query conditions output by the generation model includes:

[0012] Constructing a first prompt template based on the input data, the target intent, and the pre-selected interface list;

[0013] The first prompt template is input into the generation model to obtain a selection result output by the generation model, wherein the selection result includes a target API interface and a query condition.

[0014] In one embodiment, the method further comprises:

[0015] Input the first prompt template into the generation model N times to obtain N selection results, where N>0;

[0016] If the N selection results are not completely the same, the difference items in the N selection results are compared, and first prompt information is generated based on the difference items, and the first prompt information is fed back to the requesting end.

[0017] In one embodiment, inputting the query condition into the target API interface for querying includes:

[0018] If the N selection results are exactly the same, the query condition is input into the target API interface for query, and the query result fed back by the target API interface is obtained.

[0019] In one embodiment, the method further comprises:

[0020] Input the query condition into the functional API interface to obtain the standard query condition fed back by the functional API interface, wherein the standard query condition is data processed by standard formatting;

[0021] The standard query conditions are input into the target API interface for query.

[0022] In one embodiment, the step of inputting the query result and the input data into the generation model for data processing to obtain the data processing result includes:

[0023] Building a second prompt template based on the query result and the input data;

[0024] The second prompt template is input into the generation model for data processing to obtain a data processing result.

[0025] In one embodiment, the method further comprises:

[0026] Receiving input data, parsing the input data, and obtaining an initial intent;

[0027] Matching each intent template with the initial intent in turn;

[0028] If the intention template corresponding to the initial intention exists, determining the initial intention as the target intention;

[0029] If the intent template corresponding to the initial intent does not exist, second prompt information is generated and the second prompt information is fed back to the requesting end.

[0030] In one embodiment, the intent template includes a function sub-template and a parameter type sub-template, the initial intent includes a request function and a request parameter type, and the sequentially matching each intent template with the initial intent includes:

[0031] For each intent template, the function sub-template is matched with the initial intent in turn, and the parameter type sub-template is matched with the request parameter type.

[0032] In a second aspect, the present application further provides a data processing device, the device comprising a screening module, a first input module, a query module and a second input module, wherein:

[0033] A screening module, used to screen from a preset query API list according to a target intent to obtain a pre-selected interface list, wherein the target intent is determined based on user input data, and the pre-selected interface list includes various query API interfaces associated with the target intent;

[0034] A first input module, used to input the input data, the target intent and the pre-selected interface list into the generation model, and obtain the target API interface and query conditions output by the generation model;

[0035] A query module, used to input the query condition into the target API interface for query, and obtain the query result fed back by the target API interface;

[0036] The second input module is used to input the query result and the input data into the generation model for data processing to obtain a data processing result.

[0037] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0038] Filtering from a preset query API list according to a target intent to obtain a pre-selected interface list, wherein the target intent is determined based on user input data, and the pre-selected interface list includes various query API interfaces associated with the target intent;

[0039] Input the input data, the target intent and the pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model;

[0040] Input the query condition into the target API interface to perform a query, and obtain the query result fed back by the target API interface;

[0041] The query result and the input data are input into the generation model for data processing to obtain a data processing result.

[0042] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0043] Filtering from a preset query API list according to a target intent to obtain a pre-selected interface list, wherein the target intent is determined based on user input data, and the pre-selected interface list includes various query API interfaces associated with the target intent;

[0044] Input the input data, the target intent and the pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model;

[0045] Input the query condition into the target API interface to perform a query, and obtain the query result fed back by the target API interface;

[0046] The query result and the input data are input into the generation model for data processing to obtain a data processing result.

[0047] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0048] Filtering from a preset query API list according to a target intent to obtain a pre-selected interface list, wherein the target intent is determined based on user input data, and the pre-selected interface list includes various query API interfaces associated with the target intent;

[0049] Input the input data, the target intent and the pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model;

[0050] Input the query condition into the target API interface to perform a query, and obtain the query result fed back by the target API interface;

[0051] The query result and the input data are input into the generation model for data processing to obtain a data processing result.

[0052] The above data processing method, device, computer equipment, medium and program product perform text classification on the user's input data to obtain the user's target intention, and input the input data, the target intention and the pre-selected interface list into the generation model, and use the analysis and data processing capabilities of the generation model once to obtain the target API interface and query conditions output by the generation model; further, the query conditions are input into the target API interface for query, and the query results fed back by the target API interface are obtained; the query results and the input data are input into the generation model, and the analysis and data processing capabilities of the generation model are used again, so that the generation model uses the query results as a reference, analyzes and processes the user's input data, and uses the generated corresponding data processing results as output results. In the related art, the generation model receives the user's input data and directly generates the output results; compared with the related art, in the scheme of the present application, the process of the generation model receiving the user's input data and directly generating the output results is split into three steps: determining the target API interface and query conditions, obtaining the query results and determining the output results, and the analysis and data processing capabilities of the generation model are used twice, so that the quality of the output results generated by the generation model is higher.

[0053] Furthermore, the related art uses direct structured query codes to query the database, while the present application uses a generative model to parse input data to obtain query conditions, which are parameterized data, and calls the target API interface to query the parameters. Parameterized data transmission allows the data passed to the API interface to be dynamically adjusted as needed without changing the overall data structure, so that the generative model can more flexibly respond to different business scenarios and changes in demand, thereby reducing the probability of request failure due to failure to generate structured data or non-standard generation, thereby improving the fault tolerance of the generative model. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] FIG1 is an application environment diagram of a data processing method in one embodiment;

[0056] FIG2 is a schematic flow chart of a data processing method in one embodiment;

[0057] FIG3 is a logical diagram of data processing in one embodiment;

[0058] FIG4 is a schematic flow chart of steps for determining target intent in one embodiment;

[0059] FIG5 is a schematic diagram of a flow chart of a step of determining a selection result in one embodiment;

[0060] FIG6 is a schematic flow chart of a query result determination step in one embodiment;

[0061] FIG7 is a block diagram of a data processing device in one embodiment;

[0062] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0064] The data processing method provided in the embodiment of the present application is applied to a computer device; wherein the computer device is configured with a generation model, the computer device receives the user's input data, and processes the user's input data, and the generation model generates output results for the processed data and feeds them back to the user. In one possible scenario, the computer device may be a terminal device; the terminal device may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. When the computer device is a terminal device, the computer device may directly receive the user's input data and directly display the generated output results to the user.

[0065] In another possible scenario, as shown in FIG1 , the computer device may also be a server 104, and the data storage system may store data that the server 104 needs to process; the user's terminal 102 may communicate with the server through a network. The user sends input data to the server 104 through the terminal 102, and the server 104 receives the user's input data and directly feeds back the generated output result to the terminal 102, and the terminal 102 displays the output result to the user.

[0066] In an exemplary embodiment, as shown in FIG2 , a data processing method is provided, which is described by taking the method applied to the computer device in FIG1 as an example, and includes the following steps 02 to 05, wherein:

[0067] Step 02: Filter from the preset query API list according to the target intent to obtain a pre-selected interface list. The target intent is determined based on the user's input data. The pre-selected interface list includes various query API interfaces associated with the target intent.

[0068] For the embodiments of the present application, when the computer device receives the input data from the user, it performs text classification on the input data to obtain the target intent of the user. Specifically, the computer device performs text classification on the input data by calling a pre-trained text classification supervision model to obtain the target intent of the user. The target intent includes a request function and a request parameter type. The request function is what function you want to achieve. For example, the request function can be a query function or a generation function, or a query function and a generation function. The specific type of the request function is not specifically limited in the embodiments of the present application. The request parameter type is the type of data that the generation model needs to process. The specific division of the request parameter type is not specifically limited in the embodiments of the present application.

[0069] Specifically, the preset query API list includes multiple query API (Application Programming Interface) interfaces; each query API interface corresponds to a query object, and the query object can be a database, a website, a search engine, etc. The specific type of the query object is not specifically limited in the embodiment of the present application. By calling the query API interface and entering the query conditions, the query results fed back by the query API interface can be obtained. Each query API interface is associated with a functional description and a required parameter type.

[0070] After determining the user's target intent, the preset query API list is screened based on the target intent to obtain various query API interfaces associated with the target intent, and a pre-selected list is constructed based on the various query API interfaces associated with the target intent. The screening process is specifically as follows: for any query API interface, the function description of any query API interface is compared with the request function in the target intent to obtain a first comparison result; the requirement parameter type of any query API interface is compared with the request parameter type in the target intent to obtain a second comparison result; when at least one representation comparison in the first comparison result and the second comparison result matches, any query API interface is determined to be a query API interface associated with the target intent.

[0071] Step 03: Input the input data, target intent, and pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model.

[0072] For the embodiment of the present application, the generation model is a pre-trained model. The user's input data, the target intent determined for the user's input data, and the pre-selected list constructed by step 02 are input into the generation model, and the generation model's understanding and analysis capabilities are used to comprehensively analyze the input content, thereby obtaining the target API interface determined from the pre-selected API list and the query conditions determined from the user's input data output by the generation model. The target API interface is the query API interface selected by the generation model that best matches the user's actual needs, that is, the query API interface that needs to be actually queried later.

[0073] Furthermore, there may be multiple target API interfaces and multiple query conditions, and each target API interface corresponds to at least one query condition. The query condition may include at least one conditional limitation, such as a specific limitation on the request parameter type. For example, the query condition may be a conditional limitation on the time or quantity of the request parameter type; the query condition may also be a conditional limitation on the visualization of the output results finally generated by the generation model, such as organizing the data into a table or a line graph. In the embodiment of the present application, the specific content of the query condition is not specifically limited.

[0074] Step 04: Enter the query conditions into the target API interface for query and obtain the query results fed back by the target API interface.

[0075] For the embodiment of the present application, the computer device calls the target API interface and inputs the query conditions and request parameter types into the target API interface for data query. The target API interface performs data query in the corresponding query object based on the query conditions and request parameter types, and feeds back the query results to the computer device.

[0076] Step 05: Input the query results and input data into the generation model for data processing to obtain data processing results.

[0077] For the embodiment of the present application, after obtaining the query result fed back by the target API interface through step 04, the user's input data, the determined target intent, and the query result are input into the generation model again, so that the generation model uses the query result as a reference, analyzes and processes the user's input data, and uses the generated corresponding data processing result as the output result. In the embodiment of the present application, the generation model can be an LLM (Large Language Model).

[0078] In the above data processing method, text classification is performed on the user's input data to obtain the user's target intent, and the input data, target intent and pre-selected interface list are input into the generation model, and the analysis and data processing capabilities of the generation model are used once to obtain the target API interface and query conditions output by the generation model; further, the query conditions are input into the target API interface for query to obtain the query results fed back by the target API interface; the query results and input data are input into the generation model, and the analysis and data processing capabilities of the generation model are used again, so that the generation model uses the query results as a reference, analyzes and processes the user's input data, and generates the corresponding data processing results as output results. In the related art, a generation model receives input data from a user and directly generates output results; compared with the related art, in the solution of the present application, the process of a generation model receiving input data from a user and directly generating output results is split into three steps: determining a target API interface and query conditions, obtaining query results, and determining output results, and the analysis and data processing capabilities of the generation model are utilized twice, so that the quality of the output results generated by the generation model is higher; and, in the related art, a direct structured query code is used to query a database, while in the present application, a generation model is used to parse input data to obtain query conditions, the query conditions are parameterized data, and the target API interface is called to query the parameters, and parameterized data transmission allows the data passed to the API interface to be dynamically adjusted as needed without changing the overall data structure, so that the generation model can more flexibly respond to different business scenarios and demand changes, thereby reducing the probability of request failures due to failure to generate structured data or non-standard generation, thereby improving the fault tolerance of the generation model.

[0079] In one embodiment, before step 02, a step of determining the target intention is also included; referring to FIG. 3 , the step of determining the target intention may specifically include steps 011 to 014, wherein:

[0080] Step 011, receive input data, parse the input data, and obtain the initial intent.

[0081] The user's output data includes the initial data initially input by the user and may also include supplementary data. If the initial data input by the user cannot match the intent template, it means that the initial data input by the user is incomplete, and the user needs to enter supplementary data. After the user enters the supplementary data, the computer device parses the supplementary data and the initial data as a new input data.

[0082] Specifically, the computer device performs text classification on the input data by calling a pre-trained text classification supervision model to obtain the user's initial intention.

[0083] Step 012: Match each intent template with the initial intent in turn;

[0084] Step 013: If there is an intention template corresponding to the initial intention, the initial intention is determined as the target intention;

[0085] Step 014: If there is no intent template corresponding to the initial intent, a second prompt message is generated and the second prompt message is fed back to the requesting end.

[0086] Specifically, multiple intent templates are pre-set, and each intent template includes a function sub-template and a parameter type sub-template; for each intent template, the function sub-template is matched with the initial intent in turn, and the parameter type sub-template is matched with the request parameter type, that is, when the initial intent is matched based on each intent template, for the initial intent and each intent template, the request function is matched with the function sub-template, and the request parameter type is matched with the parameter type sub-template. Among them, the function sub-template includes at least one function that can be realized, such as a query function; the parameter type sub-template is the parameter type required to realize the corresponding function. Among them, when the request function is the same as at least one function in the function sub-template, it indicates that the request function matches the function sub-template; when the request parameter type matches at least one parameter type in the parameter type sub-template, it indicates that the request parameter type matches the parameter type sub-template.

[0087] If there is a function sub-template of the intent template that matches the requested function of the initial intent, and a parameter type sub-template that matches the requested parameter type, then it is determined that the intent template matches the initial template; at this time, the initial template is determined as the target intent.

[0088] If there is no intent template that matches the initial intent, it means that the user's input data is unclear. At this time, a second prompt information is generated and fed back to the user; the second prompt information is used to prompt the user to input additional data or modify the initial data. After the user supplements the input data, the new input data is resent to the computer device, and the computer device re-executes the step of determining the target intent based on the new input data.

[0089] In one embodiment, referring to FIG. 4 , step 02 may specifically include step 021 and step 022, wherein:

[0090] Step 021: construct a first prompt template based on input data, target intent, and a pre-selected interface list;

[0091] Step 022: Input the first prompt template into the generation model to obtain the selection result output by the generation model, where the selection result includes the target API interface and the query condition.

[0092] Specifically, a Prompt template is generated as the first prompt template based on the user's input data, the target intent determined in steps 011 - 013 , and the pre-selected interface list. It can help users interact with the generated model more effectively to obtain the desired output. The design of the prompt template involves many aspects, including but not limited to clarifying instructions, providing background information, setting roles and goals, etc., to ensure that the model can understand and execute the user's target intentions.

[0093] In another embodiment, a first API interface prompt template is constructed based on input data, target intent, and a pre-selected interface list; the first API interface prompt template is input into a generation model to obtain a target API interface output by the generation model. Further, a first conditional prompt template is constructed based on input data, target intent, and target API interface; the first conditional prompt template is input into the generation model to obtain a query condition output by the generation model.

[0094] In one example, the first API interface prompt template constructed by the present application is shown in Table (1).

[0095] Table (1)

[0096]

[0097] In one example, the first condition prompt template constructed by the present application is shown in Table (2).

[0098] Table (2)

[0099]

[0100] Furthermore, the output result of the generation model according to the first prompt template is the selection result, and the selection result specifically includes the target API interface and the query condition.

[0101] For the embodiment of the present application, when calling the generated model, the API interface corresponding to the generated model is called, and a few-shot configuration (prompt template) is prepared for the API interface, supporting the model to self-generate few-shot samples (prompt template), thereby improving the stability and fault tolerance of the generated model. In addition, in order to reduce the dependence on generative structure data in related technologies, all query behaviors presented in the form of SQL code in this application are converted into calls to the API interface through query conditions (parameters). The entire process is completed entirely by parameter passing, minimizing the impact of the generated model generating unexecutable content.

[0102] On the one hand, since the first prompt template needs to be input into the generation model through the API interface of the generation model, the first prompt template needs to comply with the API format and data type; on the other hand, the query conditions in the selection result output by the generation model need to be input into the target API interface for data query; therefore, in step 03, the format and data type of the selection result output by the model are required to be relatively high. In order to determine the validity of the selection result, the embodiment of the present application also includes a verification step for the selection result output by the generation model in step 03.

[0103] In one embodiment, the step of verifying the selection result output by the generation model in step 03 may specifically include: inputting the first prompt template into the generation model N times to obtain N selection results, where N>0. If the N selection results are not exactly the same, then comparing the difference items in the N selection results, and generating first prompt information based on the difference items, and feeding back the first prompt information to the requesting end; if the N selection results are exactly the same, then determining that the selection result is a valid selection result.

[0104] Specifically, that is to say, the constructed first prompt template is input into the generation model N times respectively, and the selection result of each selection output by the generation model is obtained, that is, N selection results. Then all the selection results are compared, and the validity of the selection results is determined based on the comparison results; specifically, the target API interfaces in the N selection results are compared to obtain the API comparison results of the N selection results; the query conditions in the N selection results are compared to obtain the condition comparison results of the N selection results. When the API comparison results of the N selection results indicate that the target API interfaces in each selection result are exactly the same, and the condition comparison results in the N selection results indicate that the query conditions in each selection result are exactly the same, it is considered that the N selection results are exactly the same; at this time, the selection result is a valid selection result.

[0105] In the case where the API comparison results of the N selection results indicate that the target API interfaces in each selection result are not completely the same, and / or the condition comparison results of the N selection results indicate that the query conditions in each selection result are not completely the same, the N selection results are considered to be not completely the same; at this time, any selection result is an invalid selection result. Furthermore, based on the difference items in the N selection results, a first prompt information is generated, and the first prompt information is fed back to the user to prompt the user to input supplementary information; or based on the user's selection instruction, the query condition and / or API interface list are determined from the difference items, so as to be used as a valid selection result.

[0106] In one embodiment, referring to FIG. 5 , in step 04, the query condition is input into the target API interface for query, which specifically includes steps 041 and 042, wherein:

[0107] Step 041: If the N selection results are exactly the same, the query condition is input into the functional API interface to obtain the standard query condition fed back by the functional API interface, where the standard query condition is data processed by standard formatting;

[0108] Step 042: input the standard query conditions into the target API interface for query, and obtain the query results fed back by the target API interface.

[0109] Specifically, multiple functional API interfaces are pre-configured, wherein the functional API interfaces include but are not limited to API interfaces for standard formatting, API interfaces for data visualization, and API interfaces for data calculation. In step 041, the functional interface is an API interface for standard formatting, and the query conditions in the effective selection results are input into the API interface for standard formatting to obtain the standard query conditions fed back by the functional API interface after standard formatting.

[0110] Furthermore, the standard query condition obtained in step 041 is input into the target API interface for query, and the query result fed back by the target API interface is obtained.

[0111] In one embodiment, step 05 may specifically include: constructing a second prompt template based on the query result and the input data; and inputting the second prompt template into the generation model so that the generation model generates an output result.

[0112] Specifically, based on the query result obtained in step 04, a new Prompt template is constructed with the user's input data as the second prompt template, and the second prompt template is input into the generation model so that the generation model generates an output result. The second prompt template can facilitate the generation model to more accurately understand the user's needs, and judge the most appropriate post-processing steps and visualization processing accordingly; then the generation model calls the corresponding functional API interface to perform post-processing steps and visualization processing, and obtains the final output result, and then returns the output result to the user. Among them, the output result can be text data, or data in the format of voice, image, video, and table.

[0113] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0114] Based on the same inventive concept, the embodiment of the present application also provides a data processing device for implementing the data processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more data processing device embodiments provided below can refer to the limitations on the data processing method above, and will not be repeated here.

[0115] In another exemplary embodiment, a data processing method is provided, which is described by taking the method applied to the computer device in FIG. 1 as an example.

[0116] The user's potential query and request intentions are locally customized to obtain multiple intent templates; the intent template is a customized expected intent. After receiving the user's input data, the generated model assists the text classification supervision model to analyze the user's input data to determine whether it is a customized intent template (expected intent). If the input data does not match any customized intent template, the computer device will consider the input data to be an "other" type request, that is, it does not belong to any known category. If the user's input data matches one of the intent templates, the intent template is determined to be the user's target intent, and the target intent will be routed to the subsequent processing flow by the computer device to take corresponding actions.

[0117] (There are two different types of APIs for local storage. The API in this step receives input parameters and returns them to the caller (generates the model) after formatting (standard) the parameters. The caller then passes the returned formatted parameters to the API that executes the query command).

[0118] After confirming the user's target intent, a pre-selected interface list containing the possible corresponding target intent is determined from the multiple query API interfaces prepared locally, and the pre-selected interface list includes the various query API interfaces that may correspond to the target intent, as well as the relevant parameters, input formats and data types corresponding to each query API interface. Among them, each query API interface is completely executed by receiving parameters rather than query commands.

[0119] Create a Prompt template as the first prompt template, which contains the user's original request (input data), the result of intent analysis (target intent), and all the API interface information mentioned above (pre-selected interface list). This first prompt template is then input into the pre-trained generative model, which will select the most appropriate API interface (target API interface) and corresponding parameter values ​​(query conditions) from the pre-selected interface list based on the provided format and information; this process has high requirements for input and output formats: on the one hand, since the input parameters must be directly input into the API interface corresponding to the current generative model, the format and data type must meet the requirements of API interface I; on the other hand, the query conditions selected by the generative model will also be used as input parameters for querying the API, so the format and data type also require precision.

[0120] Therefore, after obtaining the selection results (query conditions and target API interfaces) output by the generation model, the selection results are connected to the a posteriori process based on the generation model, which is responsible for checking the correctness and consistency of the output. That is, in the first prompt template, the generation model is required to verify the output selection results, and multiple calls are made to generate multiple output selection results, and the consistency between the selection results is compared. And if necessary, they are corrected and rolled back. If there are multiple available choices, the user is required to make a selection. If it is impossible to provide input that meets the format requirements, the wrong or uncertain parameters are listed, and the input is returned to the initial input stage, requiring the user to re-enter according to the listed parameters.

[0121] Parse the parameter values ​​and target API interface output by the generated model, obtain the corresponding parameter values ​​and target API interface based on the parsed results, input the parameter values ​​into the corresponding target API interface for query, and after obtaining the query results, combine the query results with the user's original request text (input data) to construct a new Prompt template (second prompt template). The second prompt template contains all the key information requested by the user and the feedback after the system executes the operation, so as to generate a more accurate understanding of the user's actual needs, and judge the most appropriate post-processing steps and visualization processing steps accordingly. Finally, execute these post-processing steps and visualization processing steps, and return the output results to the user.

[0122] In the scheme of the embodiment of the present application, a self-check, fallback, and skip module based on the generative model is added, and a Few-shot configuration is prepared for the API interface of the generative model, which supports the model to self-generate Few-shot samples (the first prompt template and the second prompt template), improves the stability and fault tolerance of the generative model, and improves the accuracy of the output. When setting the callable API interface, in order to minimize the dependence on generative structured data, all query behaviors presented in the form of SQL code are converted into calls to the API interface. The entire process is completed completely by parameter passing, which minimizes the impact of the generative model generating unexecutable content.

[0123] In an exemplary embodiment, as shown in FIG. 7 , a data processing device is provided, the data processing device comprising a screening module 701, a first input module 702, a query module 703 and a second input module 704, wherein:

[0124] A screening module 701 is used to screen from a preset query API list according to a target intent to obtain a pre-selected interface list, wherein the target intent is determined based on user input data, and the pre-selected interface list includes various query API interfaces associated with the target intent;

[0125] The first input module 702 is used to input the input data, target intent and pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model;

[0126] The query module 703 is used to input the query conditions into the target API interface for querying and obtain the query results fed back by the target API interface;

[0127] The second input module 704 is used to input the query result and the input data into the generation model for data processing to obtain the data processing result.

[0128] In one embodiment, the first input module 702 is specifically configured to:

[0129] Building a first prompt template based on the input data, the target intent, and the pre-selected interface list;

[0130] The first prompt template is input into the generation model to obtain a selection result output by the generation model, where the selection result includes a target API interface and a query condition.

[0131] In the above-mentioned data processing device, text classification is performed on the user's input data to obtain the user's target intent, and the input data, target intent and pre-selected interface list are input into the generation model, and the analysis and data processing capabilities of the generation model are used once to obtain the target API interface and query conditions output by the generation model; further, the query conditions are input into the target API interface for query to obtain the query results fed back by the target API interface; the query results and input data are input into the generation model, and the analysis and data processing capabilities of the generation model are used again, so that the generation model uses the query results as a reference, analyzes and processes the user's input data, and generates the corresponding data processing results as output results. In the related art, a generation model receives input data from a user and directly generates output results; compared with the related art, in the solution of the present application, the process of a generation model receiving input data from a user and directly generating output results is split into three steps: determining a target API interface and query conditions, obtaining query results, and determining output results, and the analysis and data processing capabilities of the generation model are utilized twice, so that the quality of the output results generated by the generation model is higher; and, in the related art, a direct structured query code is used to query a database, while in the present application, a generation model is used to parse input data to obtain query conditions, the query conditions are parameterized data, and the target API interface is called to query the parameters, and parameterized data transmission allows the data passed to the API interface to be dynamically adjusted as needed without changing the overall data structure, so that the generation model can more flexibly respond to different business scenarios and demand changes, thereby reducing the probability of request failures due to failure to generate structured data or non-standard generation, thereby improving the fault tolerance of the generation model.

[0132] In one embodiment, the data processing device further includes a validity verification module, and the validity verification module is specifically used to:

[0133] Input the first prompt template into the generation model N times to obtain N selection results, N>0;

[0134] If the N selection results are not completely the same, the difference items in the N selection results are compared, and first prompt information is generated based on the difference items, and the first prompt information is fed back to the requesting end.

[0135] In one embodiment, the query module 703 is specifically used to:

[0136] If the N selection results are exactly the same, the query conditions are input into the target API interface for query, and the query results fed back by the target API interface are obtained.

[0137] In one embodiment, the query module 703 is further configured to:

[0138] Input the query conditions into the functional API interface to obtain the standard query conditions fed back by the functional API interface. The standard query conditions are data processed by standard formatting.

[0139] Enter the standard query conditions into the target API interface for query.

[0140] In one embodiment, the second input module is specifically used for:

[0141] Building a second prompt template based on the query result and the input data;

[0142] The second prompt template is input into the generation model for data processing to obtain a data processing result.

[0143] In one embodiment, the data processing device further includes a target intention determination module, and the target intention determination module is specifically used to:

[0144] Receive input data, parse the input data, and obtain the initial intent;

[0145] Match each intent template with the initial intent in turn;

[0146] If there is an intention template corresponding to the initial intention, the initial intention is determined as the target intention;

[0147] If there is no intent template corresponding to the initial intent, a second prompt message is generated and the second prompt message is fed back to the requesting end.

[0148] In one embodiment, the target intention determination module is specifically used to:

[0149] For each intent template, the function sub-template is matched with the initial intent in turn, and the parameter type sub-template is matched with the request parameter type.

[0150] Each module in the above data processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0151] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0152] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0153] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0154] Filtering from a preset query API list according to the target intent to obtain a pre-selected interface list, the target intent is determined based on the user's input data, and the pre-selected interface list includes various query API interfaces associated with the target intent;

[0155] Input the input data, target intent, and pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model;

[0156] Enter the query conditions into the target API interface to query and obtain the query results fed back by the target API interface;

[0157] The query results and input data are input into the generation model for data processing to obtain data processing results.

[0158] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0159] Filtering from a preset query API list according to the target intent to obtain a pre-selected interface list, the target intent is determined based on the user's input data, and the pre-selected interface list includes various query API interfaces associated with the target intent;

[0160] Input the input data, target intent, and pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model;

[0161] Enter the query conditions into the target API interface to query and obtain the query results fed back by the target API interface;

[0162] The query results and input data are input into the generation model for data processing to obtain data processing results.

[0163] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0164] Filtering from a preset query API list according to the target intent to obtain a pre-selected interface list, the target intent is determined based on the user's input data, and the pre-selected interface list includes various query API interfaces associated with the target intent;

[0165] Input the input data, target intent, and pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model;

[0166] Enter the query conditions into the target API interface to query and obtain the query results fed back by the target API interface;

[0167] The query results and input data are input into the generation model for data processing to obtain data processing results.

[0168] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0169] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0170] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0171] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data processing method, characterized in that: The method comprises: Filtering from a preset query API list according to a target intent to obtain a pre-selected interface list, wherein the target intent is determined based on user input data, and the pre-selected interface list includes various query API interfaces associated with the target intent; Input the input data, the target intent and the pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model; Input the query condition into the target API interface to perform a query, and obtain the query result fed back by the target API interface; The query result and the input data are input into the generation model for data processing to obtain a data processing result.

2. The method according to claim 1, characterized in that The step of inputting the input data, the target intent, and the pre-selected interface list into the generation model to obtain the target API interface and query conditions output by the generation model includes: Constructing a first prompt template based on the input data, the target intent, and the pre-selected interface list; The first prompt template is input into the generation model to obtain a selection result output by the generation model, wherein the selection result includes a target API interface and a query condition.

3. The method according to claim 2, characterized in that The method further comprises: Input the first prompt template into the generation model N times to obtain N selection results, where N>0; If the N selection results are not completely the same, the difference items in the N selection results are compared, and first prompt information is generated based on the difference items, and the first prompt information is fed back to the requesting end.

4. The method according to claim 3, characterized in that The step of inputting the query condition into the target API interface for querying includes: If the N selection results are exactly the same, the query condition is input into the target API interface for query, and the query result fed back by the target API interface is obtained.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Input the query condition into the functional API interface to obtain the standard query condition fed back by the functional API interface, wherein the standard query condition is data processed by standard formatting; The standard query conditions are input into the target API interface for query.

6. The method according to any one of claims 1 to 4, characterized in that: The step of inputting the query result and the input data into the generation model for data processing to obtain a data processing result includes: Building a second prompt template based on the query result and the input data; The second prompt template is input into the generation model for data processing to obtain a data processing result.

7. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Receiving input data, parsing the input data, and obtaining an initial intent; Matching each intent template with the initial intent in turn; If the intention template corresponding to the initial intention exists, determining the initial intention as the target intention; If the intent template corresponding to the initial intent does not exist, second prompt information is generated and the second prompt information is fed back to the requesting end.

8. The method according to claim 7, characterized in that The intent template includes a function sub-template and a parameter type sub-template, the initial intent includes a request function and a request parameter type, and sequentially matching each intent template with the initial intent includes: For each intent template, the function sub-template is matched with the initial intent in turn, and the parameter type sub-template is matched with the request parameter type.

9. A data processing device, characterized in that: The device comprises a screening module, a first input module, a query module and a second input module, wherein: A screening module, used to screen from a preset query API list according to a target intent to obtain a pre-selected interface list, wherein the target intent is determined based on user input data, and the pre-selected interface list includes various query API interfaces associated with the target intent; A first input module, used to input the input data, the target intent and the pre-selected interface list into the generation model, and obtain the target API interface and query conditions output by the generation model; A query module, used to input the query condition into the target API interface for query, and obtain the query result fed back by the target API interface; The second input module is used to input the query result and the input data into the generation model for data processing to obtain a data processing result.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Large model plug-in calling method and device, equipment and medium

    CN117112065A

  • Data query method and device, computer equipment and storage medium

    CN117648427A

  • Data query method and device of business system and computer equipment

    CN117648711A

  • Question answering method and device based on business, electronic equipment and storage medium

    CN117786071A

  • Question and answer data processing method and device, electronic equipment and storage medium

    CN118113831A

Cited By

  • Parameter optimization method based on large model, electronic equipment and storage medium

    CN120578692A