Response information generation method and device, equipment, storage medium and product
By pre-storing interface configuration information, dynamic access to the business party obtains data and enters the task execution model, solving the problems of high transformation costs and inconvenient maintenance in the existing technology, and achieving flexible and efficient response information generation.
Patent Information
- Application Number
- CN202510751560.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-06
AI Technical Summary
In the prior art, the modification of configuring a business party as an MCP server is high and difficult, resulting in inconvenient maintenance, which is particularly prominent in the case of multiple business parties.
By pre-stored interface configuration information, the model protocol client and server dynamically access the business party to obtain associated business data. Without configuring the business party as an MCP server, the data is directly input into the pre-trained task execution model to generate response information.
Reduces the transformation cost, reduces the number of MCP servers, facilitates maintenance and management, and improves operational flexibility and efficiency.
Smart Images

Figure CN120256171A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of artificial intelligence technology, and in particular, to a method, device, equipment, storage medium and product for generating response information. Background Art
[0002] With the continuous expansion of the application scenarios of artificial intelligence, in order to be able to call more external tools, a Model Context Protocol (MCP) has been proposed. A secure two-way connection is established between the task execution model and the data source through the model context protocol.
[0003] In the prior art, the task execution model needs to execute tasks based on business data and obtain the execution results corresponding to the tasks. Therefore, a large number of different business parties need to be configured as MCP servers so that the MCP client can access the MCP server to obtain business data for use by the task execution model. However, in the process of implementing the present invention, it is found that the prior art has at least the following technical problems: configuring the business party as an MCP server has high transformation costs and difficulties; moreover, the more business parties involved, the more MCP servers obtained after transformation, resulting in inconvenient maintenance. Summary of the Invention
[0004] Embodiments of the present invention provide a method, device, equipment, storage medium and product for generating response information to achieve the purpose of reducing workload, reducing transformation costs and facilitating server maintenance.
[0005] According to one aspect of the present invention, there is provided a method for generating response information, which is applied to a model protocol server and includes:
[0006] Based on the task information sent by the received model protocol client, determine the call interface information from the interface configuration information of at least one pre-stored business party; wherein, the model protocol client is a client connected to the model protocol server in the model context protocol architecture;
[0007] Based on the call interface information, access the call business party corresponding to the call interface information to obtain associated business data related to the task information from the business data of the call business party;
[0008] Send the associated business data to the model protocol client, so that the model protocol client inputs the associated business data and the task information into a pre-trained task execution model, and based on the first output result of the task execution model, determine the response information corresponding to the task information.
[0009] According to another aspect of the present invention, there is provided a method for generating response information, which is applied to a model protocol client. The method includes:
[0010] Generate task information, and send the task information to a model protocol server, so that the model protocol server determines call interface information from interface configuration information of at least one business party stored in advance, and based on the call interface information, accesses a call business party corresponding to the call interface information, so as to obtain associated business data related to the task information from the business data of the call business party; wherein, the model protocol server is a server connected to the model protocol client in a model context protocol architecture;
[0011] Receive the associated business data sent by the model protocol server, input the associated business data and the task information into a pre-trained task execution model, and determine response information corresponding to the task information based on a first output result of the task execution model.
[0012] According to another aspect of the present invention, there is provided a device for generating response information, which is configured in a model protocol server. The device includes:
[0013] An information determination module, configured to determine call interface information from interface configuration information of at least one business party stored in advance based on task information sent by a received model protocol client; wherein, the model protocol client is a client connected to the model protocol server in a model context protocol architecture;
[0014] A data acquisition module, configured to access a call business party corresponding to the call interface information based on the call interface information, so as to obtain associated business data related to the task information from the business data of the call business party;
[0015] A data sending module, configured to send the associated business data to the model protocol client, so that the model protocol client inputs the associated business data and the task information into a pre-trained task execution model, and determines response information corresponding to the task information based on a first output result of the task execution model.
[0016] According to another aspect of the present invention, there is provided a device for generating response information, which is configured in a model protocol client. The device includes:
[0017] An information generation module, configured to generate task information and send the task information to a model protocol server, so that the model protocol server determines call interface information from interface configuration information of at least one pre-stored service party, and based on the call interface information, access a called service party corresponding to the call interface information to obtain associated service data related to the task information from the service data of the called service party; wherein, the model protocol server is a server connected to a model protocol client in a model context protocol architecture.
[0018] A data receiving module, configured to receive the associated service data sent by the model protocol server, input the associated service data and the task information into a pre-trained task execution model, and determine response information corresponding to the task information based on a first output result of the task execution model.
[0019] According to another aspect of the present invention, there is provided a model protocol server, including:
[0020] At least one processor; and
[0021] A memory communicatively connected to the at least one processor; wherein,
[0022] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the response information generation method applied to the model protocol server according to any embodiment of the present invention.
[0023] According to another aspect of the present invention, there is provided a model protocol client, including:
[0024] At least one processor; and
[0025] A memory communicatively connected to the at least one processor; wherein,
[0026] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the response information generation method applied to the model protocol client according to any embodiment of the present invention.
[0027] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the response information generation method according to any embodiment of the present invention when executed.
[0028] According to another aspect of the present invention, there is provided a computer program product including a computer program which, when executed by a processor, implements the response information generation method according to any embodiment of the present invention.
[0029] In the technical solution of the embodiment of the present invention, based on the task information sent by the model protocol client received, the call interface information is determined from the interface configuration information of at least one business party pre-stored; wherein, the model protocol client is the client connected to the model protocol server in the model context protocol architecture; by using the call interface information to access the called business party corresponding to the call interface information, it is possible to obtain the associated service data from the called business party without configuring the called business party as the server corresponding to the model context protocol; furthermore, by sending the associated service data to the model protocol client, the model protocol client inputs the associated service data and the task information into a pre-trained task execution model, and based on the first output result of the task execution model, determines the response information corresponding to the task information. This solution accesses the called business party through the pre-stored interface configuration information, thereby obtaining the associated service data without any modification to the business party, reducing the workload, lowering the transformation cost, and being able to effectively reduce the number of MCP servers, which is convenient for maintenance and management.
[0030] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0032] Figure 1 is a flowchart of a response information generation method according to an embodiment of the present invention;
[0033] Figure 2 is a schematic diagram of the use case structure of a model context protocol according to an embodiment of the present invention;
[0034] Figure 3 is a flowchart of another response information generation method according to an embodiment of the present invention;
[0035] Figure 4 is a design timing diagram of an MCP mechanism according to an embodiment of the present invention;
[0036] Figure 5 is a flowchart of another response information generation method provided according to an embodiment of the present invention;
[0037] Figure 6 is a schematic diagram of the MPC architecture interface configuration process provided according to an embodiment of the present invention;
[0038] Figure 7 is a core flowchart of an MCP provided according to an embodiment of the present invention;
[0039] Figure 8 is a flowchart of another response information generation method provided according to an embodiment of the present invention;
[0040] Figure 9 is a schematic diagram of the structure of a response information generation device provided according to an embodiment of the present invention;
[0041] Figure 10 is a schematic diagram of the structure of another response information generation device provided according to an embodiment of the present invention;
[0042] Figure 11 is a schematic diagram of the structure of a model protocol server implementing the embodiment of the present invention;
[0043] Figure 12 is a schematic diagram of the structure of a model protocol client implementing the embodiment of the present invention. Detailed implementation manners
[0044] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0045] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "including", "etc." and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0046] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.
[0047] Before introducing the technical solution, an example of the application scenario can be explained first. In the prior art, when answering user questions, the task execution model usually needs to combine the business data of different business parties to give accurate answers. Because different business parties need to be built as MCP servers according to the MCP architecture and pre-bind the corresponding MCP client, they can obtain the corresponding business data of the business party.
[0048] For example, if an accountant wants to use the task execution model to calculate company expenses, he or she needs to obtain employee salaries from the financial business party and the company construction expenses from the administrative business party. To obtain these two types of data, both the financial business party and the administrative business party need to be configured as MCP servers in order to effectively obtain business data, which results in cumbersome operations, high costs, and inconvenient maintenance.
[0049] In addition, the business side is usually multi-application, and each application is equipped with a certain amount of business interfaces. Due to the wide variety of business types, the number of business interfaces is huge. If the business side is configured as an MCP server, the transformation workload is huge, and it is difficult to promote and implement, and it cannot be used in a large range of businesses. For business parties that are not configured as MCP servers, in order to support artificial intelligence to determine response information, it is necessary to provide the business data source to the task execution model for use, resulting in data security issues. Binding the MCP server to the MCP client in advance results in poor flexibility in the use process.
[0050] This technical solution can be applied to scenarios where business data is combined to execute a task to be executed and obtain an execution result corresponding to the task to be executed. Exemplarily, the task to be executed can be a question raised by a user, and the execution result is the answer corresponding to the question. Through this technical solution, it is not necessary to configure each business party as an MCP server. Instead, the business party is called through pre-stored interface configuration information, and then business data is obtained, thereby reducing cost investment and facilitating the maintenance of the MCP server. It should be noted that the task execution model provided in this technical solution is a large model (Large Model) for combining business data to determine the execution result corresponding to the task to be executed. A large model, also known as a large language model or a foundation model, refers to a machine learning model with a huge parameter scale and a complex computing structure, such as the GPT model, the Gemini model, the YANXI large model, etc. By inputting the task information and business data into the task execution model, response information matching the question can be obtained.
[0051] Figure 1 It is a flowchart of a method for generating response information according to an embodiment of the present invention. This embodiment is applicable to the situation of combining business data to determine response information corresponding to task information. This method can be executed by a response information generation device, and the response information generation device can be implemented in the form of hardware and / or software.
[0052] As Figure 1 shown, the method of this embodiment is applied to a model protocol server and specifically may include:
[0053] S110. Based on the task information sent by the received model protocol client, determine the call interface information from the pre-stored interface configuration information of at least one business party.
[0054] Among them, the task information can be question information, instruction information, etc. Exemplarily, when the task information is question information, the corresponding response information is question reply information, and the corresponding task execution model can be a question-and-answer model. When the task information is instruction information, the corresponding response information is the execution result information corresponding to the instruction. The model protocol client is the client connected to the model protocol server in the model context protocol architecture. It should be noted that the method for generating response information provided in this embodiment is applied to the model protocol server.
[0055] In order to be able to more clearly illustrate the method for generating response information, Figure 2 It is a schematic diagram of a model context protocol use case structure according to an embodiment of the present invention; as Figure 2As shown, the model protocol client, the model protocol server, and the service interface are connected in the manner of a connection pipeline. Among them, the model protocol client serves as the upper container, without binding to specific services, and the number can be N; the service interface serves as the lower container, and the number can be N; the model protocol server serves as the connection pipeline, and the number can be 1. Among them, N is a positive integer greater than 1. The function of the model protocol client is to call the task execution model to obtain response information. The functions in the model protocol server are to provide a unified gateway service, query interface information, and access the service interface. The function of the service interface is to obtain service data from the service data source. The service interface includes an RPC (Remote Procedure Call) interface and / or an Http (Hypertext Transfer Protocol) interface. The model protocol server, the service interface, and the model protocol client can respectively implement the above functions through the include (reuse) mechanism.
[0056] In this embodiment, the model protocol client can be embedded in the artificial intelligence server. Among them, an interface and a general controller can also be deployed in the artificial intelligence server. Through the interface, task information sent by the artificial intelligence (AI) client is obtained. The task information can be a question input on the interface corresponding to the AI client, which can be understood as a question for which the user needs to obtain an answer through the task execution model. The task information is transmitted to the main controller through the interface for operations such as format verification and security verification, and after the verification passes, the task information is sent to the model protocol client. Among them, the AI client can be a terminal device embedded with an AI module. For example, the AI client includes at least one of a mobile phone, a computer, a wearable device, and a smart home device.
[0057] In this embodiment, the model protocol client and the model protocol server do not bind to specific services, so that the model protocol client can be dynamically created, with stronger flexibility and more convenient operation. Moreover, by connecting the model protocol client, the model protocol server, and the service interface in the manner of a connection pipeline, only one model protocol server is required, which greatly improves the maintainability of the model protocol server and reduces the transformation cost.
[0058] In this embodiment, the interface configuration information of at least one business interface corresponding to each business party can be pre-stored in a database. Among them, the interface configuration information is used to reflect the interaction specifications between the business party and the model protocol client. The interface configuration information can include interface-level metadata and field-level metadata. The interface-level metadata can include information such as interface address, interface name, and interface description. The field-level metadata can include parameter field name, parameter field description, field type, whether it is required, and field length. Through the interface configuration information, it is convenient to provide business data for the task execution model. Exemplarily, the business interface can include an RPC interface and / or an Http interface, so as to cover business parties with different interface types, which is conducive to comprehensively and effectively obtaining business data.
[0059] In a specific implementation, after the model protocol client receives the task information, it is necessary to obtain business data so that the task execution model can determine the response information corresponding to the task information based on the business data. In order to be able to accurately provide business data while improving efficiency and minimizing processing time consumption. Optionally, the call interface information can be determined based on the number of interface configuration information. Specifically, when the number of interface configuration information is less than the preset interface number, all the interface configuration information can be used as the call interface information, so as to ensure that business data can be comprehensively provided and facilitate the processing of the task execution model. When the number of interface configuration information is greater than or equal to the preset interface number, the task information can be compared with the historical tasks in the historical task record, and the historical tasks with a similarity higher than the first preset threshold to the task information are used as reference tasks, and the call interface information corresponding to the reference tasks is used as the call interface information corresponding to the task information. Thus, combined with the historical task record, it is conducive to quickly and accurately determining the call interface information of the task information.
[0060] S120. Based on the call interface information, access the call business party corresponding to the call interface information to obtain the associated business data related to the task information from the business data of the call business party.
[0061] In this embodiment, the call interface information can be the interface address, and the model protocol server can determine the interface input parameters corresponding to the interface address. Exemplarily, the interface input parameters can be randomly determined by using the enumeration method; or, based on the historical access record, the interface input parameters used in the historical access are used as the interface input parameters required for the current access. Through the interface input parameters, a data acquisition request is generated. Further, the data acquisition request corresponding to the interface address can be sent to the call business party through the interface address, so that the call business party can obtain the business data corresponding to the data acquisition request as the associated business data related to the task information.
[0062] S130. Send the associated service data to the model protocol client so that the model protocol client inputs the associated service data and the task information into a pre-trained task execution model, and determines the response information corresponding to the task information based on the first output result of the task execution model.
[0063] In this embodiment, after obtaining the associated service data, to ensure the learning accuracy of the task execution model, the data format of the associated service data corresponding to the calling service provider can be verified based on the service type of the calling service provider. For example, the data format verification may include at least one of data type verification, data value range verification, and logical rule verification. For ease of understanding, the scenario of counting attendance duration can be used as an example for illustration. In this scenario, the associated service data may be data for reflecting the attendance date. Therefore, the data type of the associated service data may be the time and date type. Then, the associated service data that conforms to the time and date type can be retained, and the associated service data that does not conform to the time and date type can be deleted.
[0064] Further, the associated service data that has completed the data format verification can be sent to the model protocol client. After the model protocol client finishes receiving the associated service data, it inputs each piece of associated service data and the task information into the task execution model. After the task execution model combines the associated service data, the output result of the task information is used as the first output result. By parsing the first output result, the response information corresponding to the task information can be obtained.
[0065] In practical applications, the task information is diverse. If a unified format is used to display the response information for different task information, it is not easy to reflect the differences between the response information corresponding to different task information. To facilitate the user to view the response information, different response formats can be used to generate the response information for different task information.
[0066] Specifically, sending the associated service data to the model protocol client so that the model protocol client inputs the associated service data and the task information into a pre-trained task execution model, and determining the response information corresponding to the task information based on the first output result of the task execution model includes: sending the associated service data to the model protocol client so that the model protocol client sends the associated service data, the task information, and the preset format requirement information to the task execution model to obtain the first output result corresponding to the task information, and using the first output result as the response information corresponding to the task information.
[0067] Among them, the format requirement information records the correspondence between the task type and the response format. Exemplarily, when the task information is question information, the task type may include technical implementation questions, concept explanation questions, recommendation and evaluation questions, troubleshooting questions, etc. For a technical implementation question such as "How to write code for implementing function A?", the corresponding response format is the format corresponding to the code snippet. For a concept explanation question such as "What is MCP?", the response format can be in the form of "definition + analogy + case" to comprehensively explain MCP. For a recommendation and evaluation question such as "Which is more useful, tool A or tool B?", the corresponding response format is in the form of a comparison table. For a troubleshooting question such as "Insufficient disk space", the corresponding answer can be in the form of showing the diagnostic process and then the cause of the failure.
[0068] In this embodiment, the associated service data, task information, and format requirement information can all be sent to the task execution model. The task execution model determines the answer corresponding to the task information by using the associated service data and task information; and uses the response format corresponding to the task type of the task information as the target format. The determined answer is sorted according to the target format, and the sorting result is used as the first output result, and the first output result is used as the response information corresponding to the task information.
[0069] In this embodiment, by sending the format requirement information to the task execution model, the task execution model obtains the response information corresponding to the task information according to the format requirement matching the task information, realizes the function of flexibly setting the format of the response information based on the difference of the task information, is beneficial to intuitively and clearly display the response information, and is convenient for users to view.
[0070] Furthermore, the format requirement information may also include a general format, which can be used for the answers to any task information. Exemplarily, when the task type corresponding to the task information is not recorded in the format requirement information, the general format can be used to generate the corresponding first output result for the task information, and then obtain the response information in the general format. By setting the general format, it is ensured that the response information can be obtained after sorting the answers corresponding to the task information. And it is convenient to display the response information in an orderly and clear manner, improving the convenience for users to view.
[0071] Based on the task information sent by the model protocol client received, the technical solution of the embodiment of the present invention determines the call interface information from the pre-stored interface configuration information of at least one service party; wherein, the model protocol client is the client connected to the model protocol server in the model context protocol architecture; by means of the call interface information, access the call service party corresponding to the call interface information, so that without configuring the call service party as the server corresponding to the model context protocol, the associated service data can also be obtained from the call service party; furthermore, by sending the associated service data to the model protocol client, the model protocol client inputs the associated service data and the task information into the pre-trained task execution model, and based on the first output result of the task execution model, determines the response information corresponding to the task information. This solution accesses the call service party through the pre-stored interface configuration information, so as to obtain the associated service data without any modification to the service party, reducing the workload, lowering the transformation cost, and effectively reducing the number of MCP servers, which is convenient for maintenance and management.
[0072] Figure 3 It is a flowchart of another method for generating response information provided according to an embodiment of the present invention. On the basis of the above embodiment, optionally, the way to determine the call interface information may include: determining the information prompt word of the interface configuration information associated with the task information, and determining the call interface information based on the information prompt word. The explanations of the same or corresponding terms as those in the above embodiments will not be elaborated here. As Figure 3 shown, the method includes:
[0073] S210. Based on the task information and the interface configuration information sent by the received model protocol client, determine the information prompt word of the interface configuration information associated with the task information.
[0074] Wherein, the information prompt word may be the description information corresponding to the interface configuration information associated with the task information, and the description information is used to reflect the interface function and the usage method.
[0075] It should be noted that in order to more accurately obtain the service data strongly associated with the task information and avoid inputting a large amount of service data into the task execution model, the call service interface can be determined based on the information prompt word of the interface configuration information. For the convenience of clearly understanding this process, reference can be made to Figure 4 . As Figure 4As shown, the user inputs task information into the AI client, and the AI client submits the task information to the interface deployed in the AI server, and calls the model protocol client through the interface. Exemplarily, the number of model protocol clients can be multiple, and one model protocol client can be enabled based on the remaining resources of each model protocol client to send the task information to the model protocol server to determine the information prompt word. For example, the model protocol client with the most remaining resources can be called to transmit the task information to the model protocol server through this model protocol client.
[0076] In this embodiment, based on the historical tasks in the historical task record, historical tasks with a similarity to the task information greater than the second preset threshold can be determined as associated tasks, and the call interface information corresponding to the associated tasks in the historical task record is used as the interface configuration information associated with the task information.
[0077] Furthermore, the information prompt words corresponding to each interface configuration information can be stored in advance. The model protocol server determines the similarity degree between the interface configuration information and the task information, determines the interface configuration information associated with the task information based on the similarity degree between the interface configuration information and the task information, and determines the information prompt words of the interface configuration information associated with the task information based on the stored correspondence relationship between the interface configuration information and the information prompt words.
[0078] In addition, the information prompt words can be obtained by transforming the interface configuration information. Exemplarily, the types of information prompt words can include at least one of vector type, image type, structured table, and plain text type. The type of information prompt words that the model protocol client can recognize can be used as the target type. The interface configuration information associated with the task information is converted into the target information of the target type, and the target information is used as the information prompt words corresponding to the interface configuration information.
[0079] This embodiment provides different ways to determine the information prompt words, which is convenient for flexibly and effectively determining the information prompt words of the interface configuration information.
[0080] Optionally, the interface configuration information includes an interface configuration vector, and the interface configuration vector is stored in a vector library; determining the information prompt words of the interface configuration information associated with the task information based on the task information and the interface configuration information sent by the received model protocol client includes: sending the task information sent by the received model protocol client to the vector library, so that the vector library determines the interface configuration vector associated with the task information based on the similarity degree between at least one interface configuration vector and the task information, determining the information prompt words of the interface configuration vector associated with the task information; receiving the information prompt words fed back by the vector library.
[0081] Among them, the vector library is a database system for storing, retrieving, and managing vector data. Through the vector library, complex tasks such as semantic search, similarity recommendation, and transmembrane state alignment can be performed. By storing the interface configuration vectors corresponding to each business interface in the vector library, it is convenient to search for and recommend similarities for the interface configuration vectors.
[0082] In a specific implementation, the task information can be sent to the vector library. The vector library determines the similarity between the interface configuration vector and the task information. Specifically, the task information is in natural language format and can be converted into a task vector in vector form through a pre-trained model. Among them, the pre-trained model can be a BERT (Bidirectional Encoder Representations from Transformers) model. The similarity between each interface configuration vector and the task vector can be determined by means of cosine similarity and / or Euclidean distance as the similarity between the interface configuration vector and the task information. The higher the similarity, the higher the matching degree between the interface configuration vector and the task information; otherwise, the matching degree is lower.
[0083] In this embodiment, the interface configuration vectors with a similarity greater than the first preset degree threshold can be used as the interface configuration vectors associated with the task information; or, the preset number of interface configuration vectors with the highest similarity can be used as the interface configuration vectors associated with the task information. It should be noted that those skilled in the art can set the first preset degree threshold and the preset number according to the actual application situation, and this embodiment does not make any limitations in this regard.
[0084] Furthermore, the information prompt words corresponding to the interface configuration vector can be determined based on the interface configuration vector associated with the task information. Exemplarily, the interface configuration vector can be directly used as the information prompt word; or the interface configuration vector can be converted into the information corresponding to natural language, and this information can be used as the information prompt word of the interface configuration vector. Moreover, the vector library can send the determined information prompt words associated with the task information to the model protocol server, and the model protocol server sends the received information prompt words to the model protocol client. It should be noted that the format of the information prompt words can be determined based on the type of information that the model protocol client can recognize.
[0085] In this embodiment, the interface configuration vector is used to determine the information prompt words associated with the task information, thereby converting the unstructured text into a mathematical representation in a high-dimensional semantic space. Even in the case of the same semantics but different lexical expressions, the association between the information prompt words and the task information can still be accurately established, which is beneficial to accurately and effectively determining the information prompt words associated with the task information.
[0086] S220. Send the information prompt word to the model protocol client, so that the model protocol client inputs the information prompt word into the task execution model, and determines the call interface information corresponding to the task information based on the second output result output by the task execution model; receive the call interface information fed back by the model protocol client.
[0087] As Figure 4 shown, after the model protocol server determines the information prompt word, it can feedback both the determined task information and the information prompt word associated with the task information to the model protocol client. Through the model protocol client, the obtained information prompt word and task information are input into the task execution model. The task execution model can obtain a second output result based on the task information and the information prompt word. Among them, the second output result includes call interface information, and the call interface information includes a call interface address and / or interface input parameters corresponding to the call interface address. By parsing the second output result, the call interface information can be determined, and the model protocol client can send the call interface information to the model protocol server.
[0088] Exemplarily, if the interface configuration information includes an interface address, the call interface address can be the interface address corresponding to each input information prompt word; or, the call interface address can be the interface address corresponding to the information prompt word that meets the preset matching condition after the task execution model matches the information prompt word with the task information. Among them, the preset matching condition can be that the similarity between the information prompt word and the task information is greater than the second preset degree threshold.
[0089] S230. Based on the call interface information, access the call service provider corresponding to the call interface information, so as to obtain associated service data related to the task information from the service data of the call service provider.
[0090] It should be noted that since the service data corresponding to the service provider is large in quantity, using the enumeration method to determine the interface input parameters, or using the interface input parameters used in historical access as the interface input parameters required for the current access, there is a certain degree of randomness, that is, the relevance between the obtained associated service data and the task information is weak, resulting in the task execution model being unable to accurately obtain the response information based on the associated service data. Therefore, in order to improve the processing efficiency and accuracy of the task execution model, the service data corresponding to the call service provider can be further screened to screen out the service data with a strong relevance to the task information as the associated service data.
[0091] Optionally, the call interface information corresponding to the task information includes a call interface address and interface input parameters corresponding to the call interface address. That is, through the second output result, the interface input parameters when requesting the associated service data of the call service provider can be directly determined.
[0092] In this embodiment, based on the call interface information, accessing the calling service party corresponding to the call interface information to obtain the associated service data related to the task information from the service data of the calling service party, the specific implementation method includes: generating a data acquisition request corresponding to the task information based on the interface input parameters corresponding to the call interface address; sending the data acquisition request to the call interface corresponding to the call interface address, so that the calling service party to which the call interface belongs determines the associated service data based on the received data acquisition request, and receiving the associated service data sent by the calling service party.
[0093] Specifically, through the interface input parameters, a data acquisition request corresponding to the task information can be generated. For example, if the task information is "How to apply for a cross-departmental cooperation budget?", the interface input parameters may include: the name of the applying department, the names of the departments that need to be united, and the project plan, etc.
[0094] As Figure 4 shown, the model protocol client can generate a data acquisition request based on the interface input parameters fed back by the task execution model, and send the data acquisition request to the call interface corresponding to the call interface address, so that the calling service party corresponding to the call interface can obtain the service data corresponding to the data acquisition request in the service database as the associated service data through the data acquisition request. The calling service party returns the associated service data to the model protocol server, and the model protocol server returns the associated service data to the model protocol client, so as to input the associated service data and the task information into the task execution model through the model protocol client.
[0095] In this embodiment, a data acquisition request is generated through the interface input parameters output by the task execution model to obtain the associated service data, so that the service data related to the task information can be accurately and effectively obtained, thereby improving the accuracy of the response information.
[0096] S240. Sending the associated service data to the model protocol client, so that the model protocol client inputs the associated service data and the task information into a pre-trained task execution model, and determines the response information corresponding to the task information based on the first output result of the task execution model.
[0097] It should be noted that in this embodiment, by combining the service data of different major service parties and the task execution model to determine the response information, using the RAG (Retrieval-Augmented Generation) method, information can be retrieved from a wide range of data sources to provide rich context for the task execution model, so as to better understand and process complex problems.
[0098] As Figure 4As shown, the task execution model obtains a first output result based on the received associated service data and task information. The model protocol client parses the first output result to obtain response information corresponding to the task information.
[0099] In this embodiment, by combining the second output result output by the task execution model to determine the call interface information, it is possible to determine the call interface information with strong relevance to the task information, so as to accurately obtain the associated service data. And, by using the RAG method to provide the associated service data related to the task information to the task execution model, that is, providing the minimized service data to the task execution model, without providing all the service data to the task execution model, thus improving the security of the service data while ensuring that the requirements of the task execution model can be met.
[0100] Figure 5 It is a flowchart of another method for generating response information according to an embodiment of the present invention. On the basis of the above embodiment, optionally, before determining the call interface information, it further includes: generating interface registration information in response to a registration operation on the service interfaces of at least one service provider; based on the interface registration information, determining the interface configuration information corresponding to the registered interfaces, and storing the interface configuration information. The explanations of the same or corresponding terms in the above embodiments are not repeated here. As Figure 5 shown, the method includes:
[0101] S310: Generate interface registration information in response to a registration operation on the service interfaces of at least one service provider; based on the interface registration information, determine the interface configuration information corresponding to the registered interfaces, and store the interface configuration information.
[0102] Among them, the interface configuration information includes the interface address, interface name, and field information of the registered interface; the field information includes at least one of the parameter field name, parameter field description, interface type, and whether it is required.
[0103] In order to be able to obtain the call interface information in a timely and rapid manner when determining the response information, it is necessary to pre-generate and store the interface configuration information. Specifically, it can respond to the registration operation of the service interfaces of at least one service provider. Among them, the registration operation includes the content filling operation of the information input box on the user interface. Based on the content filled in the input box, the interface registration information can be determined. The interface registration information can include the interface address, interface name, and field information; the field information includes at least one of the parameter field name, parameter field description, interface type, and whether it is required. Take the interface registration information as the interface configuration information corresponding to the registered interface, and store the interface configuration information.
[0104] Figure 6It is a schematic diagram of the MPC architecture interface configuration process provided by an embodiment of the present invention. As Figure 6 shown, under the MPC architecture, it supports the configuration of two types of interfaces, namely the RPC interface and the Http interface. For the RPC interface, the interface registration information may include the RPC interface address, interface name, address of the RPC consumer-side SDK (Software Development Kit), and field information. For the Http interface, the interface registration information may include the Http interface address and field information, and the configuration method may be the include method. To improve the convenience of obtaining the interface registration information, the RPC interface name and field information can be automatically generated by parsing the SDK code. The interface name and field information of the Http interface can be obtained by manual filling. The field information may include a description and whether it is required. The description information may be the parameter field name and parameter field description.
[0105] In this embodiment, by pre-registering the interface registration information, the interface configuration information is obtained based on the interface registration information, and the interface configuration information is stored, which is convenient for subsequently calling the service interface based on the stored interface registration information to obtain service data.
[0106] Optionally, based on the interface registration information, determining the interface configuration information corresponding to the registered interface includes: performing an audit operation on the interface registration information to determine the review result of the interface registration information; in the case where the review result is passed, taking the service interface corresponding to the interface registration information as the registered interface, and taking the interface registration information as the interface configuration information of the registered interface.
[0107] To ensure the accuracy and compliance of the interface configuration information and be able to obtain secure service data when performing tasks, the interface registration information can be audited. Refer to Figure 6As shown in the figure, after obtaining the interface registration information, the interface registration information can be sent to the review terminal, where the administrator verifies the compliance of the interface registration information and generates a review result corresponding to the interface registration information. For example, the administrator approves to determine whether the interface registration information has obtained AI permission, that is, it is allowed to use artificial intelligence technology in business operations. The review result includes passing the review and failing the review. When the received review result is passing the review, the service interface corresponding to the interface registration information can be used as a registered interface, the interface registration information can be used as interface configuration information, and it can be stored in tabular form to obtain an interface configuration information table. At the same time, the interface configuration information can be converted into a vector form and the corresponding interface configuration quantity table can be recorded. The interface configuration information can include the interface address, interface name, address of the RPC consumer-side SDK, parameter field name, parameter field description, interface type, and whether it is required. The interface configuration information table is used for information echo; for example, when the user registers interface information next time, by displaying the already stored interface configuration information, it is prompted whether the input interface registration information has been registered, avoiding duplicate registration.
[0108] In the case where the review result is failing the review, the interface registration information can be deleted. And a prompt message is generated and fed back to the registration terminal that sent the interface registration information, so that after the registration terminal verifies whether the interface registration information is accurate, registration can be carried out again.
[0109] In this embodiment, by reviewing the interface registration information, the compliance and accuracy of the interface registration information can be ensured, and when calling the service interface corresponding to the interface registration information to obtain service data, the security of the obtained service data can be ensured.
[0110] S320. Based on the task information sent by the received model protocol client, determine the call interface information from the pre-stored interface configuration information of at least one service provider.
[0111] Optionally, the response information generation method provided in this embodiment is applied to a target model protocol server, and the target model protocol server is a model protocol server in a distributed server system, and the domain names of the model protocol servers in the distributed server system are the same.
[0112] It should be noted that in order to make reasonable use of resources, a distributed server system can be used to implement the response information generation method. The distributed server system includes multiple model protocol servers, and each model protocol server can use the same domain name, so as to build a highly available and scalable architecture.
[0113] In a specific implementation, after receiving the task information, the artificial intelligence server can determine the target model protocol server based on the remaining resources of each model protocol server in the distributed server system, and send the task information to the target model protocol server. Exemplarily, the model protocol server with the most remaining resources in the distributed server system can be used as the target model protocol server.
[0114] Among them, the remaining resources can be the CPU resources, memory resources, network bandwidth, etc. of the model protocol server.
[0115] In this embodiment, determining the target model protocol server in the distributed server system based on the remaining resources can ensure the load balance among the model protocol servers and improve the processing efficiency of the task information.
[0116] S330. Based on the call interface information, access the call service party corresponding to the call interface information, so as to obtain the associated service data related to the task information from the service data of the call service party.
[0117] S340. Send the associated service data to the model protocol client, so that the model protocol client inputs the associated service data and the task information into the pre-trained task execution model, and determines the response information corresponding to the task information based on the first output result of the task execution model.
[0118] The above text has described in detail the embodiments corresponding to the response information generation method. To make those skilled in the art further clear the technical solution of this method, specific application scenarios are given below.
[0119] Figure 7 is a core flowchart of MCP according to an embodiment of the present invention. As Figure 7 shown, the user performs MCP support configuration, including registering the RPC interface or the HTTP interface. After the registration is completed, it needs to be approved by the administrator. After the approval is passed, it is saved to the interface configuration vector table and the interface configuration information table. Among them, the interface configuration vectors stored in the interface configuration vector table, and the configuration information is stored in the interface configuration information table in natural language for information echo when registering the interface again. The user inputs the task information through the AI client and submits the task information to the AI server. The AI server accepts the task information, and the task execution process is carried out through the model protocol client. Exemplarily, the model protocol client includes multiple MCP Clients without specific services such as MCP Client1, MCP Client2,..., MCP ClientN. One of the multiple MCP Clients can be determined to receive the task information. Among them, N is a positive integer greater than 1.
[0120] Specifically, the model protocol client sends task information to the model protocol server. The model server queries the interface configuration vector table and determines the information prompt words associated with the task information, and then sends the information prompt words to the model protocol client. After receiving the information prompt words, the model protocol client sends the task information and the information prompt words to the task execution model, and determines the call interface information and interface input parameters based on the output result of the task execution model. The model protocol client sends the call interface information and interface input parameters to the model protocol server. The model protocol server generates a data acquisition request based on the interface input parameters, queries the service interface through the call interface information, and sends the data acquisition request to the corresponding service provider to obtain the associated service data from the service provider. Exemplarily, the service providers include service provider 1, service provider 2,..., service provider N. Each service provider may include multiple service interfaces. Here, N is a positive integer greater than 1.
[0121] It should be noted that multiple model protocol servers may be included. Each model protocol server has the same domain name, and the server responsibilities are the same. The model protocol servers are deployed in a distributed manner.
[0122] Further, the model protocol server sends the obtained associated service data to the model protocol client. The model protocol client inputs the associated service data, task information, and format requirement information into the task execution model, and returns the first output result of the task execution model. Then, based on the first output result, the response information corresponding to the task information is determined.
[0123] In this embodiment, multiple model protocol clients without bound services are created using the MCP protocol to achieve de-businessization, which is beneficial to reducing deployment costs and facilitating maintenance and expansion, improving the reusability of the model protocol client, avoiding resource waste, and saving a large amount of costs. Moreover, using the MCP protocol to create the model protocol server, decoupled from the specific business, has zero intrusion into the business, can obtain business data without any development on the service provider side, thus shortening the time for each service to connect to artificial intelligence technology and reducing human resources.
[0124] Figure 8 It is a flowchart of another response information generation method provided according to an embodiment of the present invention. This embodiment is applicable to the situation of determining the response information corresponding to the task information in combination with the service data. This method is applied to the model protocol client. This method and the response information generation methods of the above embodiments belong to the same inventive concept. For the details not described in detail in the embodiments of the response information generation method, reference can be made to the above embodiments. This method includes:
[0125] S410. Generate task information and send the task information to the model protocol server, so that the model protocol server determines the call interface information from the pre-stored interface configuration information of at least one business party, and based on the call interface information, accesses the calling business party corresponding to the call interface information to obtain the associated business data related to the task information from the business data of the calling business party.
[0126] Among them, the model protocol server is the server connected to the model protocol client in the model context protocol architecture.
[0127] Optionally, the specific implementation of sending the task information to the model protocol server so that the model protocol server determines the call interface information from the pre-stored interface configuration information of at least one business party is as follows: Send the task information to the model protocol server, so that the model protocol server determines the information prompt word of the interface configuration information associated with the task information based on the received task information and the interface configuration information, and send the information prompt word to the model protocol client; Receive the information prompt word, input the information prompt word into the task execution model, and based on the second output result output by the task execution model, determine the call interface information corresponding to the task information, and send the call interface information to the model protocol server.
[0128] In this embodiment, by combining the second output result output by the task execution model to determine the call interface information, the call interface information with strong relevance to the task information can be determined.
[0129] S420. Receive the associated business data sent by the model protocol server, input the associated business data and the task information into the pre-trained task execution model, and based on the first output result of the task execution model, determine the response information corresponding to the task information.
[0130] The technical solution of the embodiment of the present invention generates task information, and sends the task information to the model protocol server, so that the model protocol server determines the call interface information from the pre-stored interface configuration information of at least one service party, and based on the call interface information, accesses the call service party corresponding to the call interface information, so as to obtain the associated service data related to the task information from the service data of the call service party. Thus, it is possible to obtain the associated service data from the call service party without configuring the call service party as the server corresponding to the model context protocol. Furthermore, by receiving the associated service data, the associated service data and the task information are input into the pre-trained task execution model, and based on the first output result of the task execution model, the response information corresponding to the task information is determined. This solution accesses the call service party through the pre-stored interface configuration information, so as to obtain the associated service data without any modification to the service party, reducing the workload and the transformation cost, and effectively reducing the number of MCP servers, which is convenient for maintenance and management.
[0131] Figure 9 FIG. 4 is a schematic structural diagram of a response information generation device according to an embodiment of the present invention. The device is used to execute the response information generation method applied to the model protocol server provided in any of the above embodiments. The device and the response information generation method in the above embodiments belong to the same inventive concept. The details not described in detail in the embodiment of the response information generation device can refer to the embodiments of the above response information generation method. As Figure 9 shown, the device includes:
[0132] An information determination module 10, configured to determine call interface information from the pre-stored interface configuration information of at least one service party based on the task information sent by the received model protocol client; wherein, the model protocol client is a client connected to the model protocol server in the model context protocol architecture;
[0133] A data acquisition module 11, configured to access the call service party corresponding to the call interface information based on the call interface information, so as to obtain the associated service data related to the task information from the service data of the call service party;
[0134] A data sending module 12, configured to send the associated service data to the model protocol client, so that the model protocol client inputs the associated service data and the task information into the pre-trained task execution model, and based on the first output result of the task execution model, determines the response information corresponding to the task information.
[0135] Based on any optional technical solution in the embodiment of the present invention, optionally, the information determination module 10 includes:
[0136] An information prompt word determination sub-module, configured to determine an information prompt word of the interface configuration information associated with the task information based on the task information sent by the model protocol client received and the interface configuration information;
[0137] A prompt word sending sub-module, configured to send the information prompt word to the model protocol client, so that the model protocol client inputs the information prompt word into the task execution model, and determines the call interface information corresponding to the task information based on the second output result output by the task execution model;
[0138] A first information interface sub-module, configured to receive the call interface information fed back by the model protocol client.
[0139] Based on any optional technical solution in the embodiments of the present invention, optionally, the interface configuration information includes an interface configuration vector, and the interface configuration vector is stored in a vector library;
[0140] The information prompt word determination sub-module includes:
[0141] A task sending unit, configured to send the task information sent by the model protocol client received to the vector library, so that the vector library determines an interface configuration vector associated with the task information based on the similarity between at least one interface configuration vector and the task information, and determines an information prompt word of the interface configuration vector associated with the task information;
[0142] A prompt word interface unit, configured to receive the information prompt word fed back by the vector library.
[0143] Based on any optional technical solution in the embodiments of the present invention, optionally, the call interface information corresponding to the task information includes a call interface address and interface input parameters corresponding to the call interface address;
[0144] The data acquisition module 11 includes:
[0145] A request generation unit, configured to generate a data acquisition request corresponding to the task information based on the interface input parameters corresponding to the call interface address;
[0146] A request sending unit, configured to send the data acquisition request to the call interface corresponding to the call interface address, so that the call service party to which the call interface belongs determines associated service data based on the received data acquisition request, and receives the associated service data sent by the call service party.
[0147] Based on any optional technical solution in the embodiments of the present invention, optionally, the data sending module 12 includes:
[0148] A response information determination sub-module, configured to send associated service data to a model protocol client, so that the model protocol client sends the associated service data, task information, and preset format requirement information to a task execution model, and obtain a first output result corresponding to the task information, and use the first output result as the response information corresponding to the task information;
[0149] Among them, the format requirement information records the correspondence between the task type and the response format.
[0150] Based on any optional technical solution in the embodiments of the present invention, optionally, it is applied to a target model protocol server, and the target model protocol server is a model protocol server in a distributed server system, and the domain names of the model protocol servers in the distributed server system are the same.
[0151] Based on any optional technical solution in the embodiments of the present invention, optionally, it further includes:
[0152] A registration interface information generation module, configured to generate interface registration information in response to a registration operation on the service interfaces of at least one service party before determining the call interface information from the interface configuration information of at least one pre-stored service party based on the task information sent by the received model protocol client;
[0153] An information storage module, configured to determine the interface configuration information corresponding to the registered interface based on the interface registration information, and store the interface configuration information;
[0154] Among them, the interface configuration information includes the interface address, interface name, and field information of the registered interface; the field information includes at least one of the parameter field name, parameter field description, interface type, and whether it is required.
[0155] Based on any optional technical solution in the embodiments of the present invention, optionally, the information storage module includes:
[0156] An audit sub-module, configured to perform an audit operation on the interface registration information to determine the audit result of the interface registration information;
[0157] A configuration information determination sub-module, configured to use the service interface corresponding to the interface registration information as the registered interface and the interface registration information as the interface configuration information of the registered interface when the audit result is a passed audit.
[0158] The response information generation device provided by the embodiments of the present invention can execute the response information generation method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0159] It should be noted that in the embodiments of the above response information generation device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.
[0160] Figure 10 It is a schematic structural diagram of another response information generation device provided according to an embodiment of the present invention; this device is used to execute the response information generation method applied to the model protocol client provided in any of the above embodiments. This device and the response information generation methods in the above embodiments belong to the same inventive concept. For the details not described in detail in the embodiments of the response information generation device, reference can be made to the embodiments of the above response information generation method. As Figure 10 shown, this device includes:
[0161] An information generation module 20, configured to generate task information, send the task information to a model protocol server, so that the model protocol server determines call interface information from the interface configuration information of at least one service party pre-stored, and based on the call interface information, access the call service party corresponding to the call interface information, so as to obtain associated service data related to the task information from the service data of the call service party; wherein, the model protocol server is a server connected to the model protocol client in the model context protocol architecture;
[0162] A data receiving module 21, configured to receive the associated service data sent by the model protocol server, input the associated service data and the task information into a pre-trained task execution model, and determine response information corresponding to the task information based on the first output result of the task execution model.
[0163] Based on any optional technical solution in the embodiments of the present invention, optionally, the information generation module 20 includes:
[0164] A task sending sub-module, configured to send the task information to the model protocol server, so that the model protocol server determines an information prompt word of the interface configuration information associated with the task information based on the received task information and the interface configuration information, and sends the information prompt word to the model protocol client;
[0165] A prompt word receiving sub-module, configured to receive the information prompt word, input the information prompt word into the task execution model, determine call interface information corresponding to the task information based on the second output result output by the task execution model, and send the call interface information to the model protocol server.
[0166] The response information generation device provided by the embodiments of the present invention can execute the response information generation method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution of the method.
[0167] Figure 11 It is a schematic structural diagram of the model protocol server for implementing the embodiments of the present invention. As Figure 11 shown, the model protocol server 30 includes at least one first processor 31 and a first memory communicatively connected to the at least one first processor 31, such as a first read-only memory 32, a first random access memory 33, etc. Among them, the first memory stores a computer program executable by the at least one processor, and the first processor 31 can execute various appropriate actions and processes according to the computer program stored in the first read-only memory 32 or the computer program loaded from the first storage unit 38 into the first random access memory 33. In the first random access memory 33, various programs and data required for the operation of the model protocol server 30 can also be stored. The first processor 31, the first read-only memory 32, and the first random access memory 33 are connected to each other through the first bus 34. The first input / output interface 35 is also connected to the first bus 34.
[0168] Multiple components in the model protocol server 30 are connected to the first input / output interface 35, including: a first input unit 36, such as a keyboard, a mouse, etc.; a first output unit 37, such as various types of displays, speakers, etc.; a first storage unit 38, such as a disk, an optical disc, etc.; and a first communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The first communication unit 39 allows the model protocol server 30 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0169] The first processor 31 can be various general and / or special processing components with processing and computing capabilities. Some examples of the first processor 31 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The first processor 31 executes the various methods and processes described above, such as the response information generation method.
[0170] In some embodiments, the response information generation method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the first storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed onto the model protocol server 30 via the first read-only memory 32 and / or the first communication unit 39. When the computer program is loaded into the first random access memory 33 and executed by the first processor 31, one or more steps of the response information generation method described above may be performed. Alternatively, in other embodiments, the first processor 31 may be configured to execute the response information generation method by any other suitable means (e.g., by means of firmware).
[0171] Figure 12 is a schematic structural diagram of the model protocol client for implementing the embodiments of the present invention. As Figure 12 shown, the model protocol client 40 includes at least one second processor 41 and a second memory communicatively connected to the at least one second processor 41, such as a second read-only memory 42, a second random access memory 43, etc. The second memory stores a computer program executable by the at least one processor. The second processor 41 may perform various appropriate actions and processes according to the computer program stored in the second read-only memory 42 or the computer program loaded from the second storage unit 48 into the second random access memory 43. In the second random access memory 43, various programs and data required for the operation of the model protocol client 40 may also be stored. The second processor 41, the second read-only memory 42, and the second random access memory 43 are connected to each other via a second bus 44. The second input / output interface 45 is also connected to the second bus 44.
[0172] Multiple components in the model protocol client 40 are connected to the second input / output interface 45, including: a second input unit 46, such as a keyboard, a mouse, etc.; a second output unit 47, such as various types of displays, speakers, etc.; a second storage unit 48, such as a disk, an optical disc, etc.; and a second communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The second communication unit 49 allows the model protocol client 40 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0173] The second processor 41 may be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the second processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The second processor 41 executes the various methods and processes described above, such as the response information generation method.
[0174] In some embodiments, the response information generation method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the second storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed onto the model protocol client 40 via the second read-only memory 42 and / or the second communication unit 49. When the computer program is loaded into the second random access memory 43 and executed by the second processor 41, one or more steps of the response information generation method described above may be executed. Alternatively, in other embodiments, the second processor 41 may be configured to execute the response information generation method in any other suitable manner (e.g., by means of firmware).
[0175] The various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip or system-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0176] The computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0177] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0178] The systems and techniques described herein can be implemented in a computing system that includes backend components (such as, for example, a data server), or a computing system that includes middleware components (such as, for example, an application server), or a computing system that includes frontend components (such as, for example, a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by any form or medium of digital data communication (such as, for example, a communication network). Examples of the communication network include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0179] The computing system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs that run on the respective computers and have a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0180] In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present invention includes a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program including program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication unit, or installed from a storage unit, or installed from a ROM. When the computer program is executed by a processor, the above-mentioned functions defined in the method of the embodiment of the present invention are performed.
[0181] In the process of implementing the computer program product, computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or, alternatively, can be connected to an external computer (e.g., by connecting through the Internet using an Internet service provider).
[0182] It should be understood that various forms of the flow shown above can be used, steps can be reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0183] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A response information generation method, characterized in that, Applied to a model protocol server, the method includes: Based on the task information sent by the received model protocol client, determine the call interface information from the pre-stored interface configuration information of at least one business party; wherein, the model protocol client is the client connected to the model protocol server in the model context protocol architecture; Based on the call interface information, access the called business party corresponding to the call interface information to obtain the associated business data related to the task information from the business data of the called business party; Send the associated business data to the model protocol client, so that the model protocol client inputs the associated business data and the task information into a pre-trained task execution model, and determines the response information corresponding to the task information based on the first output result of the task execution model.
2. The method according to claim 1, wherein The determining the call interface information from the pre-stored interface configuration information of at least one business party based on the task information sent by the received model protocol client includes: Based on the task information sent by the received model protocol client and the interface configuration information, determine the information prompt word of the interface configuration information associated with the task information; Send the information prompt word to the model protocol client, so that the model protocol client inputs the information prompt word into the task execution model, and determines the call interface information corresponding to the task information based on the second output result output by the task execution model; Receive the call interface information fed back by the model protocol client.
3. The method according to claim 2, wherein The interface configuration information includes an interface configuration vector, and the interface configuration vector is stored in a vector library; The determining the information prompt word of the interface configuration information associated with the task information based on the task information sent by the received model protocol client and the interface configuration information includes: Send the task information sent by the received model protocol client to the vector library, so that the vector library determines the interface configuration vector associated with the task information based on the similarity degree between at least one interface configuration vector and the task information, and determines the information prompt word of the interface configuration vector associated with the task information; Receive the information prompt word fed back by the vector library.
4. The method according to claim 2, wherein The call interface information corresponding to the task information includes a call interface address and interface input parameters corresponding to the call interface address; The accessing the called business party corresponding to the call interface information based on the call interface information to obtain the associated business data related to the task information from the business data of the called business party includes: Generate a data acquisition request corresponding to the task information based on the interface input parameters corresponding to the call interface address; Send the data acquisition request to the call interface corresponding to the call interface address, so that the called business party to which the call interface belongs determines the associated business data based on the received data acquisition request, and receive the associated business data sent by the called business party.
5. The method according to claim 1, characterized in that, Sending the associated service data to the model protocol client, so that the model protocol client inputs the associated service data and the task information into a pre-trained task execution model, and determining response information corresponding to the task information based on a first output result of the task execution model, includes: Sending the associated service data to the model protocol client, so that the model protocol client sends the associated service data, the task information, and preset format requirement information to the task execution model, obtaining a first output result corresponding to the task information, and using the first output result as the response information corresponding to the task information; Wherein, the corresponding relationship between the task type and the response format is recorded in the format requirement information.
6. The method according to claim 1, characterized in that, Applied to a target model protocol server, the target model protocol server is a model protocol server in a distributed server system, and domain names of all the model protocol servers in the distributed server system are the same.
7. The method according to claim 1, wherein Before determining the call interface information from interface configuration information of at least one service party pre-stored based on the task information sent by the received model protocol client, further includes: Responding to a registration operation of business interfaces of at least one service party, generating interface registration information; Determining interface configuration information corresponding to the registered interfaces based on the interface registration information, and storing the interface configuration information; Wherein, the interface configuration information includes the interface address, interface name, and field information of the registered interfaces; the field information includes at least one of parameter field name, parameter field description, interface type, and whether it is required.
8. The method according to claim 7, wherein The determining interface configuration information corresponding to the registered interfaces based on the interface registration information includes: Performing an audit operation on the interface registration information to determine an audit result of the interface registration information; In the case that the audit result is passed, using the business interface corresponding to the interface registration information as the registered interface, and using the interface registration information as the interface configuration information of the registered interface.
9. A method for generating response information, characterized in that, Applied to a model protocol client, the method includes: Generating task information, sending the task information to a model protocol server, so that the model protocol server determines call interface information from interface configuration information of at least one service party pre-stored, and accessing a called service party corresponding to the call interface information based on the call interface information to obtain associated service data related to the task information from business data of the called service party; wherein, the model protocol server is a server connected to the model protocol client in a model context protocol architecture; Receiving the associated service data sent by the model protocol server, inputting the associated service data and the task information into a pre-trained task execution model, and determining response information corresponding to the task information based on a first output result of the task execution model.
10. The method according to claim 9, characterized in that Sending the task information to a model protocol server, so that the model protocol server determines call interface information from interface configuration information of at least one business party stored in advance, includes: Sending the task information to a model protocol server, so that the model protocol server determines an information prompt word of interface configuration information associated with the task information based on the received task information and the interface configuration information, and sends the information prompt word to the model protocol client; Receiving the information prompt word, inputting the information prompt word into the task execution model, determining call interface information corresponding to the task information based on a second output result output by the task execution model, and sending the call interface information to the model protocol server.
11. A response information generating device, characterized in that, Configured in the model protocol server, the device includes: An information determination module, configured to determine call interface information from interface configuration information of at least one business party stored in advance based on task information sent by a model protocol client; wherein, the model protocol client is a client connected to the model protocol server in a model context protocol architecture; A data acquisition module, configured to access a called business party corresponding to the call interface information based on the call interface information, so as to acquire associated business data related to the task information from business data of the called business party; A data sending module, configured to send the associated business data to the model protocol client, so that the model protocol client inputs the associated business data and the task information into a pre-trained task execution model, and determines response information corresponding to the task information based on a first output result of the task execution model.
12. A response information generating device, characterized in that, Configured in the model protocol client, the device includes: An information generation module, configured to generate task information, send the task information to a model protocol server, so that the model protocol server determines call interface information from interface configuration information of at least one business party stored in advance, and accesses a called business party corresponding to the call interface information based on the call interface information, so as to acquire associated business data related to the task information from business data of the called business party; wherein, the model protocol server is a server connected to the model protocol client in a model context protocol architecture; A data receiving module, configured to receive the associated business data sent by the model protocol server, input the associated business data and the task information into a pre-trained task execution model, and determine response information corresponding to the task information based on a first output result of the task execution model.
13. A model protocol server, characterized in that, Includes: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the response information generation method according to any one of claims 1-8.
14. A model protocol client, characterized in that, Includes: At least one processor; And A memory communicatively connected to the at least one processor; wherein, the memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the response information generation method according to any one of claims 9-10.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to implement the response information generation method according to any one of claims 1-10 when executed.
16. A computer program product comprising a computer program which, when executed by a processor, implements the response information generation method according to any one of claims 1-10.
Citation Information
Patent Citations
Application program interface scheduling system and method based on large-scale language model
CN117033030A
Multi-protocol service calling method and device, equipment and medium
CN117119079A
Automatic internet of things protocol adaptation method and system based on large model
CN119211393A
Service processing method, device and equipment
CN119624599A
Open platform docking system and method based on large language model
CN119883209A
Cited By
Cloud mobile phone control system based on large language model
CN120658720A
Cloud mobile phone control system based on large language model
CN120658720B
Business service method, system and device based on user request, and electronic equipment
CN121078011A