Data question answering system and calling method thereof

Through the calling method of the data question and answer system, multiple LLM models are called by plug-ins for orchestration, solving the problem of poor application application and comprehensive organization of response information of existing LLM models, and achieving efficient data question and answer and model adaptation.

CN119045928BActive Publication Date: 2025-03-25中科先进(深圳)集成技术有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411519026.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-25
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

There are problems with poor application in existing LLM models, and it is impossible to achieve horizontal connection and comprehensive organization of response information of multiple LLM models.

Method used

Provide a calling method for a data question and answer system. By obtaining the orchestration results and orchestration order in the call instructions, selecting appropriate plug-ins to download from the plug-in market or directly read the plug-ins in the database, calling multiple LLM models for orchestration, realizing adaptation to different functions and comprehensive data question and answer.

Benefits of technology

The adaptive calls to different LLM models are realized, which saves the investment cost of model upgrades, avoids the problem of restarting or interrupting model access during the upgrade process, and improves the applicability and response efficiency of the data question and answer system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045928B_ABST
    Figure CN119045928B_ABST
Patent Text Reader

Abstract

The present application discloses a data question-and-answer system and a calling method thereof, wherein the calling method of the data question-and-answer system comprises: obtaining a calling instruction, wherein the calling instruction comprises an arrangement result and an arrangement order; obtaining a target plug-in based on the arrangement result of the calling instruction, wherein the target plug-in comprises a first plug-in downloaded through a plug-in market, and / or a second plug-in pre-stored in a database, and the plug-in market realizes data transmission with the database through a plug-in interface; based on the arrangement order of the calling instruction, calling at least one LLM model using the target plug-in. The calling instruction obtained by the present application can select the cached second plug-in to realize the call to the LLM model, or select the first plug-in downloaded from the plug-in market through the plug-in interface to realize the call to the LLM model, which can realize the call of a single LLM model or multiple LLM models, and then realize the adaptive call of different LLM models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data question answering technology, and in particular to a data question answering system and a calling method thereof. Background Art

[0002] LLM (Large Language Model) refers to complex machine learning models that are trained on large amounts of text data and are able to understand and generate natural language. These models typically use deep learning techniques, especially the Transformer architecture, to handle the complexity of language.

[0003] The vast majority of existing LLM applications are application software designed around a specified LLM large model. The specified LLM model may have been enhanced in a certain area, while the capabilities in other areas will be relatively weakened, thus limiting the current application capabilities.

[0004] On the other hand, the response information of the current LLM application only comes from the content produced by the specified LLM large model. It is impossible to achieve horizontal connection of the response information of multiple LLM large models, and to comprehensively organize the response information of different LLM models to obtain the optimal response information. There is no ability to horizontally connect between LLM models. Summary of the invention

[0005] This application provides a data question answering system and a calling method thereof, which can solve the problem of poor applicability of the existing LLM model.

[0006] In a first aspect, the present application provides a method for calling a data question-answering system, the method comprising:

[0007] Obtaining a calling instruction, the calling instruction includes an arrangement result and an arrangement order;

[0008] Acquire a target plug-in based on the arrangement result of the call instruction, wherein the target plug-in includes a first plug-in downloaded from a plug-in market, and / or a second plug-in pre-stored in a database, and the plug-in market realizes data transmission with the database through a plug-in interface;

[0009] Based on the arrangement order of the calling instructions, at least one LLM model is called by using the target plug-in.

[0010] Furthermore, the step of obtaining the target plug-in based on the orchestration result of the call instruction includes:

[0011] Obtaining an arrangement result of the call instruction, wherein the arrangement result is that multiple LLM models are required for arrangement, or the arrangement result is that multiple LLM models are not required for arrangement;

[0012] In response to the orchestration result requiring multiple LLM models for orchestration, obtaining a plurality of first plug-ins and / or a plurality of second plug-ins;

[0013] In response to the arrangement result being that multiple LLM models are not required for arrangement, a second plug-in corresponding to the calling instruction is obtained.

[0014] Furthermore, based on the arrangement order of the calling instructions, the step of using the target plug-in to call the corresponding LLM model includes:

[0015] Obtaining a scheduling sequence of call instructions, wherein the scheduling sequence includes serial call scheduling and / or parallel call scheduling;

[0016] Based on the arrangement order, the first plug-in or the second plug-in is used to call the corresponding LLM model for arrangement to obtain the LLM large model, so as to obtain the data reply information generated by the LLM large model based on the calling instruction.

[0017] Further, based on the arrangement order, the first plug-in or the second plug-in calls the corresponding LLM model to arrange the LLM large model to obtain the data reply information generated by the LLM large model based on the calling instruction, including:

[0018] Obtain the target plug-in at the first priority in the arrangement order, call the LLM model corresponding to the target plug-in at the first priority in the arrangement order, so as to obtain data information generated by the LLM model based on the call instruction, the data information including prompt words and question and answer results;

[0019] According to the arrangement order, the data information is used as the data input to obtain the question and answer results generated by the LLM model called by the target plug-in at the last position in the arrangement order. The question and answer results are the data reply information.

[0020] Furthermore, the method further comprises:

[0021] Based on the preset configuration, data interfaces corresponding to several LLM models are generated, and different LLM models transmit data through the data interfaces; wherein the data interfaces include API interfaces.

[0022] Furthermore, the step of obtaining the target plug-in based on the orchestration result of the call instruction includes:

[0023] Get the request code based on the calling instruction;

[0024] Use the request code to obtain the question and answer parameters, which are used to represent the plug-in interface class;

[0025] In response to the question and answer parameters satisfying the preset conditions, the plug-in interface class corresponding to the question and answer parameters is called, and the target plug-in is downloaded through the plug-in interface class.

[0026] Further, based on the arrangement order of the calling instructions, the step of using the target plug-in to call at least one LLM model includes:

[0027] Get the target plugin's loading data packet;

[0028] Unzip the loaded data package to obtain the configuration parameters;

[0029] Get the class under the target path through the configuration parameters to instantiate the class under the target path.

[0030] Further, the method comprises:

[0031] Based on the interface functions, several plug-in interface classes are defined, and several plug-in interface classes form a plug-in interface;

[0032] Get the plug-in interface class corresponding to the calling instruction, and dynamically load the plug-in interface class.

[0033] Furthermore, the method further comprises:

[0034] Customize plugin management parameters;

[0035] In response to the orchestration result based on the call instruction, a target plug-in is obtained, and a management operation is performed on the target plug-in using the plug-in management parameter, where the management operation includes installation, operation, stop and uninstallation.

[0036] A second aspect of the present application provides a data question answering system, the data question answering system comprising:

[0037] An acquisition module, which is used to acquire a calling instruction, and the calling instruction includes an arrangement result and an arrangement order;

[0038] A configuration module, the configuration module is used to obtain a target plug-in based on the arrangement result of the call instruction, wherein the target plug-in includes a first plug-in downloaded from the plug-in market and / or a second plug-in pre-stored in the database;

[0039] Plug-in interface: The plug-in interface is used to realize data transmission between the plug-in market and the database;

[0040] The configuration module is also used to call at least one LLM model using the target plug-in based on the arrangement order of the calling instructions.

[0041] Different from the prior art, the present application can obtain the corresponding arrangement result and arrangement order by obtaining the calling instruction. The arrangement result can be used to determine whether multiple LLM models are needed for arrangement, and the arrangement order of multiple LLM models can be determined by the arrangement order. Moreover, the present application selects the cached second plug-in based on the calling instruction to implement the call to the LLM model, or selects the first plug-in downloaded from the plug-in market through the plug-in interface to implement the call to the LLM model, which can implement the call of a single LLM model or multiple LLM models, and then implement the adaptive call of different LLM models. At the same time, the present application can save the investment cost of model upgrade by setting the plug-in interface to download the first plug-in and using the first plug-in to call the LLM model.

[0042] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be 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 creative work.

[0044] Figure 1 This is a flowchart of an embodiment of a calling method of the data question and answer system of the present application;

[0045] Figure 2 yes Figure 1 A schematic diagram of a specific flow chart of the first embodiment of step S12;

[0046] Figure 3 yes Figure 1 A schematic diagram of a specific flow chart of the first embodiment of step S13;

[0047] Figure 4 yes Figure 3 A specific flow chart of step S132 in an embodiment;

[0048] Figure 5 yes Figure 1 A schematic diagram of a specific flow chart of the second embodiment of step S12;

[0049] Figure 6 yes Figure 1 A schematic diagram of a specific flow chart of the second embodiment of step S13;

[0050] Figure 7 It is a structural diagram of an embodiment of the data question and answer system of the present application;

[0051] Figure 8 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;

[0052] Fig. 9 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0053] In order to enable those skilled in the art to better understand the technical solution of the present application, the data question and answer system and its calling method provided by the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It can be understood that the described embodiments are only 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 ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0054] The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0055] Most of the existing LLM applications are application software designed around a specified LLM large model, which limits their application capabilities. In order to achieve designs with different functional requirements, it is usually necessary to upgrade the LLM model, which requires a lot of time for data training and parameter adjustment. In addition, during the upgrade process, it is necessary to restart or interrupt model access, which makes it difficult to upgrade and maintain the LLM model.

[0056] In order to solve the above-mentioned technical problems, the present application provides a calling method of a data question and answer system, which can download the first plug-in in the plug-in market through the plug-in interface, or directly read the pre-stored second plug-in, and use different plug-ins to call different LLM models without the need to upgrade the model. At the same time, multiple LLM models are arranged based on the arrangement order in the obtained calling instructions to achieve the combination of target functions, thereby completing the comprehensive data question and answer effect.

[0057] See also Figure 1 , Figure 1It is a flow chart of the first embodiment of the calling method of the data question and answer system of the present application. Among them, the execution subject of the calling method of the data question and answer system of the present application can be a data question and answer system. For example, the calling method of the data question and answer system can be executed by a terminal device or a server or other processing device, wherein the data question and answer system can include user equipment (User Equipment, UE), mobile device, user terminal, terminal, cellular phone, wireless phone, personal digital assistant (Personal Digital Assistant, PDA), handheld device, computing device, vehicle-mounted device, wearable device, etc. In some possible implementations, the calling method of the data question and answer system can be implemented by a processor calling computer-readable instructions stored in a memory.

[0058] Specifically, the data question answering system of this embodiment can be found in Figure 7 , Figure 7 This is a schematic diagram of the structure of an embodiment of the data question and answer system of this application. Figure 7 As shown, the data question and answer system 30 of this embodiment includes an acquisition module 31 , a configuration module 32 and a plug-in interface 33 .

[0059] Specifically, the acquisition module 31 of this embodiment is used to acquire a call instruction, wherein the call instruction includes an arrangement result and an arrangement sequence. Optionally, the call instruction of this embodiment can be a request instruction input by a user, or a search question input by a user, etc.

[0060] The configuration module 32 of this embodiment is connected to the acquisition module 31. The configuration module 32 is used to obtain the target plug-in based on the orchestration result of the call instruction, where the target plug-in includes a first plug-in downloaded through the plug-in market and / or a second plug-in pre-stored in the database. The plug-in interface 33 of this embodiment is used to realize data transmission between the plug-in market and the database.

[0061] Optionally, the plug-in market of this embodiment may specifically refer to a public plug-in website, especially a regional public plug-in website maintained for users. The data question and answer system 30 has completed integration with the plug-in website. After downloading the corresponding first plug-in, there is no need to restart the data question and answer system 30, and the downloaded first plug-in can be used directly.

[0062] Furthermore, the configuration module 32 of this embodiment is also used to call at least one LLM model using the target plug-in based on the arrangement order of the calling instructions, and specifically complete the corresponding data question and answer through at least one LLM model. Optionally, when the number of called LLM models is a single, the data output of the LLM model is the result of the data question and answer; when the number of called LLM models is multiple, the comprehensive data output of multiple LLM models is the result of the data question and answer.

[0063] Specifically, the calling method of the data question answering system in the embodiment of the present disclosure may include the following steps:

[0064] Step S11: Get the calling instruction.

[0065] In this embodiment, the calling instruction is obtained by the acquisition module 31, wherein the calling instruction includes the arrangement result and the arrangement order. Specifically, the calling instruction can be a configuration parameter related to the query and the search question, the arrangement result is used to indicate whether the search question can be answered based on a single LLM model, and the arrangement order is used to indicate the combination of multiple LLM models.

[0066] Step S12: Obtain the target plug-in based on the orchestration result of the calling instruction.

[0067] The target plug-in of this embodiment includes a first plug-in downloaded from the plug-in market and / or a second plug-in pre-stored in the database. The plug-in market realizes data transmission with the database through the plug-in interface 33.

[0068] Specifically, when it is determined based on the arrangement results that the retrieval question can be answered by a single LLM model, the configuration module 32 can directly read the second plug-in pre-stored in the database, and the second plug-in will complete the call to the target LLM model; or, when it is determined that the second plug-in currently cached does not exist and can call the LLM model, the first plug-in in the plug-in market can be downloaded through the plug-in interface 33, and the first plug-in will complete the call to the target LLM model.

[0069] When the retrieval question based on the arrangement result requires a combination of multiple LLM models to conduct data question and answer, the configuration module 32 can directly read at least two second plug-ins pre-stored in the database, and the corresponding second plug-ins complete the call to the target LLM model; or, when it is determined that the currently cached second plug-in does not exist a second plug-in that can call the target LLM model, at least two first plug-ins in the plug-in market can be downloaded through the plug-in interface 33, and the corresponding first plug-in completes the call to the target LLM model; or, when it is determined that the currently cached second plug-in exists a second plug-in that can call some of the target LLM models, the second plug-in is read, and the first plug-in that can call the remaining target LLM models is further downloaded through the plug-in interface 33, and the second plug-in cooperates with the first plug-in to complete the call to all target LLM models.

[0070] Step S13: Based on the arrangement order of the calling instructions, at least one LLM model is called using the target plug-in.

[0071] Among them, when the orchestration result interpretation retrieval problem can be answered by a single LLM model, the orchestration order only includes the call of a single target plug-in; when the orchestration result interpretation retrieval problem requires a combination of multiple LLM models to answer data, the orchestration order includes the call order of multiple target plug-ins.

[0072] Optionally, for the specific process of obtaining the target plug-in based on the orchestration result of the call instruction, please continue to refer to Figure 2 , Figure 2 yes Figure 1 The specific flow chart of the first embodiment of step S12 in FIG. Specifically, the following steps are included:

[0073] Step S121: Obtain the arrangement result of the call instruction.

[0074] The arrangement result of this embodiment is that multiple LLM models are required for arrangement, or the arrangement result is that multiple LLM models are not required for arrangement. Optionally, when it is determined that the arrangement result is that multiple LLM models are not required for arrangement, step S122 is further executed; when it is determined that the arrangement result is that multiple LLM models are required for arrangement, step S123 is further executed.

[0075] Step S122: In response to the compilation result indicating that multiple LLM models are not required for compilation, a second plug-in corresponding to the calling instruction is obtained.

[0076] In response to the arrangement result that multiple LLM models are not needed for arrangement, it can be determined that the retrieval question uses a single LLM model for data question answering, and the plug-in corresponding to the LLM model is the target plug-in.

[0077] Optionally, in this embodiment, multiple second plug-ins pre-stored in the database may correspond to LLM models of different single functions and cover most of the basic question-and-answer functions. Therefore, it is possible to directly read the database and obtain the second plug-in corresponding to the calling instruction to implement the call to the target LLM model. The response information or output information of the target LLM model is the result of the retrieval question, so as to respond to the user.

[0078] Optionally, in other embodiments, when there is no plug-in for calling the target LLM model in the second plug-in pre-stored in the database, it is necessary to download a new plug-in through the plug-in interface 33, that is, download the first plug-in in the plug-in market through the plug-in interface 33, and call the target LLM model through the downloaded first plug-in. The response information or output information of the target LLM model is the result of the retrieval question, so as to respond to the user.

[0079] Step S123: In response to the arrangement result requiring multiple LLM models for arrangement, a plurality of first plug-ins and / or a plurality of second plug-ins are obtained.

[0080] In response to the arrangement result requiring multiple LLM models for arrangement, it can be determined that the retrieval question uses multiple LLM models for data question answering, and the plug-in corresponding to any target LLM model is the target plug-in.

[0081] Optionally, multiple plug-ins are required to call the corresponding LLM model, where the multiple plug-ins can all be second plug-ins pre-stored in the database, or all can be first plug-ins downloaded through the plug-in market, or some can be second plug-ins and the rest can be first plug-ins. Specifically, the corresponding reading or downloading method can be selected according to the LLM model to be called to realize the selection of the corresponding plug-in.

[0082] This embodiment can selectively call the first plug-in and / or the second plug-in by obtaining the orchestration result in the calling instruction, which can meet the needs of different retrieval problems, and the first plug-in downloaded through the plug-in market can be used directly after the download is complete, without the need to upgrade the LLM model, which can save the upgrade cost of the LLM model and avoid the problems caused by restarting or interrupting model access due to the upgrade operation.

[0083] Optionally, the process of using the target plugin to call at least one LLM model based on the order of the call instructions is described in Figure 3 , Figure 3 yes Figure 1 The specific flow chart of the first embodiment of step S13 in FIG. Specifically, the following steps are included:

[0084] Step S131: Obtain the arrangement order of the calling instructions.

[0085] Among them, the arrangement order of this embodiment specifically includes serial call arrangement and / or parallel call arrangement, wherein a single input search question can call and arrange different LLM models in series for data question and answer; or can call and arrange different LLM models in parallel for data question and answer; or can call and arrange some LLM models in series, and call and arrange another part of LLM models in parallel for data question and answer.

[0086] Step S132: Based on the arrangement order, the first plug-in or the second plug-in is used to call the corresponding LLM model to arrange the LLM large model, so as to obtain the data reply information generated by the LLM large model based on the calling instruction.

[0087] Among them, the configuration module 32 of this embodiment determines the calling order of the first plug-in and / or the second plug-in based on the arrangement order, and calls the corresponding LLM model through the first plug-in and / or the second plug-in in turn to generate a new LLM large model, which can be cached in the database. After the first plug-in is downloaded, the first plug-in will be stored in the database as a new second plug-in. When the acquisition module 31 receives a new call instruction and the new call instruction can perform data question and answer through the LLM large model, the corresponding second plug-in can be directly read from the database for arrangement.

[0088] When the present embodiment determines that a search question requires multiple LLM models for combined question answering, the arrangement order in the calling instruction is used to complete the combination of multiple LLM models, wherein the responses of multiple LLM models are summarized and then the LLM model is uniformly called for comprehensive response. The present embodiment can flexibly combine different LLM models based on different input search questions, that is, different input calling instructions, to meet the needs of different search questions, thereby improving the applicability of the data question answering system 30 of the present embodiment.

[0089] Optionally, based on the arrangement order, the first plug-in or the second plug-in calls the corresponding LLM model to arrange the LLM large model, so as to obtain the data reply information generated by the LLM large model based on the calling instruction. Please continue to refer to Figure 4 , Figure 4 yes Figure 3 The specific flow diagram of step S132 in the embodiment of FIG. 1 includes the following steps:

[0090] Step S1321: Obtain the target plug-in at the first priority in the arrangement order, call the LLM model corresponding to the target plug-in at the first priority in the arrangement order, and obtain data information generated by the LLM model based on the calling instruction, wherein the data information includes prompt words and question and answer results.

[0091] Among them, the configuration module 32 of this embodiment obtains the target plug-in located at the first priority in the arrangement order, and uses the target plug-in to call the corresponding LLM model, and then generates data information for the calling instruction through the LLM model, that is, responds to the input search question to obtain prompt words and question and answer results.

[0092] Step S1322: according to the arrangement order, using the data information as data input, obtain the question and answer result generated by the LLM model called by the target plug-in at the last position in the arrangement order, and the question and answer result is the data reply information.

[0093] The calling between different LLM models is to pass the prompt word and question and answer result of the previous LLM model to the next LLM model as the prompt word. Specifically, after the continuous response of multiple LLM models, the question and answer result generated by the last LLM model in the arrangement order is the comprehensive response of the entire LLM model, that is, the data reply information described in step S132.

[0094] This embodiment can use different arrangement methods to freely combine the calls of multiple LLM models, and the multiple LLM models can realize information transmission and continuous processing of tasks.

[0095] Optionally, the configuration module 32 of this embodiment can generate data interfaces corresponding to several LLM models based on a preset configuration, and different LLM models transmit data through the data interface, wherein the data interface includes an API interface. Specifically, this embodiment can adopt a convention-better-than-configuration approach, provide API interfaces for different LLM models for more detailed integration, and thus achieve current limiting, token number statistics, user activity data, unified exception response, and other requirements.

[0096] Optionally, for the specific process of obtaining the target plug-in based on the orchestration result of the call instruction, please continue to refer to Figure 5 , Figure 5 yes Figure 1 The specific flow chart of the second embodiment of step S12 in FIG. Specifically, the following steps are included:

[0097] Step S221: Obtain a request code based on the calling instruction.

[0098] Among them, the user input calling instruction can be regarded as generating a request, and each request will generate a unique request code, usually called request ID, session ID or transaction ID. This unique identifier is used to track and manage the life cycle of the request.

[0099] Step S222: Use the request code to obtain question and answer parameters.

[0100] The question and answer parameters of this embodiment are used to characterize the plug-in interface class.

[0101] Step S223: In response to the question and answer parameters satisfying the preset conditions, the plug-in interface class corresponding to the question and answer parameters is called, and the target plug-in is downloaded through the plug-in interface class.

[0102] Among them, this embodiment pre-places the first question-and-answer parameter associated with the request into the system thread variable, and after obtaining the second question-and-answer parameter using the request code in step S222, determines whether the first question-and-answer parameter is the same as the second question-and-answer parameter. Specifically, when the two are determined to be the same, this embodiment determines that the question-and-answer parameter meets the preset condition, calls the plug-in interface class corresponding to the question-and-answer parameter, and downloads the target plug-in through the plug-in interface class.

[0103] Optionally, this embodiment can use the conditional verification method to make conditional judgments on the plug-in interface class, that is, to implement conditional judgments on the question and answer parameters, wherein the conditional verification method uses SpEL syntax to implement text code calculations of the conditions, which can be implemented by calling a custom Java class or by using conventional multi-objective operations. Spring Expression Language (SpEL) is one of the core technologies of the Spring Framework, which supports querying and operating object graphs at runtime.

[0104] Optionally, the process of using the target plugin to call at least one LLM model based on the order of the call instructions is described in Figure 6 , Figure 6 yes Figure 1 The specific flow chart of the second embodiment of step S13 in FIG. Specifically, the following steps are included:

[0105] Step S231: Obtain the loading data packet of the target plug-in.

[0106] The loading data package of this embodiment may specifically be a plug-in jar package, and different plug-in jar packages correspond to different paths.

[0107] Step S232: decompress the loading data packet to obtain configuration parameters.

[0108] The configuration parameters of this embodiment may be configuration parameters obtained by decompressing the plug-in jar package.

[0109] Step S233: Obtain the class under the target path through the configuration parameters to instantiate the class under the target path.

[0110] Among them, this embodiment can realize dynamic loading of plug-in jar package by inheriting URLClassLoader to realize custom class loader, that is, realize dynamic loading of target plug-in. Specifically, URLClassLoader instantiates the class library of plug-in through Java reflection through the full path of the class, which can ensure that the JAR file contains the class to be loaded and the class path is correct.

[0111] Optionally, this embodiment may also adopt the factory pattern to load and call the corresponding plug-in function through the plug-in name set by the user. In the factory pattern, the work of creating objects is postponed to the classes created by the subclasses, and the subclasses decide which product class should be instantiated. Specifically, by using a common interface to point to the newly created object instead of instantiating the object directly in the code, the code can be more flexible and easy to expand, and the coupling between the application and the class can be reduced.

[0112] This embodiment realizes dynamic loading and importing of Jar packages by dynamically loading plug-in Jar packages without stopping the machine. The target plug-in can be used directly after dynamic loading and importing, which can effectively avoid the problem of restarting the data question and answer system 30 or operation and maintenance intervention caused by LLM model upgrade.

[0113] The data question and answer system 30 of the present application can realize the drag-and-drop method of the web interface to facilitate the arrangement of the calling method of the target plug-in, and supports the arrangement of series, parallel, etc. Among them, the web interface provides a drag-and-drop method to simplify the arrangement configuration of the target plug-in. After the front-end interface is dragged, the back-end interface is requested to implement the configuration work of the plug-in arrangement.

[0114] Optionally, since the target plug-in can be the first plug-in or the second plug-in, when the target plug-in is the first plug-in, it needs to be downloaded through the plug-in interface 33. Therefore, before executing step S231, the plug-in interface 33 needs to be further defined, and the specific steps can be shown in the following steps S31-S32. Specifically, the following steps are included:

[0115] Step S31: define a number of plug-in interface classes based on the interface function, and the several plug-in interface classes constitute a plug-in interface.

[0116] Among them, the interface function of this embodiment may refer to the infrastructure function, such as declaring start, end, text question, picture question, video question, custom question and other six basic functions. Therefore, start, end, conditional judgment, text\picture\video\comprehensive and other interfaces can be defined, and inheritance can be implemented corresponding to different LLM models, so as to meet the requirements of plug-in adaptation to different LLM models.

[0117] Optionally, since different LLM models may have different enhanced capabilities, such as word count control, role control, etc., the plug-in may be redeveloped and extended based on the enhanced capabilities of different LLM models.

[0118] Step S32: Obtain the plug-in interface class corresponding to the calling instruction, and dynamically load the plug-in interface class.

[0119] The dynamic loading of this embodiment may be as shown in step S231 to step S233, which will not be described in detail here.

[0120] Optionally, the present application also requires periodic management of the plug-in, and the specific steps thereof may be as shown in the following steps S33 to S33. Specifically, the following steps are included:

[0121] Step S33: Customize the plug-in management parameters.

[0122] The plug-in management parameter of this embodiment may be the PluginManager class, which is usually a class used to manage functions such as plug-in loading, unloading, activation and deactivation.

[0123] Step S34: in response to the orchestration result based on the call instruction, a target plug-in is obtained, and management operations are performed on the target plug-in using the plug-in management parameters. The management operations include installation, operation, stop and uninstallation.

[0124] Among them, this embodiment implements the installation, operation, stop, and uninstallation operations of the target plug-in by defining the PluginManager class, realizes the whole process management of the plug-in from installation to uninstallation, manages the life cycle of the plug-in through the six nodes of loading, managing, installing, running, stopping, and uninstalling the plug-in, and realizes on-demand loading. Specifically, the life cycle of each plug-in refers to downloading and installing to calling. If the plug-in is set, it will be used all the time. The life cycle of the plug-in will only stop when the plug-in is uninstalled.

[0125] The data question-and-answer system 30 of the present application adopts a plug-in design to implement the adaptive calling of different LLM models, wherein the adaptive plug-in supports arrangement, supports the combination of plug-ins in series and in parallel, can realize the simultaneous calling of multiple LLM models or the calling of multiple LLM models one by one, and comprehensively organizes the return results of the LLM model to obtain the most prepared and comprehensive response, and can support the calling of a single LLM model and the serial calling or parallel calling of multiple LLM models. In particular, the first plug-in and the second plug-in arranged by the present application can realize the plug-in combination of existing models, directly integrate mature models, bypass the high investment process of upgrading and adjusting parameters and training based on the current model, and save the investment cost of model upgrade.

[0126] On the other hand, the first plug-in of the present application is uploaded to the plug-in market after development, where the plug-in market is equivalent to a list of first plug-ins. Users can select the first plug-in they need for dynamic loading without restarting or configuring. It can be installed and used immediately. There is no need to upgrade the LLM model, which can save the upgrade cost of the LLM model and avoid the problems caused by restart or interruption of model access due to the upgrade operation.

[0127] This application also provides an electronic device, see Figure 8 , Figure 8 : is a schematic diagram of the framework of an embodiment of an electronic device of the present application. The electronic device 40 includes a memory 41 and a processor 42 coupled to each other, and the processor 42 is used to execute program instructions stored in the memory 41 to implement the steps in the calling method embodiment of any of the above-mentioned data question and answer systems. In a specific implementation scenario, the electronic device 40 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 40 may also include mobile devices such as laptops and tablet computers, which are not limited here.

[0128] Specifically, the processor 42 is used to control itself and the memory 41 to implement the steps in the calling method embodiment of any of the above-mentioned data question and answer systems. The processor 42 can also be called a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip with signal processing capabilities. The processor 42 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 42 can be implemented by an integrated circuit chip.

[0129] This application also provides a computer-readable storage medium, see Fig. 9 , Fig. 9 The computer readable storage medium 50 stores a computer program 51 that can be executed by a processor, and the computer program 51 is used to implement the steps in any of the above-mentioned data question answering system calling method embodiments.

[0130] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0131] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0132] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0133] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0134] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0135] The above are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for calling a data question-answering system, characterized in that: The method comprises: Obtaining a calling instruction, wherein the calling instruction includes an arrangement result and an arrangement order; Acquire a target plug-in based on the arrangement result of the calling instruction, wherein the target plug-in includes a first plug-in downloaded from a plug-in market, and / or a second plug-in pre-stored in a database, and the plug-in market realizes data transmission with the database through a plug-in interface; Based on the arrangement order of the calling instructions, calling at least one LLM model using the target plug-in; The step of acquiring the target plug-in based on the arrangement result of the calling instruction includes: Obtaining a request code based on the calling instruction, wherein the request code is used to track and manage the life cycle of the request; Using the request code to obtain a question and answer parameter, the question and answer parameter is used to characterize the plug-in interface class, and the question and answer parameter includes a second question and answer parameter; In response to the second question-and-answer parameter being the same as the first question-and-answer parameter, calling a plug-in interface class corresponding to the second question-and-answer parameter, and downloading the target plug-in through the plug-in interface class, wherein the first question-and-answer parameter is a variable in a system thread variable associated with the request; The step of calling at least one LLM model using the target plug-in based on the arrangement order of the calling instructions includes: Obtaining a loading data packet of the target plug-in; Decompressing the loading data packet to obtain configuration parameters; Obtaining the class under the target path through the configuration parameters to instantiate the class under the target path; The step of acquiring the target plug-in based on the arrangement result of the calling instruction includes: Obtaining an arrangement result of the calling instruction, wherein the arrangement result is that multiple LLM models are required for arrangement, or the arrangement result is that multiple LLM models are not required for arrangement; In response to the arrangement result requiring multiple LLM models for arrangement, obtaining a plurality of the first plug-ins and / or a plurality of the second plug-ins; In response to the arrangement result being that multiple LLM models are not required for arrangement, obtaining a second plug-in corresponding to the calling instruction; The step of using the target plug-in to call the corresponding LLM model based on the arrangement order of the calling instructions includes: Acquire the arrangement sequence of the call instructions, wherein the arrangement sequence includes serial call arrangement and / or parallel call arrangement; Based on the arrangement sequence, the first plug-in or the second plug-in is used to call the corresponding LLM model to arrange the LLM large model, so as to obtain data reply information generated by the LLM large model based on the calling instruction; The step of using the first plug-in or the second plug-in to call the corresponding LLM model based on the arrangement order to arrange the LLM large model to obtain the data reply information generated by the LLM large model based on the calling instruction includes: Acquire the target plug-in at the first priority of the arrangement sequence, call the LLM model corresponding to the target plug-in at the first priority of the arrangement sequence, so as to acquire data information generated by the LLM model based on the calling instruction, wherein the data information includes prompt words and question and answer results; According to the arrangement sequence, the data information is used as data input to obtain the question and answer result generated by the LLM model called by the target plug-in at the last position in the arrangement sequence, and the question and answer result is the data reply information.

2. The calling method of the data question answering system according to claim 1, characterized in that: The method further comprises: Based on the preset configuration, data interfaces corresponding to several LLM models are generated, and different LLM models transmit data through the data interfaces; wherein the data interface includes an API interface.

3. The calling method of the data question answering system according to claim 1, characterized in that: The method further comprises: Based on the interface function, a plurality of plug-in interface classes are defined, and the plurality of plug-in interface classes constitute the plug-in interface; Obtain the plug-in interface class corresponding to the calling instruction, and dynamically load the plug-in interface class.

4. The calling method of the data question answering system according to claim 1, characterized in that: The method further comprises: Customize plugin management parameters; In response to obtaining a target plug-in based on the orchestration result of the calling instruction, a management operation is performed on the target plug-in using the plug-in management parameter, wherein the management operation includes installation, operation, stop and uninstallation.

5. A data question-answering system, characterized in that: The data question answering system comprises: An acquisition module, the acquisition module is used to acquire a calling instruction, the calling instruction includes an arrangement result and an arrangement order; A configuration module, the configuration module is used to obtain a target plug-in based on the arrangement result of the call instruction, wherein the target plug-in includes a first plug-in downloaded from a plug-in market and / or a second plug-in pre-stored in a database; A plug-in interface, wherein the plug-in interface is used to implement data transmission between the plug-in market and the database; The configuration module is further used to call at least one LLM model using the target plug-in based on the arrangement order of the calling instructions; The configuration module is further used to obtain a request code based on the calling instruction, obtain a question and answer parameter using the request code, the question and answer parameter is used to characterize the plug-in interface class, and in response to the question and answer parameter meeting a preset condition, call the plug-in interface class corresponding to the question and answer parameter, and download the target plug-in through the plug-in interface class; The configuration module is also used to obtain a loading data packet of the target plug-in, decompress the loading data packet to obtain configuration parameters, obtain the class under the target path through the configuration parameters, and instantiate the class under the target path; The configuration module is further used to: obtain an orchestration result of the call instruction, wherein the orchestration result is that multiple LLM models are required for orchestration, or the orchestration result is that multiple LLM models are not required for orchestration, in response to the orchestration result being that multiple LLM models are required for orchestration, obtain a plurality of the first plug-ins and / or a plurality of the second plug-ins, and in response to the orchestration result being that multiple LLM models are not required for orchestration, obtain a second plug-in corresponding to the call instruction; The configuration module is further used to: obtain the arrangement order of the call instruction, wherein the arrangement order includes serial call arrangement and / or parallel call arrangement; based on the arrangement order, use the first plug-in or the second plug-in to call the corresponding LLM model to arrange to obtain the LLM large model, so as to obtain the data reply information generated by the LLM large model based on the call instruction; The configuration module is also used to: obtain the target plug-in located at the first priority in the arrangement order, call the LLM model corresponding to the target plug-in located at the first priority in the arrangement order, so as to obtain the data information generated by the LLM model based on the calling instruction, and the data information includes prompt words and question and answer results; according to the arrangement order, using the data information as data input, obtain the question and answer results generated by the LLM model called by the target plug-in located at the last priority in the arrangement order, and the question and answer results are the data reply information.

Citation Information

Patent Citations

  • Plug-in-based task processing method and device, electronic equipment and storage medium

    CN118819549A