CN118114771B - Function tool calling method, device, medium and equipment in trusted execution environment - Google Patents
Function tool calling method, device, medium and equipment in trusted execution environment Download PDFInfo
- Publication number
- CN118114771B CN118114771B CN202410508494.8A CN202410508494A CN118114771B CN 118114771 B CN118114771 B CN 118114771B CN 202410508494 A CN202410508494 A CN 202410508494A CN 118114771 B CN118114771 B CN 118114771B
- Authority
- CN
- China
- Prior art keywords
- function tool
- data
- language model
- target
- large language
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/04—Inference or reasoning models
- G06N5/041—Abduction
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/57—Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6245—Protecting personal data, e.g. for financial or medical purposes
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Medical Informatics (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Stored Programmes (AREA)
Abstract
本说明书实施例公开了一种可信执行环境中的函数工具调用方法及装置、介质、设备,涉及计算机技术领域。首先,获取用户输入的问题数据,将问题数据输入到部署于可信执行环境的目标大语言模型中,得到问题数据对应的函数工具调用推理数据;根据函数工具调用推理数据调用目标函数工具,以通过目标函数工具返回问题数据对应的反馈结果。本说明书实施例中的技术方案能够有效提升大语言模型对于函数工具的调用效率,提升处理速度;其次还对用户调用函数工具的权限进行管控,进一步提升数据的安全性。
The embodiments of this specification disclose a method and apparatus, medium, and equipment for calling a function tool in a trusted execution environment, and relate to the field of computer technology. First, obtain the problem data input by the user, input the problem data into the target large language model deployed in the trusted execution environment, and obtain the function tool call reasoning data corresponding to the problem data; call the target function tool according to the function tool call reasoning data, so as to return the feedback result corresponding to the problem data through the target function tool. The technical solution in the embodiments of this specification can effectively improve the calling efficiency of the large language model for the function tool and improve the processing speed; secondly, it also manages the user's authority to call the function tool, and further improves the security of the data.
Description
技术领域Technical Field
本公开涉及计算机技术领域,尤其涉及一种可信执行环境中的函数工具调用方法及装置、介质、设备。The present disclosure relates to the field of computer technology, and in particular to a method, device, medium, and equipment for calling a function tool in a trusted execution environment.
背景技术Background Art
随着科学技术的飞速发展,大语言模型(Large Language Model,LLM)越来越受到人们的关注。大语言模型是基于海量文本数据训练的深度学习模型,能够生成自然语言文本或理解语言文本的含义,这类模型可以执行多种自然语言处理(Natural LanguageProcessing,NLP)任务,包括但不限于文本分类、问答和对话等。With the rapid development of science and technology, large language models (LLM) have attracted more and more attention. Large language models are deep learning models trained based on massive text data, which can generate natural language text or understand the meaning of language text. Such models can perform a variety of natural language processing (NLP) tasks, including but not limited to text classification, question answering, and dialogue.
由于大语言模型会记忆大量的个人隐私数据,为了保证大语言模型中的个人隐私数据不会被攻击者截取,一般会将大语言模型部署在可信执行环境(Trusted ExecutionEnvironment,TEE)中。可信执行环境TEE是一个安全的计算环境,能够保护运行在其中的代码和数据免受外部攻击,包括来自操作系统、硬件和其他应用程序的攻击。TEE通过在处理器内部创建内存隔离的执行环境,可以在保证计算效率的前提下完成隐私保护的计算。Since large language models will memorize a large amount of personal privacy data, in order to ensure that the personal privacy data in the large language model will not be intercepted by attackers, the large language model is generally deployed in a trusted execution environment (TEE). The trusted execution environment TEE is a secure computing environment that can protect the code and data running in it from external attacks, including attacks from the operating system, hardware, and other applications. By creating a memory-isolated execution environment inside the processor, TEE can complete privacy-protected calculations while ensuring computing efficiency.
目前,部署在可信执行环境中的大语言模型在根据用户输入调用函数工具时,需要将支持的所有函数工具的信息提交给大语言模型,由大语言模型决定调用的函数工具,如果函数工具的数量较多,那么提交给大语言模型的输入就越长,导致大语言模型的函数工具调用速度较低,降低大语言模型的处理效率。At present, when a large language model deployed in a trusted execution environment calls a function tool based on user input, it is necessary to submit information of all supported function tools to the large language model, which determines the function tool to call. If the number of function tools is large, the input submitted to the large language model will be longer, resulting in a lower function tool calling speed of the large language model, reducing the processing efficiency of the large language model.
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本说明书的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this specification, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field.
发明内容Summary of the invention
本说明书实施例提供一种可信执行环境中的函数工具调用方法、可信执行环境中的函数工具调用装置、存储介质及电子设备,目的在于有效提升大语言模型对于函数工具的调用效率,提升大语言模型的处理速度。The embodiments of this specification provide a method for calling a function tool in a trusted execution environment, a device for calling a function tool in a trusted execution environment, a storage medium, and an electronic device, with the aim of effectively improving the efficiency of calling function tools by a large language model and improving the processing speed of a large language model.
根据本说明书实施例的第一方面,提供了一种可信执行环境中的函数工具调用方法,包括:According to a first aspect of an embodiment of this specification, a function tool calling method in a trusted execution environment is provided, comprising:
获取输入的问题数据;Get input question data;
将所述问题数据输入到部署于可信执行环境的目标大语言模型中,得到所述问题数据对应的函数工具调用推理数据;Inputting the problem data into a target large language model deployed in a trusted execution environment to obtain function tool call reasoning data corresponding to the problem data;
根据所述函数工具调用推理数据调用目标函数工具,以通过所述目标函数工具返回所述问题数据对应的反馈结果。The objective function tool is called according to the inference data called by the function tool, so as to return a feedback result corresponding to the problem data through the objective function tool.
进一步地,在一些实施方式中,所述根据所述函数工具调用推理数据调用目标函数工具,包括:Further, in some implementations, calling the target function tool according to the function tool calling the inference data includes:
对所述函数工具调用推理数据中所包含的目标函数工具进行权限验证,确定权限验证结果;Performing authority verification on the target function tool included in the inference data called by the function tool, and determining an authority verification result;
若确定所述权限验证结果为验证通过,则根据所述函数工具调用推理数据调用所述目标函数工具。If it is determined that the permission verification result is verified to be passed, the target function tool is called according to the inference data called by the function tool.
进一步地,在一些实施方式中,所述方法还包括:Furthermore, in some embodiments, the method further comprises:
若确定所述权限验证结果为验证失败,则返回无权限调用的错误提示。If it is determined that the permission verification result is a verification failure, an error prompt indicating that the call is not authorized is returned.
进一步地,在一些实施方式中,所述函数工具调用推理数据包括所述目标函数工具的第一标识信息;Further, in some implementations, the function tool calling reasoning data includes first identification information of the target function tool;
所述对所述函数工具调用推理数据中所包含的目标函数工具进行权限验证,确定权限验证结果,包括:The performing authority verification on the target function tool included in the inference data called by the function tool and determining the authority verification result includes:
获取所述问题数据对应的用户账户,并确定所述用户账户对应的函数工具调用权限列表,所述函数工具调用权限列表包括所述用户账户有权限调用的函数工具的第二标识信息;Acquire a user account corresponding to the problem data, and determine a function tool calling permission list corresponding to the user account, wherein the function tool calling permission list includes second identification information of function tools that the user account has permission to call;
将所述第一标识信息与所述第二标识信息进行匹配,若匹配成功则确定所述权限验证结果为验证通过。The first identification information is matched with the second identification information, and if the match is successful, the authority verification result is determined to be verification passed.
进一步地,在一些实施方式中,所述函数工具调用推理数据包括所述目标函数工具的函数参数列表;Further, in some implementations, the function tool call reasoning data includes a function parameter list of the target function tool;
所述根据所述函数工具调用推理数据调用目标函数工具,以通过所述目标函数工具返回所述问题数据对应的反馈结果,包括:The calling of the objective function tool according to the inference data by the function tool, so as to return the feedback result corresponding to the problem data through the objective function tool, includes:
根据所述函数工具调用推理数据中的第一标识信息匹配目标函数工具;Matching a target function tool according to the first identification information in the inference data called by the function tool;
通过所述目标函数工具以及所述函数参数列表中的各函数参数生成行为请求数据;Generate behavior request data through the target function tool and each function parameter in the function parameter list;
基于所述行为请求数据调取所述问题数据对应的反馈结果。The feedback result corresponding to the problem data is retrieved based on the behavior request data.
进一步地,在一些实施方式中,所述目标大语言模型是通过模型训练过程得到的,所述模型训练过程包括:Further, in some implementations, the target large language model is obtained through a model training process, and the model training process includes:
获取原始数据集,所述原始数据集包括样本问题数据和所述样本问题数据对应的样本调用推理数据,所述样本调用推理数据包括所述样本问题数据需要调用的样本函数工具以及函数参数列表;Acquire an original data set, wherein the original data set includes sample question data and sample call reasoning data corresponding to the sample question data, wherein the sample call reasoning data includes a sample function tool and a function parameter list that need to be called by the sample question data;
对所述原始数据集进行划分,确定样本训练集以及评估测试集;Dividing the original data set to determine a sample training set and an evaluation test set;
通过所述样本训练集对训练好的初始大语言模型进行模型参数调整,得到目标大语言模型;Adjusting model parameters of the trained initial large language model using the sample training set to obtain a target large language model;
根据所述评估测试集对所述目标大语言模型进行准确性评估;Performing accuracy evaluation on the target large language model according to the evaluation test set;
若确定所述目标大语言模型的输出准确率大于或者等于预设的准确率阈值,则确定所述目标大语言模型完成模型训练。If it is determined that the output accuracy of the target large language model is greater than or equal to a preset accuracy threshold, it is determined that the target large language model completes model training.
进一步地,在一些实施方式中,所述方法还包括:Furthermore, in some embodiments, the method further comprises:
若确定所述目标大语言模型的输出准确率小于所述准确率阈值,则重复执行以下步骤,直到新的目标大语言模型的输出准确率大于或者等于所述准确率阈值:If it is determined that the output accuracy of the target large language model is less than the accuracy threshold, the following steps are repeatedly performed until the output accuracy of the new target large language model is greater than or equal to the accuracy threshold:
通过所述样本训练集对目标大语言模型进行模型参数更新,得到新的目标大语言模型;Updating the model parameters of the target large language model through the sample training set to obtain a new target large language model;
根据所述评估测试集对所述新的目标大语言模型进行准确性评估,确定所述新的目标大语言模型对应的输出准确率。The accuracy of the new target large language model is evaluated according to the evaluation test set to determine the output accuracy rate corresponding to the new target large language model.
根据本说明书实施例的第二方面,还提供了一种可信执行环境中的函数工具调用装置,包括:According to a second aspect of an embodiment of this specification, a function tool calling device in a trusted execution environment is also provided, including:
问题数据获取模块,用于获取输入的问题数据;A question data acquisition module is used to acquire input question data;
函数工具推理模块,用于将所述问题数据输入到部署于可信执行环境的目标大语言模型中,得到所述问题数据对应的函数工具调用推理数据;A function tool reasoning module, used for inputting the problem data into a target large language model deployed in a trusted execution environment, and obtaining function tool call reasoning data corresponding to the problem data;
反馈结果生成模块,用于根据所述函数工具调用推理数据调用目标函数工具,以通过所述目标函数工具返回所述问题数据对应的反馈结果。The feedback result generating module is used to call the target function tool according to the inference data called by the function tool, so as to return the feedback result corresponding to the problem data through the target function tool.
根据本说明书实施例的第三方面,提供了一种计算机程序产品,所述计算机程序产品存储有至少一条指令,所述至少一条指令适于由处理器加载并执行第一方面中的方法步骤。According to a third aspect of the embodiments of this specification, a computer program product is provided, wherein the computer program product stores at least one instruction, and the at least one instruction is suitable for being loaded by a processor and executing the method steps in the first aspect.
根据本说明书实施例的第四方面,提供了一种存储介质,所述存储介质存储有计算机程序,所述计算机程序适于由处理器加载并执行第一方面中的方法步骤。According to a fourth aspect of the embodiments of this specification, a storage medium is provided, wherein the storage medium stores a computer program, wherein the computer program is suitable for being loaded by a processor and executing the method steps in the first aspect.
根据本说明书实施例的第五方面,提供了一种电子设备,包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行第一方面中的方法步骤。According to a fifth aspect of the embodiments of this specification, there is provided an electronic device, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps in the first aspect.
在本说明书实施例中,通过获取用户输入的问题数据,并将问题数据输入到部署于可信执行环境的目标大语言模型中,得到问题数据对应的函数工具调用推理数据;根据函数工具调用推理数据调用目标函数工具,以通过目标函数工具返回问题数据对应的反馈结果。一方面,通过将问题数据输入到预先训练好的目标大语言模型中,即可得到问题数据对应的函数工具调用推理数据,并通过函数工具调用推理数据调用目标函数工具得到用于回答问题数据的反馈结果,相比于将支持的所有函数工具的信息提交给大语言模型进行筛选,可以有效减少大语言模型的数据处理量,提升目标函数工具的调用效率,从而提升大语言模型对于问题数据的回答处理效率;另一方面,通过部署于可信执行环境的目标大语言模型实现对目标函数工具的选取和调用,无需借助其它工具,即可实现在提升函数工具的调用效率的同时,提高目标大语言模型中的个人隐私数据的安全性。In the embodiment of the present specification, by obtaining the question data input by the user and inputting the question data into the target large language model deployed in the trusted execution environment, the function tool calling reasoning data corresponding to the question data is obtained; the target function tool is called according to the function tool calling reasoning data, so as to return the feedback result corresponding to the question data through the target function tool. On the one hand, by inputting the question data into the pre-trained target large language model, the function tool calling reasoning data corresponding to the question data can be obtained, and the target function tool is called by the function tool calling reasoning data to obtain the feedback result for answering the question data. Compared with submitting the information of all supported function tools to the large language model for screening, the data processing amount of the large language model can be effectively reduced, the calling efficiency of the target function tool can be improved, and thus the answer processing efficiency of the large language model for the question data can be improved; on the other hand, by selecting and calling the target function tool through the target large language model deployed in the trusted execution environment, without the help of other tools, it is possible to improve the calling efficiency of the function tool while improving the security of the personal privacy data in the target large language model.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本说明书的实施例,并与说明书一起用于解释本说明书的原理。显而易见地,下面描述中的附图仅仅是本说明书的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the specification, and are used together with the specification to explain the principles of the specification. Obviously, the accompanying drawings described below are only some embodiments of the specification, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
图1示出了可以应用本公开实施例的一种可信执行环境中的函数工具调用方法及装置的示例性应用环境的系统架构的示意图。FIG1 shows a schematic diagram of a system architecture of an exemplary application environment to which a method and apparatus for calling a function tool in a trusted execution environment according to an embodiment of the present disclosure can be applied.
图2示意性示出了本说明书的一些实施例的可信执行环境中的函数工具调用方法的流程示意图;FIG2 schematically shows a flow chart of a function tool calling method in a trusted execution environment of some embodiments of this specification;
图3示意性示出了本说明书的一些实施例的对推理得到的目标函数工具进行权限验证的流程示意图;FIG3 schematically shows a flowchart of performing authority verification on a target function tool obtained by inference in some embodiments of this specification;
图4示意性示出了本说明书的一些实施例的目标大语言模型的模型训练过程的流程示意图;FIG4 schematically shows a flow chart of a model training process of a target large language model in some embodiments of this specification;
图5示意性示出了本说明书的一些实施例的在可信执行环境中实现对函数工具调用的流程示意图;FIG5 schematically shows a flow chart of implementing a function tool call in a trusted execution environment according to some embodiments of the present specification;
图6示意性示出了根据本说明书的一些实施例的可信执行环境中的函数工具调用装置的示意图。FIG6 schematically shows a schematic diagram of a function tool calling device in a trusted execution environment according to some embodiments of the present specification.
图7示意性示出了根据本说明书的一些实施例的电子设备的计算机系统的结构示意图。FIG. 7 schematically shows a schematic diagram of the structure of a computer system of an electronic device according to some embodiments of the present specification.
图8示意性示出了根据本说明书的一些实施例的计算机可读存储介质的示意图。FIG. 8 schematically shows a schematic diagram of a computer-readable storage medium according to some embodiments of the present specification.
在附图中,相同或对应的标号表示相同或对应的部分。In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
具体实施方式DETAILED DESCRIPTION
为使本说明书的目的、技术方案和优点更加清楚,下面将结合本说明书具体实施例及相应的附图对本说明书技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本说明书保护的范围。In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
在本说明书使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书。在本说明书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and/or" used in this article refers to and includes any or all possible combinations of one or more associated listed items.
应当理解,尽管在本说明书可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本说明书的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本说明书的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本说明书的各方面。In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of this specification sheet. However, those skilled in the art will appreciate that the technical scheme of this specification sheet can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of this specification sheet.
此外,附图仅为示意性图解,并非一定是按比例绘制。附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。Furthermore, the drawings are only schematic illustrations and are not necessarily drawn to scale. The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
图1示出了可以应用本公开实施例的一种可信执行环境中的函数工具调用方法及装置的示例性应用环境的系统架构的示意图。FIG1 shows a schematic diagram of a system architecture of an exemplary application environment to which a method and apparatus for calling a function tool in a trusted execution environment according to an embodiment of the present disclosure can be applied.
如图1所示,系统架构100可以包括终端设备101、102、103中的一个或多个,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。终端设备101、102、103可以是各种具有人工智能(Artificial Intelligence,AI)计算能力的电子设备,包括但不限于台式计算机、便携式计算机、智能手机和平板电脑等等。应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。比如服务器105可以是多个服务器组成的服务器集群等。As shown in FIG1 , the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with artificial intelligence (AI) computing capabilities, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that the number of terminal devices, networks, and servers in FIG1 is merely schematic. According to implementation requirements, there may be any number of terminal devices, networks, and servers. For example, the server 105 may be a server cluster consisting of multiple servers, etc.
本公开实施例所提供的可信执行环境中的函数工具调用方法一般由终端设备101、102、103执行,相应地,可信执行环境中的函数工具调用装置一般设置于终端设备101、102、103中。但本领域技术人员容易理解的是,本公开实施例所提供的可信执行环境中的函数工具调用方法也可以由服务器105执行,相应的,可信执行环境中的函数工具调用装置也可以设置于服务器105中,本示例性实施例中对此不做特殊限定。举例而言,终端设备101、102、103可以获取用户输入的问题数据,并将问题数据发送到服务器105,服务器105将问题数据输入到部署于可信执行环境的目标大语言模型中,得到问题数据对应的函数工具调用推理数据,并根据函数工具调用推理数据调用目标函数工具返回问题数据对应的反馈结果,服务器105将反馈结果发送给终端设备101、102、103,并展示给用户。The function tool calling method in the trusted execution environment provided by the embodiment of the present disclosure is generally executed by the terminal devices 101, 102, and 103, and accordingly, the function tool calling device in the trusted execution environment is generally set in the terminal devices 101, 102, and 103. However, it is easy for those skilled in the art to understand that the function tool calling method in the trusted execution environment provided by the embodiment of the present disclosure can also be executed by the server 105, and accordingly, the function tool calling device in the trusted execution environment can also be set in the server 105, which is not particularly limited in this exemplary embodiment. For example, the terminal devices 101, 102, and 103 can obtain the question data input by the user, and send the question data to the server 105, and the server 105 inputs the question data into the target large language model deployed in the trusted execution environment, obtains the function tool calling reasoning data corresponding to the question data, and calls the target function tool according to the function tool calling reasoning data to return the feedback result corresponding to the question data, and the server 105 sends the feedback result to the terminal devices 101, 102, and 103, and displays it to the user.
在本说明书实施例中,首先提供了一种可信执行环境中的函数工具调用方法,该可信执行环境中的函数工具调用方法可以应用于终端设备或者服务器,本实施例不以此为限,下面以终端设备执行该方法为例进行说明。图2示意性示出了根据本说明书的一些实施例的可信执行环境中的函数工具调用方法的流程示意图。参考图2所示,该可信执行环境中的函数工具调用方法可以包括以下步骤:In an embodiment of the present specification, a method for calling a function tool in a trusted execution environment is first provided. The method for calling a function tool in a trusted execution environment can be applied to a terminal device or a server. The present embodiment is not limited thereto. The following is an example of a terminal device executing the method. FIG2 schematically shows a flow chart of a method for calling a function tool in a trusted execution environment according to some embodiments of the present specification. Referring to FIG2, the method for calling a function tool in a trusted execution environment may include the following steps:
步骤S210,获取输入的问题数据;Step S210, obtaining input question data;
步骤S220,将所述问题数据输入到部署于可信执行环境的目标大语言模型中,得到所述问题数据对应的函数工具调用推理数据;Step S220, inputting the problem data into a target large language model deployed in a trusted execution environment to obtain function tool call reasoning data corresponding to the problem data;
步骤S230,根据所述函数工具调用推理数据调用目标函数工具,以通过所述目标函数工具返回所述问题数据对应的反馈结果。Step S230, calling the objective function tool according to the inference data called by the function tool, so as to return the feedback result corresponding to the problem data through the objective function tool.
根据本说明书实施例中的可信执行环境中的函数工具调用方法,一方面,通过将问题数据输入到预先训练好的目标大语言模型中,即可得到问题数据对应的函数工具调用推理数据,并通过函数工具调用推理数据调用目标函数工具得到用于回答问题数据的反馈结果,相比于将支持的所有函数工具的信息提交给大语言模型进行筛选,可以有效减少大语言模型的数据处理量,提升目标函数工具的调用效率,从而提升大语言模型对于问题数据的回答处理效率;另一方面,通过部署于可信执行环境的目标大语言模型实现对目标函数工具的选取和调用,无需借助其它工具,即可实现在提升函数工具的调用效率的同时,提高目标大语言模型中的个人隐私数据的安全性。According to the function tool calling method in the trusted execution environment in the embodiments of the present specification, on the one hand, by inputting the question data into the pre-trained target large language model, the function tool calling reasoning data corresponding to the question data can be obtained, and the target function tool is called by the function tool calling the reasoning data to obtain the feedback result for answering the question data. Compared with submitting the information of all supported function tools to the large language model for screening, the data processing amount of the large language model can be effectively reduced, and the calling efficiency of the target function tool can be improved, thereby improving the answer processing efficiency of the large language model for question data; on the other hand, the target function tool can be selected and called by the target large language model deployed in the trusted execution environment, without the help of other tools, so that the security of personal privacy data in the target large language model can be improved while improving the calling efficiency of the function tool.
下面,将对本示例实施例中的可信执行环境中的函数工具调用方法进行进一步的说明。Next, the function tool calling method in the trusted execution environment in this example embodiment will be further described.
在步骤S210中,获取输入的问题数据。In step S210, input question data is obtained.
在本说明书一示例实施例中,问题数据是指用户通过预先提供的输入接口生成的指令,例如,问题数据可以是查询天气情况的指令,如“今天天气怎么样”,问题数据也可以是打开路径导航的指令,如“导航到公司”,当然,问题数据还可以是其他内容的输入指令,本示例实施例对此不做特殊限定。In an example embodiment of the present specification, question data refers to instructions generated by a user through an input interface provided in advance. For example, the question data may be an instruction to query weather conditions, such as "What's the weather like today?" The question data may also be an instruction to open path navigation, such as "Navigate to the company." Of course, the question data may also be input instructions for other content, and this example embodiment does not specifically limit this.
可以通过提供用户交互界面,并在用户交互界面上提供输入框的形式,由用户通过输入框手动输入问题数据;也可以提供语音识别模块,通过识别用户的语音指令,得到用户以语音方式输入的问题数据;当然,还可以通过提供预指令控件的方式,由用户选择触发预指令控件实现问题数据的输入,本示例实施例对于问题数据的输入方式不做特殊限定。A user interaction interface can be provided, and an input box can be provided on the user interaction interface, so that the user can manually input the question data through the input box; a voice recognition module can also be provided to obtain the question data input by the user in the form of voice by recognizing the user's voice instructions; of course, a pre-instruction control can also be provided, and the user can choose to trigger the pre-instruction control to input the question data. This example embodiment does not specifically limit the method for inputting the question data.
在步骤S220中,将所述问题数据输入到部署于可信执行环境的目标大语言模型中,得到所述问题数据对应的函数工具调用推理数据。In step S220, the problem data is input into a target large language model deployed in a trusted execution environment to obtain function tool call reasoning data corresponding to the problem data.
在本说明书一示例实施例中,可信执行环境是指通过在处理器内部进行隔离得到的执行环境,该执行环境能够保护运行在其中的代码和数据免受外部攻击,包括来自操作系统、硬件和其他应用程序的攻击。通过将大语言模型部署在可信执行环境中,可以有效避免大语言模型中所包含的个人隐私数据的泄露,提升大语言模型在运行过程中的安全性。In an example embodiment of this specification, a trusted execution environment refers to an execution environment obtained by isolating inside a processor, which can protect the code and data running therein from external attacks, including attacks from the operating system, hardware, and other applications. By deploying a large language model in a trusted execution environment, the leakage of personal privacy data contained in the large language model can be effectively avoided, and the security of the large language model during operation can be improved.
大语言模型需要支持较丰富的功能,这种情况下,大语言模型会通过调用函数工具的方式提升功能的丰富性;而部署于可信执行环境的大语言模型,由于可信执行环境的封闭性,在调用函数工具时需要将支持的所有函数工具的相关信息,如函数工具的名称、用途、参数的列表等信息,与用户的提问同时提交给大语言模型,导致大语言模型的输入的数据量过大,降低大语言模型对函数工具的调用效率,进而降低大语言模型的处理速度。本说明书实施例中通过微调训练的目标大语言模型解决大语言模型对函数工具的调用效率的问题。The large language model needs to support richer functions. In this case, the large language model will improve the richness of functions by calling function tools. However, due to the closed nature of the trusted execution environment, the large language model deployed in the trusted execution environment needs to submit relevant information of all supported function tools, such as the name, purpose, parameter list, etc. of the function tool, to the large language model at the same time as the user's question when calling the function tool, resulting in too much input data to the large language model, reducing the efficiency of the large language model calling the function tool, and thus reducing the processing speed of the large language model. In the embodiments of this specification, the problem of the efficiency of the large language model calling the function tool is solved by fine-tuning the trained target large language model.
目标大语言模型是指对预先训练好的大语言模型进行微调优化,以使其能够推理用户的问题数据所需要调用的函数工具的模型,例如,预先训练好的大语言模型可以是BERT(Bidirectional Encoder Representations from Transformers)模型,相应的,目标大语言模型可以是BERT模型;当然,预先训练好的大语言模型也可以是GPT(GenerativePre-trained Transformer)模型,相应的,目标大语言模型也可以是GPT模型;可以理解的,目标大语言模型还可以是部署于可信执行环境其他类型的、执行不同类型的自然语言处理任务(Natural Language Processing,NLP)的深度学习模型,本示例实施例对于目标大语言模型的模型类型不做特殊限定。The target big language model refers to a model that fine-tunes and optimizes a pre-trained big language model so that it can infer the function tools needed to call the user's problem data. For example, the pre-trained big language model can be a BERT (Bidirectional Encoder Representations from Transformers) model, and accordingly, the target big language model can be a BERT model; of course, the pre-trained big language model can also be a GPT (Generative Pre-trained Transformer) model, and accordingly, the target big language model can also be a GPT model; it can be understood that the target big language model can also be other types of deep learning models deployed in a trusted execution environment that perform different types of natural language processing tasks (Natural Language Processing, NLP). This example embodiment does not specifically limit the model type of the target big language model.
函数工具调用推理数据是指目标大语言模型基于输入的问题数据推理得到的与需调用的函数工具相关的信息,例如,函数工具调用推理数据可以是待调用的函数工具的标识信息,也可以是待调用的函数工具的参数列表,当然,函数工具调用推理数据还可以是其他类型的用于调用函数工具的信息,本示例实施例对此不做特殊限定。Function tool call reasoning data refers to information related to the function tool to be called, which is inferred by the target large language model based on the input problem data. For example, the function tool call reasoning data can be the identification information of the function tool to be called, or it can be a parameter list of the function tool to be called. Of course, the function tool call reasoning data can also be other types of information used to call the function tool, and this example embodiment does not make any special limitations on this.
在得到用户输入的问题数据之后,可以将问题数据输入到部署于可信执行环境的目标大语言模型中,直接得到问题数据对应的函数工具调用推理数据,从而根据函数工具调用推理数据调用所需要的函数工具即可,并不需要将支持的所有函数工具的相关信息均作为输入,有效降低目标大语言模型的处理的数据量。After obtaining the problem data input by the user, the problem data can be input into the target large language model deployed in the trusted execution environment to directly obtain the function tool call inference data corresponding to the problem data, so as to call the required function tool according to the function tool call inference data. It is not necessary to use the relevant information of all supported function tools as input, thereby effectively reducing the amount of data processed by the target large language model.
在步骤S230中,根据所述函数工具调用推理数据调用目标函数工具,以通过所述目标函数工具返回所述问题数据对应的反馈结果。In step S230, the objective function tool is called according to the inference data called by the function tool, so as to return a feedback result corresponding to the problem data through the objective function tool.
在本说明书一示例实施例中,目标函数工具是指目标大语言模型推理得到的用于回复问题数据时所需要调用的函数工具,例如,目标函数工具可以是应用程序编程接口(Application Programming Interface,API),也可以是软件开发工具包(SoftwareDevelopment Kit,SDK),本示例实施例对于目标函数工具的类型不做特别限定。In an example embodiment of the present specification, the objective function tool refers to a function tool obtained by inference of a target large language model and required to be called when replying to question data. For example, the objective function tool may be an application programming interface (Application Programming Interface, API) or a software development kit (Software Development Kit, SDK). This example embodiment does not specifically limit the type of the objective function tool.
举例而言,以用户输入的问题数据是“今天天气怎么样”,将该问题数据输入到部署于可信执行环境的目标大语言模型中,目标大语言模型可以理解该问题数据的意图为询问今天的天气,那么目标大语言模型输出的函数工具调用推理数据中包含天气查询API的标识信息以及天气查询API的参数列表,进而根据该标识信息匹配天气查询API,并结合天气查询API的参数列表生成天气查询请求,天气查询API基于天气查询请求可以返回日期为今天的天气查询的反馈结果,并将反馈结果展示给用户,完成本次问题数据的函数工具调用。For example, suppose the question data input by the user is "How is the weather today?" and the question data is input into the target large language model deployed in the trusted execution environment. The target large language model can understand that the intention of the question data is to ask about today's weather. Then the function tool call inference data output by the target large language model includes the identification information of the weather query API and the parameter list of the weather query API. The weather query API is then matched according to the identification information, and a weather query request is generated in combination with the parameter list of the weather query API. The weather query API can return the feedback result of the weather query with a date of today based on the weather query request, and display the feedback result to the user, completing the function tool call of this question data.
通过将问题数据输入到预先训练好的目标大语言模型中,即可得到问题数据对应的函数工具调用推理数据,并通过函数工具调用推理数据调用目标函数工具得到用于回答问题数据的反馈结果,相比于将支持的所有函数工具的信息提交给大语言模型进行筛选,可以有效减少大语言模型的数据处理量,提升目标函数工具的调用效率,从而提升大语言模型对于问题数据的回答处理效率;通过部署于可信执行环境的目标大语言模型实现对目标函数工具的选取和调用,无需借助其它工具,即可实现在提升函数工具的调用效率的同时,提高目标大语言模型中的个人隐私数据的安全性。By inputting the question data into the pre-trained target large language model, the function tool calling inference data corresponding to the question data can be obtained, and the function tool calls the inference data to call the target function tool to obtain the feedback result used to answer the question data. Compared with submitting the information of all supported function tools to the large language model for screening, it can effectively reduce the data processing volume of the large language model, improve the calling efficiency of the target function tool, and thus improve the answer processing efficiency of the large language model for question data; by deploying the target large language model in a trusted execution environment to select and call the target function tool, without the help of other tools, it is possible to improve the calling efficiency of the function tool while improving the security of personal privacy data in the target large language model.
下面,对步骤S210至步骤S230进行详细说明。Next, steps S210 to S230 are described in detail.
在本说明书一示例实施例中,在根据函数工具调用推理数据调用目标函数工具之前,可以对目标大语言模型推理得到的函数工具调用推理数据中所包含的目标函数工具进行权限验证。参考图3所示,具体可以包括:In an example embodiment of the present specification, before calling the target function tool according to the function tool call reasoning data, the target function tool included in the function tool call reasoning data obtained by the target large language model can be authenticated. Referring to FIG3 , it can specifically include:
步骤S310,对所述函数工具调用推理数据中所包含的目标函数工具进行权限验证,确定权限验证结果;Step S310, performing authority verification on the target function tool included in the inference data called by the function tool, and determining the authority verification result;
步骤S320,若确定所述权限验证结果为验证通过,则根据所述函数工具调用推理数据调用所述目标函数工具。Step S320: If it is determined that the permission verification result is verified to be passed, the target function tool is called according to the inference data of the function tool.
步骤S330,若确定所述权限验证结果为验证失败,则返回无权限调用的错误提示。Step S330: If it is determined that the permission verification result is a verification failure, an error prompt indicating that the call is not authorized is returned.
其中,权限验证结果是指用于表征用户是否有权限调用目标函数工具的验证结果,例如,若权限验证结果是“True”,则可以表示验证通过,即用户有权限调用函数工具调用推理数据中所包含的目标函数工具;若权限验证结果是“False”,则可以表示验证失败,即用户无权限调用函数工具调用推理数据中所包含的目标函数工具;当然,权限验证结果也可以是“0”或者“1”,其中“0”可以表示验证失败,“1”可以表示验证成功,本示例实施例对于权限验证结果的表现形式不做特别限定。Among them, the permission verification result refers to the verification result used to characterize whether the user has the authority to call the target function tool. For example, if the permission verification result is "True", it may indicate that the verification is successful, that is, the user has the authority to call the function tool to call the target function tool contained in the reasoning data; if the permission verification result is "False", it may indicate that the verification failed, that is, the user does not have the authority to call the function tool to call the target function tool contained in the reasoning data; of course, the permission verification result can also be "0" or "1", where "0" can indicate verification failure and "1" can indicate verification success. This example embodiment does not specifically limit the form of expression of the permission verification result.
在确定权限验证结果为验证通过时,可以根据函数工具调用推理数据调用目标函数工具,并通过调用的目标函数工具返回问题数据对应的反馈结果;在确定权限验证结果为验证失败时,可以返回无权限调用的错误提示,以便于及时通知用户。When it is determined that the permission verification result is passed, the target function tool can be called according to the inference data of the function tool, and the feedback result corresponding to the problem data is returned through the called target function tool; when it is determined that the permission verification result is failed, an error prompt of unauthorized call can be returned to notify the user in time.
通过对目标大语言模型输出的函数工具调用推理数据中所包含的目标函数工具进行权限验证,实现对函数工具的调用管控,只要在用户有权限调用相关的函数工具时,才允许调用相关的函数工具返回反馈结果,可以进一步保证数据的安全性,避免可能发生的个人隐私数据泄露的可能性。By verifying the permissions of the target function tool contained in the inference data output by the target large language model, the call control of the function tool is realized. Only when the user has the permission to call the relevant function tool, the call of the relevant function tool is allowed to return the feedback result, which can further ensure the security of the data and avoid the possibility of personal privacy data leakage.
可选的,函数工具调用推理数据可以包括目标函数工具的第一标识信息和目标函数工具对应的函数参数列表。其中,第一标识信息是指用于识别目标函数工具的数据,例如,第一标识信息可以是目标函数工具的名称,也可以是目标函数工具的唯一编码,当然,还可以是目标函数工具的调用路径,本示例实施例对于目标函数工具的第一标识信息的类型不做特殊限定。Optionally, the function tool call reasoning data may include the first identification information of the target function tool and the function parameter list corresponding to the target function tool. The first identification information refers to the data used to identify the target function tool. For example, the first identification information may be the name of the target function tool, or the unique code of the target function tool, or of course, the calling path of the target function tool. This example embodiment does not specifically limit the type of the first identification information of the target function tool.
函数参数列表是指用于定义函数工具请求的具体行为和内容的输入数据集合,例如,函数参数可以是路径参数,也可以是查询参数,当然还可以是请求体参数、请求头参数、操作系统参数、软件版本参数等,函数参数列表可以包含以上函数参数中的一个或者多个的组合,本示例实施例对于函数参数列表中的函数参数的具体类型和数量不做特殊限定。A function parameter list refers to a set of input data used to define the specific behavior and content of a function tool request. For example, a function parameter can be a path parameter or a query parameter, and of course it can also be a request body parameter, a request header parameter, an operating system parameter, a software version parameter, etc. The function parameter list can contain a combination of one or more of the above function parameters. This example embodiment does not impose any special restrictions on the specific type and number of function parameters in the function parameter list.
可以通过以下步骤实现对函数工具调用推理数据中所包含的目标函数工具进行权限验证,确定权限验证结果:The following steps can be used to verify the permissions of the target function tool contained in the function tool call reasoning data and determine the permission verification result:
可以获取问题数据对应的用户账户,并确定用户账户对应的函数工具调用权限列表,函数工具调用权限列表可以包括用户账户有权限调用的函数工具的第二标识信息;可以将第一标识信息与第二标识信息进行匹配,若匹配成功则确定权限验证结果为验证通过。The user account corresponding to the problem data can be obtained, and the function tool calling permission list corresponding to the user account can be determined. The function tool calling permission list can include the second identification information of the function tools that the user account has the authority to call; the first identification information can be matched with the second identification information, and if the match is successful, the permission verification result is determined to be verification passed.
其中,函数工具调用权限列表是指预先配置的用户有权限调用的函数工具的标识集合。第二标识信息是指用于识别用户账户有权限调用的函数工具的标识信息,例如,第二标识信息可以是用户账户有权限调用的函数工具的名称、唯一编码等,本实施例不以此为限。The function tool calling permission list refers to a pre-configured set of identifiers of function tools that the user has the permission to call. The second identification information refers to identification information used to identify the function tools that the user account has the permission to call. For example, the second identification information can be the name, unique code, etc. of the function tool that the user account has the permission to call, but this embodiment is not limited to this.
在得到需要调用的目标函数工具的第一标识信息之后,获取输入问题数据的用户账户,并调取该用户账户对应的函数工具调用权限列表,将第一标识信息和第二标识信息进行匹配,如果匹配成功则可以确定权限验证结果为验证通过。After obtaining the first identification information of the target function tool to be called, the user account of the input problem data is obtained, and the function tool calling permission list corresponding to the user account is retrieved, and the first identification information and the second identification information are matched. If the match is successful, it can be determined that the permission verification result is verified passed.
可以理解的,在需调用的目标函数工具的数量为多个时,可以将各目标函数工具对应的第一标识信息依次进行匹配,若全部匹配成功,则可以确定权限验证结果为验证通过;若至少存在一个第一标识信息没有匹配成功,则可以确定权限验证结果为验证失败。It can be understood that when there are multiple target function tools to be called, the first identification information corresponding to each target function tool can be matched in turn. If all matches are successful, the authority verification result can be determined as passed; if at least one first identification information is not matched successfully, the authority verification result can be determined as failed.
通过将用户账户有权限调用的函数工具整理为包含第二标识信息的函数工具调用权限列表,并将目标大语言模型输出的函数工具调用推理数据中的第一标识信息与函数工具调用权限列表中的第二标识信息进行匹配实现权限验证,计算量小,权限验证准确性较高,权限验证效率高。The permission verification is achieved by organizing the function tools that the user account has the permission to call into a function tool call permission list containing the second identification information, and matching the first identification information in the function tool call inference data output by the target large language model with the second identification information in the function tool call permission list. The calculation amount is small, the permission verification accuracy is high, and the permission verification efficiency is high.
当然,还可以对支持的所有函数工具进行优先级分类,并为不同的用户账户分配不同的优先级,按照优先级判断用户账户对于函数工具的调用权限,本示例实施例对于权限验证的方式不做特殊限定。Of course, all supported function tools can also be prioritized and different priorities can be assigned to different user accounts. The user account's calling authority for the function tools can be determined based on the priority. This example embodiment does not specifically limit the method of authority verification.
在本说明书一示例实施例中,可以通过以下步骤实现根据函数工具调用推理数据调用目标函数工具,以通过目标函数工具返回问题数据对应的反馈结果,具体可以包括:In an example embodiment of the present specification, the following steps may be performed to implement calling the target function tool according to the inference data of the function tool, so as to return the feedback result corresponding to the problem data through the target function tool, which may specifically include:
可以根据函数工具调用推理数据中的第一标识信息匹配目标函数工具,并通过目标函数工具以及函数参数列表中的各函数参数生成行为请求数据,进而可以基于行为请求数据调取问题数据对应的反馈结果。The target function tool can be matched according to the first identification information in the inference data called by the function tool, and the behavior request data can be generated through the target function tool and each function parameter in the function parameter list, and then the feedback result corresponding to the problem data can be retrieved based on the behavior request data.
其中,行为请求数据是指用于定义函数工具请求的具体行为和内容的输入数据,例如,问题数据可以是“今天天气怎么样”,需要调用的目标函数工具可以是天气查询API,行为请求数据可以是由包含用户账户ID的路径参数、包含当前所在区域以及时间段的查询数据的查询参数构成的请求指令;当然,此处仅是示意性举例说明,并不应对本示例实施例造成任何特殊限定。Among them, behavior request data refers to input data used to define the specific behavior and content of the function tool request. For example, the question data may be "How is the weather today?", and the target function tool to be called may be the weather query API. The behavior request data may be a request instruction consisting of a path parameter including the user account ID and a query parameter including query data for the current area and time period. Of course, this is only an illustrative example and should not impose any special limitations on this example embodiment.
在将问题数据输入到部署于可信执行环境的目标大语言模型之后,目标大语言模型可以输出包含需调用的目标函数工具的第一标识信息以及输入目标函数工具的函数参数列表,进而可以根据函数工具调用推理数据中的第一标识信息匹配目标函数工具,并通过函数参数列表中的各函数参数生成行为请求数据,进而可以将行为请求数据输入到目标函数工具中,调取问题数据对应的反馈结果;这样,不需要将支持的所有函数工具的相关信息作为目标大语言模型的输入,可以有效降低大语言模型需要处理的数据量,提升大语言模型对于函数工具的调取效率,从而提升大语言模型的处理效率。After the problem data is input into the target large language model deployed in the trusted execution environment, the target large language model can output the first identification information of the target function tool to be called and the function parameter list input to the target function tool, and then the target function tool can be matched according to the first identification information in the function tool call reasoning data, and behavior request data can be generated through each function parameter in the function parameter list, and then the behavior request data can be input into the target function tool to retrieve the feedback result corresponding to the problem data; in this way, there is no need to use the relevant information of all supported function tools as the input of the target large language model, which can effectively reduce the amount of data that the large language model needs to process, improve the efficiency of the large language model in calling the function tool, and thus improve the processing efficiency of the large language model.
在本说明书一示例实施例中,目标大语言模型是通过模型训练过程得到的,可以通过图4中的步骤实现目标大语言模型的模型训练过程,具体可以包括:In an exemplary embodiment of the present specification, the target large language model is obtained through a model training process, and the model training process of the target large language model can be implemented through the steps in FIG. 4 , which may specifically include:
步骤S410,获取原始数据集,所述原始数据集包括样本问题数据和所述样本问题数据对应的样本调用推理数据,所述样本调用推理数据包括所述样本问题数据需要调用的样本函数工具以及函数参数列表;Step S410, obtaining an original data set, wherein the original data set includes sample question data and sample call reasoning data corresponding to the sample question data, wherein the sample call reasoning data includes a sample function tool and a function parameter list that need to be called by the sample question data;
步骤S420,对所述原始数据集进行划分,确定样本训练集以及评估测试集;Step S420, dividing the original data set to determine a sample training set and an evaluation test set;
步骤S430,通过所述样本训练集对训练好的初始大语言模型进行模型参数调整,得到目标大语言模型;Step S430, adjusting model parameters of the trained initial large language model using the sample training set to obtain a target large language model;
步骤S440,根据所述评估测试集对所述目标大语言模型进行准确性评估;Step S440, performing accuracy evaluation on the target large language model according to the evaluation test set;
步骤S450,若确定所述目标大语言模型的输出准确率大于或者等于预设的准确率阈值,则确定所述目标大语言模型完成模型训练。Step S450: If it is determined that the output accuracy of the target large language model is greater than or equal to a preset accuracy threshold, it is determined that the target large language model has completed model training.
其中,原始数据集可以通过从开源数据库中直接获取,也可以通过采集源数据,并基于源数据筛选构建得到,本示例实施例对于原始数据集构建的方式不做特殊限定。原始数据集可以包括样本问题数据和样本问题数据对应的样本调用推理数据,该样本调用推理数据可以包括样本问题数据需要调用的样本函数工具以及函数参数列表。The original data set can be directly obtained from an open source database, or can be obtained by collecting source data and filtering and constructing based on the source data. This example embodiment does not specifically limit the way in which the original data set is constructed. The original data set can include sample problem data and sample call reasoning data corresponding to the sample problem data. The sample call reasoning data can include a sample function tool and a function parameter list that the sample problem data needs to call.
初始大语言模型是指提前训练好的能够执行不同类型的自然语言理解任务的深度学习模型,例如,初始大语言模型可以是BERT模型,也可以是GPT模型,本示例实施例对于初始大语言模型的类型不做特殊限定。The initial large language model refers to a pre-trained deep learning model that can perform different types of natural language understanding tasks. For example, the initial large language model can be a BERT model or a GPT model. This example embodiment does not specifically limit the type of the initial large language model.
在对原始数据集划分时,可以采用预设的划分比例进行划分,例如,划分比例可以是8:2,也可以是6:3;当然,还可以通过随机划分的方式将原始数据集中的数据进行划分,得到样本训练集以及评估测试集,本示例实施例对此不做特殊限定。When dividing the original data set, a preset division ratio can be used for division, for example, the division ratio can be 8:2 or 6:3; of course, the data in the original data set can also be divided by random division to obtain a sample training set and an evaluation test set, and this example embodiment does not make any special limitations on this.
可以通过原始数据集构建的样本训练集对初始大语言模型进行模型参数调整,得到能够推理回答问题数据所需要调用的目标函数工具以及函数参数列表的目标大语言模型;然后可以通过原始数据集构建的评估测试集对初步训练完成的目标大语言模型进行验证优化,以使目标大语言模型达到准确率指标,完成对目标大语言模型的训练。The model parameters of the initial large language model can be adjusted through the sample training set constructed by the original data set to obtain the target function tool and function parameter list required to infer and answer the question data; then the target large language model that has completed the preliminary training can be verified and optimized through the evaluation test set constructed by the original data set, so that the target large language model reaches the accuracy index and the training of the target large language model is completed.
准确率阈值是指设置的用于验证优化目标大语言模型的参数,例如,准确率阈值可以是99.5%,也可以是95%,准确率阈值可以根据实际使用情况进行自定义设置,本示例实施例对于准确率阈值的取值不做特殊限定。The accuracy threshold refers to a parameter set for verifying the optimization target large language model. For example, the accuracy threshold can be 99.5% or 95%. The accuracy threshold can be customized according to actual usage. This example embodiment does not impose any special restrictions on the value of the accuracy threshold.
可以将评估测试集中的样本问题数据输入到初步训练完成的目标大语言模型中,推理输出目标函数工具以及函数参数列表,然后将推理得到的目标函数工具以及函数参数列表与样本调用推理数据中的函数工具以及样本函数参数列表进行比对确定比对结果,在多轮评估测试之后,可以得到当前的目标大语言模型的输出准确率。在输出准确率大于或者等于准确率阈值时,可以认为当次训练好的目标大语言模型达到使用条件,可以完成对目标大语言模型的训练。The sample problem data in the evaluation test set can be input into the target large language model that has been preliminarily trained, and the target function tool and function parameter list can be inferred to output. Then, the target function tool and function parameter list obtained by inference are compared with the function tool and sample function parameter list in the sample call inference data to determine the comparison result. After multiple rounds of evaluation tests, the output accuracy of the current target large language model can be obtained. When the output accuracy is greater than or equal to the accuracy threshold, it can be considered that the trained target large language model meets the use conditions and the training of the target large language model can be completed.
可选的,在确定目标大语言模型的输出准确率小于准确率阈值时,可以重复执行以下步骤,直到最近一次更新的新的目标大语言模型的输出准确率大于或者等于所述准确率阈值,完成对目标大语言模型的训练,重复步骤可以包括:Optionally, when it is determined that the output accuracy of the target large language model is less than the accuracy threshold, the following steps may be repeatedly performed until the output accuracy of the new target large language model updated most recently is greater than or equal to the accuracy threshold, and the training of the target large language model is completed. The repeating steps may include:
可以通过样本训练集对目标大语言模型进行模型参数更新,得到新的目标大语言模型,然后可以根据评估测试集对新的目标大语言模型进行准确性评估,确定新的目标大语言模型对应的输出准确率。The model parameters of the target large language model can be updated through the sample training set to obtain a new target large language model. Then, the accuracy of the new target large language model can be evaluated according to the evaluation test set to determine the output accuracy rate corresponding to the new target large language model.
通过将原始数据集分为样本训练集和评估测试集,并通过样本训练集实现对目标大语言模型的模型参数调整,以及通过评估测试集目标大语言模型的验证评估,结合准确率阈值可以实现对目标大语言模型的不断调整优化,得到推理性能较好的目标大语言模型,可以有效提升目标大语言模型对于目标函数工具调用的准确性,从而提升对于问题数据的回答结果的准确性。By dividing the original data set into a sample training set and an evaluation test set, and adjusting the model parameters of the target large language model through the sample training set, and verifying and evaluating the target large language model through the evaluation test set, combined with the accuracy threshold, the target large language model can be continuously adjusted and optimized to obtain a target large language model with better reasoning performance, which can effectively improve the accuracy of the target large language model's call to the objective function tool, thereby improving the accuracy of the answer to the question data.
图5示意性示出了本说明书的一些实施例的在可信执行环境中实现对函数工具调用的流程示意图。FIG5 schematically shows a flowchart of implementing a function tool call in a trusted execution environment according to some embodiments of the present specification.
参考图5所示,步骤S502,获取原始数据集,并对原始数据集进行划分得到样本训练集和评估测试集;步骤S504,通过样本训练集对初始大语言模型进行模型参数调整,得到初步训练完成的目标大语言模型;步骤S506,通过评估测试集对初步训练完成的目标大语言模型进行验证评估,确定该目标大语言模型的输出准确率;步骤S508,确定输出准确率是否大于或者等于预设的准确率阈值,若确定目标大语言模型的输出准确率大于或者等于预设的准确率阈值,则执行步骤S510,否则执行步骤S504;步骤S510,完成对目标大语言模型的模型训练;步骤S512,将训练好的目标大语言模型部署到终端设备或者服务器的可信执行环境中;步骤S514,获取用户输入的问题数据;步骤S516,将问题数据输入到目标大语言模型中,得到函数工具调用推理数据,函数工具调用推理数据包括目标函数工具的第一标识信息和函数参数列表;步骤S518,根据问题数据对应的用户账户确定函数调用权限列表,函数调用权限列表包括有权限调用的函数工具的第二标识信息;步骤S520,将第一标识信息和第二标识信息进行比对,并根据比对结果确定权限验证结果;步骤S522,确定权限验证结果是否为验证成功,若确定权限验证结果为验证成功,则执行步骤S524,否则执行步骤S526;步骤S524,根据目标函数工具和函数参数列表生成行为请求数据,并将行为请求数据输入到目标函数工具,以使目标函数工具返回问题数据对应的反馈结果,并结束当前流程;步骤S526,返回无权限调用的错误提示,并结束当前流程。As shown in reference to FIG5 , step S502 is to obtain an original data set, and divide the original data set into a sample training set and an evaluation test set; step S504 is to adjust the model parameters of the initial large language model through the sample training set to obtain a target large language model that has been preliminarily trained; step S506 is to verify and evaluate the target large language model that has been preliminarily trained through the evaluation test set to determine the output accuracy of the target large language model; step S508 is to determine whether the output accuracy is greater than or equal to a preset accuracy threshold, if it is determined that the output accuracy of the target large language model is greater than or equal to the preset accuracy threshold, then execute step S510, otherwise execute step S504; step S510 is to complete the model training of the target large language model; step S512 is to deploy the trained target large language model to a trusted execution environment of a terminal device or a server; step S514 is to obtain the question data input by the user; step S516 is to deploy the question data Input into the target large language model to obtain function tool call reasoning data, the function tool call reasoning data includes the first identification information and function parameter list of the target function tool; step S518, determine the function call permission list according to the user account corresponding to the problem data, the function call permission list includes the second identification information of the function tool with permission to call; step S520, compare the first identification information and the second identification information, and determine the permission verification result according to the comparison result; step S522, determine whether the permission verification result is successful, if it is determined that the permission verification result is successful, execute step S524, otherwise execute step S526; step S524, generate behavior request data according to the target function tool and the function parameter list, and input the behavior request data to the target function tool, so that the target function tool returns the feedback result corresponding to the problem data, and ends the current process; step S526, return an error prompt for unauthorized call, and end the current process.
综上所述,通过获取用户输入的问题数据,并将问题数据输入到部署于可信执行环境的目标大语言模型中,得到问题数据对应的函数工具调用推理数据;根据函数工具调用推理数据调用目标函数工具,以通过目标函数工具返回问题数据对应的反馈结果。一方面,通过将问题数据输入到预先训练好的目标大语言模型中,即可得到问题数据对应的函数工具调用推理数据,并通过函数工具调用推理数据调用目标函数工具得到用于回答问题数据的反馈结果,相比于将支持的所有函数工具的信息提交给大语言模型进行筛选,可以有效减少大语言模型的数据处理量,提升目标函数工具的调用效率,从而提升大语言模型对于问题数据的回答处理效率;另一方面,通过部署于可信执行环境的目标大语言模型实现对目标函数工具的选取和调用,无需借助其它工具,即可实现在提升函数工具的调用效率的同时,提高目标大语言模型中的个人隐私数据的安全性。In summary, by obtaining the question data input by the user and inputting the question data into the target large language model deployed in the trusted execution environment, the function tool call reasoning data corresponding to the question data is obtained; the target function tool is called according to the function tool call reasoning data, so as to return the feedback result corresponding to the question data through the target function tool. On the one hand, by inputting the question data into the pre-trained target large language model, the function tool call reasoning data corresponding to the question data can be obtained, and the target function tool is called by the function tool call reasoning data to obtain the feedback result for answering the question data. Compared with submitting the information of all supported function tools to the large language model for screening, the data processing amount of the large language model can be effectively reduced, the calling efficiency of the target function tool can be improved, and thus the answer processing efficiency of the large language model for question data can be improved; on the other hand, the target function tool can be selected and called through the target large language model deployed in the trusted execution environment, without the help of other tools, so that the security of personal privacy data in the target large language model can be improved while improving the calling efficiency of the function tool.
需要说明的是,尽管在附图中以特定顺序描述了本说明书中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。It should be noted that, although the steps of the method in this specification are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and/or one step may be decomposed into multiple steps, etc.
此外,在本说明书实施例中,还提供了一种可信执行环境中的函数工具调用装置。参照图6所示,该可信执行环境中的函数工具调用装置600包括:问题数据获取模块610、函数工具推理模块620和反馈结果生成模块630。其中:In addition, in the embodiment of the present specification, a function tool calling device in a trusted execution environment is also provided. Referring to FIG6 , the function tool calling device 600 in the trusted execution environment includes: a problem data acquisition module 610, a function tool reasoning module 620, and a feedback result generation module 630. Among them:
问题数据获取模块610,用于获取输入的问题数据;The question data acquisition module 610 is used to acquire input question data;
函数工具推理模块620,用于将所述问题数据输入到部署于可信执行环境的目标大语言模型中,得到所述问题数据对应的函数工具调用推理数据;A function tool reasoning module 620 is used to input the problem data into a target large language model deployed in a trusted execution environment to obtain function tool call reasoning data corresponding to the problem data;
反馈结果生成模块630,用于根据所述函数工具调用推理数据调用目标函数工具,以通过所述目标函数工具返回所述问题数据对应的反馈结果。The feedback result generating module 630 is used to call the target function tool according to the inference data called by the function tool, so as to return the feedback result corresponding to the problem data through the target function tool.
在本说明书的一种示例性实施例中,基于前述方案,反馈结果生成模块630包括:In an exemplary embodiment of the present specification, based on the above solution, the feedback result generating module 630 includes:
函数工具权限验证单元,可以用于对所述函数工具调用推理数据中所包含的目标函数工具进行权限验证,确定权限验证结果;The function tool permission verification unit can be used to verify the permission of the target function tool included in the function tool calling reasoning data and determine the permission verification result;
目标函数工具调用单元,可以用于在确定所述权限验证结果为验证通过时,则根据所述函数工具调用推理数据调用所述目标函数工具。The target function tool calling unit may be configured to call the target function tool according to the function tool calling inference data when it is determined that the permission verification result is a passed verification.
在本说明书的一种示例性实施例中,基于前述方案,可信执行环境中的函数工具调用装置600还包括验证失败反馈单元,该验证失败反馈单元被配置为:In an exemplary embodiment of the present specification, based on the above-mentioned solution, the function tool calling device 600 in the trusted execution environment further includes a verification failure feedback unit, which is configured as follows:
若确定所述权限验证结果为验证失败,则返回无权限调用的错误提示。If it is determined that the permission verification result is a verification failure, an error prompt indicating that the call is not authorized is returned.
在本说明书的一种示例性实施例中,基于前述方案,函数工具调用推理数据包括所述目标函数工具的第一标识信息;In an exemplary embodiment of the present specification, based on the aforementioned solution, the function tool calling reasoning data includes the first identification information of the target function tool;
函数工具权限验证单元被配置为:The function tool permission verification unit is configured as:
获取所述问题数据对应的用户账户,并确定所述用户账户对应的函数工具调用权限列表,所述函数工具调用权限列表包括所述用户账户有权限调用的函数工具的第二标识信息;Acquire a user account corresponding to the problem data, and determine a function tool calling permission list corresponding to the user account, wherein the function tool calling permission list includes second identification information of function tools that the user account has permission to call;
将所述第一标识信息与所述第二标识信息进行匹配,若匹配成功则确定所述权限验证结果为验证通过。The first identification information is matched with the second identification information, and if the match is successful, the authority verification result is determined to be verification passed.
在本说明书的一种示例性实施例中,基于前述方案,函数工具调用推理数据包括所述目标函数工具的函数参数列表;反馈结果生成模块630被配置为:In an exemplary embodiment of the present specification, based on the above solution, the function tool calling reasoning data includes a function parameter list of the target function tool; the feedback result generation module 630 is configured as follows:
根据所述函数工具调用推理数据中的第一标识信息匹配目标函数工具;Matching a target function tool according to the first identification information in the inference data called by the function tool;
通过所述目标函数工具以及所述函数参数列表中的各函数参数生成行为请求数据;Generate behavior request data through the target function tool and each function parameter in the function parameter list;
基于所述行为请求数据调取所述问题数据对应的反馈结果。The feedback result corresponding to the problem data is retrieved based on the behavior request data.
在本说明书的一种示例性实施例中,基于前述方案,目标大语言模型是通过模型训练过程得到的,可信执行环境中的函数工具调用装置600还包括模型训练模块,该模型训练模块包括:In an exemplary embodiment of the present specification, based on the above-mentioned solution, the target large language model is obtained through a model training process, and the function tool calling device 600 in the trusted execution environment also includes a model training module, which includes:
数据采集单元,可以用于获取原始数据集,所述原始数据集包括样本问题数据和所述样本问题数据对应的样本调用推理数据,所述样本调用推理数据包括所述样本问题数据需要调用的样本函数工具以及函数参数列表;The data acquisition unit can be used to obtain an original data set, wherein the original data set includes sample problem data and sample call reasoning data corresponding to the sample problem data, wherein the sample call reasoning data includes a sample function tool and a function parameter list that need to be called by the sample problem data;
数据集划分单元,可以用于对所述原始数据集进行划分,确定样本训练集以及评估测试集;A data set division unit, which can be used to divide the original data set to determine a sample training set and an evaluation test set;
模型参数调整单元,可以用于通过所述样本训练集对训练好的初始大语言模型进行模型参数调整,得到目标大语言模型;A model parameter adjustment unit, which can be used to adjust the model parameters of the trained initial large language model through the sample training set to obtain a target large language model;
准确性评估单元,可以用于根据所述评估测试集对所述目标大语言模型进行准确性评估;若确定所述目标大语言模型的输出准确率大于或者等于预设的准确率阈值,则确定所述目标大语言模型完成模型训练。The accuracy evaluation unit can be used to perform accuracy evaluation on the target large language model according to the evaluation test set; if it is determined that the output accuracy of the target large language model is greater than or equal to a preset accuracy threshold, it is determined that the target large language model has completed model training.
在本说明书的一种示例性实施例中,基于前述方案,模型训练模块还包括模型参数更新单元,该模型参数更新单元被配置为:In an exemplary embodiment of the present specification, based on the above solution, the model training module further includes a model parameter updating unit, which is configured to:
若确定所述目标大语言模型的输出准确率小于所述准确率阈值,则重复执行以下步骤,直到新的目标大语言模型的输出准确率大于或者等于所述准确率阈值:If it is determined that the output accuracy of the target large language model is less than the accuracy threshold, the following steps are repeatedly performed until the output accuracy of the new target large language model is greater than or equal to the accuracy threshold:
通过所述样本训练集对目标大语言模型进行模型参数更新,得到新的目标大语言模型;Updating the model parameters of the target large language model through the sample training set to obtain a new target large language model;
根据所述评估测试集对所述新的目标大语言模型进行准确性评估,确定所述新的目标大语言模型对应的输出准确率。The accuracy of the new target large language model is evaluated according to the evaluation test set to determine the output accuracy rate corresponding to the new target large language model.
上述中可信执行环境中的函数工具调用装置各模块的具体细节已经在对应的可信执行环境中的函数工具调用方法中进行了详细的描述,因此此处不再赘述。The specific details of each module of the function tool calling device in the above-mentioned trusted execution environment have been described in detail in the corresponding function tool calling method in the trusted execution environment, so they will not be repeated here.
应当注意,尽管在上文详细描述中提及了可信执行环境中的函数工具调用装置的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本说明书的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that, although several modules or units of the function tool calling device in the trusted execution environment are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of this specification, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
此外,在本说明书的示例性实施例中,还提供了一种能够实现上述可信执行环境中的函数工具调用方法的电子设备。In addition, in an exemplary embodiment of the present specification, an electronic device capable of implementing the function tool calling method in the above-mentioned trusted execution environment is also provided.
所属技术领域的技术人员能够理解,本说明书的各个方面可以实现为系统、方法或程序产品。因此,本说明书的各个方面可以具体实现为以下形式,即:完全的硬件实施例、完全的软件实施例(包括固件、微代码等),或硬件和软件方面结合的实施例,这里可以统称为“电路”、“模块”或“系统”。Those skilled in the art will appreciate that various aspects of this specification may be implemented as a system, method, or program product. Therefore, various aspects of this specification may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit," "module," or "system."
下面参照图7来描述根据本说明书的这种实施例的电子设备700。图7所示的电子设备700仅仅是一个示例,不应对本说明书实施例的功能和使用范围带来任何限制。The electronic device 700 according to this embodiment of the present specification is described below with reference to Fig. 7. The electronic device 700 shown in Fig. 7 is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present specification.
如图7所示,电子设备700以通用计算设备的形式表现。电子设备700的组件可以包括但不限于:上述至少一个处理单元710、上述至少一个存储单元720、连接不同系统组件(包括存储单元720和处理单元710)的总线730、显示单元740。As shown in FIG7 , the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710 , the at least one storage unit 720 , a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710 ), and a display unit 740 .
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元710执行,使得所述处理单元710执行本说明书上述“示例性方法”部分中描述的根据本说明书各种示例性实施例的步骤。例如,所述处理单元710可以执行如图2中所示的步骤S210,获取输入的问题数据;步骤S220,将所述问题数据输入到部署于可信执行环境的目标大语言模型中,得到所述问题数据对应的函数工具调用推理数据;步骤S230,根据所述函数工具调用推理数据调用目标函数工具,以通过所述目标函数工具返回所述问题数据对应的反馈结果。The storage unit stores a program code, and the program code can be executed by the processing unit 710, so that the processing unit 710 executes the steps described in the "Exemplary Method" section of the present specification according to various exemplary embodiments of the present specification. For example, the processing unit 710 can execute step S210 as shown in FIG2 to obtain input problem data; step S220 to input the problem data into the target large language model deployed in the trusted execution environment to obtain the function tool call reasoning data corresponding to the problem data; step S230 to call the target function tool according to the function tool call reasoning data, so as to return the feedback result corresponding to the problem data through the target function tool.
存储单元720可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)721和/或高速缓存存储单元722,还可以进一步包括只读存储单元(ROM)723。The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 721 and/or a cache memory unit 722 , and may further include a read-only memory unit (ROM) 723 .
存储单元720还可以包括具有一组(至少一个)程序模块725的程序/实用工具724,这样的程序模块725包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The storage unit 720 may also include a program/utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
总线730可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
电子设备700也可以与一个或多个外部设备770(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备700交互的设备通信,和/或与使得该电子设备700能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口750进行。并且,电子设备700还可以通过网络适配器760与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器760通过总线730与电子设备700的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备700使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 700 may also communicate with one or more external devices 770 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and/or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication may be performed through an input/output (I/O) interface 750. In addition, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and/or public networks, such as the Internet) through a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 through a bus 730. It should be understood that, although not shown in the figure, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
通过以上的实施例的描述,本领域的技术人员易于理解,这里描述的示例实施例可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本说明书实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本说明书实施例的方法。Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of this specification can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of this specification.
参考图8所示,描述了根据本说明书的实施例的用于实现上述可信执行环境中的函数工具调用方法的程序产品800,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本说明书的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Referring to FIG8 , a program product 800 for implementing the function tool calling method in the above-mentioned trusted execution environment according to an embodiment of the present specification is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present specification is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言的任意组合来编写用于执行本说明书操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。Program code for performing the operations of the present specification may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
此外,上述附图仅是根据本说明书示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present specification, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
通过以上的实施例的描述,本领域的技术人员易于理解,这里描述的示例实施例可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本说明书实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、触控终端、或者网络设备等)执行根据本说明书实施例的方法。Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiments of this specification can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of this specification.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本说明书的其它实施例。本说明书实施例旨在涵盖提供的技术方案的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本说明书的一般性原理并包括本说明书未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的。Those skilled in the art will readily come up with other embodiments of the specification after considering the specification and practicing the invention disclosed herein. The embodiments of the specification are intended to cover any variations, uses, or adaptations of the technical solutions provided, which follow the general principles of the specification and include common knowledge or customary technical means in the art that are not disclosed in the specification. The specification and embodiments are to be regarded as exemplary only.
应当理解的是,本说明书并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。It should be understood that the present description is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410508494.8A CN118114771B (en) | 2024-04-25 | 2024-04-25 | Function tool calling method, device, medium and equipment in trusted execution environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410508494.8A CN118114771B (en) | 2024-04-25 | 2024-04-25 | Function tool calling method, device, medium and equipment in trusted execution environment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118114771A CN118114771A (en) | 2024-05-31 |
CN118114771B true CN118114771B (en) | 2024-09-24 |
Family
ID=91220978
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410508494.8A Active CN118114771B (en) | 2024-04-25 | 2024-04-25 | Function tool calling method, device, medium and equipment in trusted execution environment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118114771B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118568776A (en) * | 2024-07-29 | 2024-08-30 | 蚂蚁科技集团股份有限公司 | Privacy protection method, device and system for large language model |
CN119807383B (en) * | 2025-03-11 | 2025-06-06 | 浙江大华技术股份有限公司 | Function calling method, device and equipment based on large model |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117892828A (en) * | 2024-03-18 | 2024-04-16 | 青岛市勘察测绘研究院 | Natural language interaction method, device, equipment and medium for geographic information system |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021184311A1 (en) * | 2020-03-19 | 2021-09-23 | 中山大学 | Method and apparatus for automatically generating inference questions and answers |
CN116011590A (en) * | 2023-02-06 | 2023-04-25 | 中国烟草总公司贵州省公司 | Federal learning method, device and system |
CN116841506B (en) * | 2023-06-30 | 2024-05-03 | 北京百度网讯科技有限公司 | Program code generation method and device, model training method and device |
CN117171230A (en) * | 2023-08-04 | 2023-12-05 | 浙江大学 | In-database reasoning system suitable for target detection algorithm |
CN117540805A (en) * | 2023-11-06 | 2024-02-09 | 北京新唐思创教育科技有限公司 | Data processing methods, devices, electronic equipment and storage media |
CN117648998B (en) * | 2024-01-29 | 2024-04-26 | 西安电子科技大学 | Large language model federal pre-training method based on trusted execution environment |
-
2024
- 2024-04-25 CN CN202410508494.8A patent/CN118114771B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117892828A (en) * | 2024-03-18 | 2024-04-16 | 青岛市勘察测绘研究院 | Natural language interaction method, device, equipment and medium for geographic information system |
Non-Patent Citations (1)
Title |
---|
A Fast, Performant, Secure Distributed Training Framework for LLM;Wei Huang et al.;2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP);20240318;4800-4804 * |
Also Published As
Publication number | Publication date |
---|---|
CN118114771A (en) | 2024-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN118114771B (en) | Function tool calling method, device, medium and equipment in trusted execution environment | |
JP6828001B2 (en) | Voice wakeup method and equipment | |
CN110534113A (en) | Audio data desensitization method, device, equipment and storage medium | |
CN107909998A (en) | Phonetic order processing method, device, computer equipment and storage medium | |
CN111475616A (en) | Multi-turn dialogue method and device based on dialogue state prediction and computer equipment | |
CN113516340A (en) | Intelligent work order pushing method and device | |
CN115329876A (en) | A device fault handling method, device, computer equipment and storage medium | |
CN112084752A (en) | Statement marking method, device, equipment and storage medium based on natural language | |
CN113901837A (en) | An intent understanding method, apparatus, device and storage medium | |
CN118227868B (en) | Text processing method, device, electronic equipment and storage medium | |
CN109597739A (en) | Voice log services method and system in human-computer dialogue | |
CN112199470A (en) | Session-based customer complaint service method, intelligent terminal and storage medium | |
CN112231544A (en) | Search method, device and equipment for RPA robot combining RPA and AI | |
CN108320740A (en) | A kind of audio recognition method, device, electronic equipment and storage medium | |
CN119884347A (en) | Intelligent memory data processing method, system and nonvolatile storage medium | |
JP7182584B2 (en) | A method for outputting information of parsing anomalies in speech comprehension | |
CN119046540A (en) | User social behavior representation method, system, electronic equipment and storage medium | |
CN108231074A (en) | A kind of data processing method, voice assistant equipment and computer readable storage medium | |
CN118520976A (en) | Text dialogue generation model training method, text dialogue generation method and equipment | |
CN111104502A (en) | Dialogue management method, system, electronic device and storage medium for outbound system | |
CN120045646A (en) | Text processing method, text processing device, computer equipment, storage medium and program product | |
CN116954705A (en) | Function optimization method, device and equipment of application program and storage medium | |
CN111063344B (en) | Voice recognition method, mobile terminal and server | |
CN113901456A (en) | User behavior security prediction method, device, equipment and medium | |
CN113806230A (en) | Software testing method, device, equipment and medium based on case voice |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |