Task processing methods and electronic devices

By prioritizing the use of less resource-intensive functional components to process artificial intelligence tasks, and dynamically adjusting to more resource-intensive components when failures occur, the problem of resource waste in artificial intelligence models is solved, and more efficient task processing is achieved.

CN123068017APending Publication Date: 2026-11-10LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611139742.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing technologies, artificial intelligence models, when running, waste resources and computing power by loading a large number of repetitive tools and skills, which increases processing time and costs.

Method used

After receiving the target task, the system prioritizes using the first functional component with lower resource consumption to process the task. If the task fails, the second functional component with higher resource consumption is used. The system dynamically adjusts the functional components to ensure task success and reduce resource consumption.

Benefits of technology

It effectively reduces the resource consumption of artificial intelligence models in processing tasks, improves the task success rate, and avoids waste of resources and computing power.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123068017A_ABST
    Figure CN123068017A_ABST
Patent Text Reader

Abstract

This disclosure provides a task processing method and an electronic device, comprising: receiving a target task; processing the target task using a target model and first prompt information to obtain a first processing result of the target task, the first prompt information including information of a first functional component; responding to the first processing result including target task processing failure information, processing the target task using a target model and second prompt information to obtain a second processing result of the target task, the second prompt information including information of a second functional component, the resource consumption of the second functional component being greater than the resource consumption of the first functional component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a task processing method and an electronic device. Background Technology

[0002] In related technologies, artificial intelligence models or artificial intelligence agents can perform complex tasks by utilizing a variety of pre-configured tools and skills.

[0003] However, related technologies often add excessive descriptive information of tools and skills to the prompts and load the prompts into the AI ​​model when it starts running, which leads to increased word consumption of the AI ​​model and waste of resources. Summary of the Invention

[0004] In view of this, the present disclosure provides a task processing method and an electronic device.

[0005] One aspect of this disclosure provides a task processing method, comprising: receiving a target task; processing the target task using a target model and first prompt information to obtain a first processing result of the target task, the first prompt information including information of a first functional component; and, in response to the first processing result including target task processing failure information, processing the target task using a target model and second prompt information to obtain a second processing result of the target task, the second prompt information including information of a second functional component, the resource consumption of the second functional component being greater than the resource consumption of the first functional component.

[0006] According to embodiments of this disclosure, the first prompt information and the second prompt information include functional description information of functional components, and the target task processing failure information includes information about processing the target task using the first functional component in the first prompt information but failing to process it; further comprising: in response to the first processing result including information about processing the target task using the first functional component in the first prompt information but failing to process it, determining the second prompt information based on the functional description information of the first functional component that failed to process it; wherein the functional description information of the second functional component included in the second prompt information matches the functional description information of the first functional component that failed to process it.

[0007] According to embodiments of this disclosure, the target task processing failure information includes information that the processing failed because no functional component that meets the conditions for processing the target task was matched; it also includes: in response to the first processing result including information that the processing failed because no functional component that meets the processing conditions for the target task was matched, determining a second prompt information based on a second functional component that meets the processing conditions.

[0008] According to embodiments of this disclosure, determining the second prompt information includes: replacing the target functional component information in the first prompt information with information of the second functional component, wherein the target functional component is at least one of the functional components included in the first prompt information; and obtaining the second prompt information based on the replaced first prompt information.

[0009] According to embodiments of this disclosure, the method further includes: reducing the score of the first functional component included in the first processing result, wherein the score of the first functional component represents the number of times the first functional component successfully executes the target task; and, if the resource consumption of the second functional component is greater than the first resource consumption threshold, obtaining a second prompt message based on at least one of the information of removing functional components whose scores meet the score conditions and the information of functional components whose call frequencies meet the frequency requirements, and the information of the second functional component.

[0010] According to embodiments of this disclosure, the functional description information of a functional component is determined based on the functional description text of the functional component; it also includes: in response to the existence of multiple functional components with matching functional description information, determining the functional component whose functional description text satisfies the text quantity condition among the multiple functional components as the first functional component; and determining the second functional component based on the functional components among the multiple functional components other than the functional components that satisfy the text quantity condition.

[0011] According to embodiments of this disclosure, the first functional component is a set of functional components, and the second functional component is a set of functional components. The first set and the second set are determined as follows: the first set is determined based on functional components whose resource consumption is less than a second resource consumption threshold; the second set is determined based on functional components whose resource consumption is greater than or equal to the second resource consumption threshold.

[0012] According to embodiments of this disclosure, it further includes: in response to the existence of multiple functional components with the same functional description information in the first set, reserving one functional component among the multiple functional components.

[0013] According to an embodiment of this disclosure, after obtaining the second prompt information, the method further includes: in response to the existence of a functional component in the first set whose score meets the score condition or whose call frequency meets the frequency requirement, moving the functional component that meets the score condition or frequency requirement from the first set to the second set, wherein the first set is used to generate the first prompt information and the second set is used to generate the second prompt information; and moving the functional component in the second set used to generate the second prompt information from the second set to the first set.

[0014] Another aspect of this disclosure provides an apparatus, comprising: a receiving module for receiving a target task; a first generating module for processing the target task using a target model and first prompt information to obtain a first processing result of the target task, wherein the first prompt information includes information about a first functional component; and a second generating module for processing the target task using the target model and second prompt information in response to the first processing result including target task processing failure information to obtain a second processing result of the target task, wherein the second prompt information includes information about a second functional component, and the resource consumption of the second functional component is greater than the resource consumption of the first functional component.

[0015] Another aspect of this disclosure provides an electronic device, comprising: an electronic device including: a storage device for storing one or more programs; a processor for receiving a target task; processing the target task using a target model and first prompt information to obtain a first processing result of the target task, the first prompt information including information of a first functional component; and, in response to the first processing result including target task processing failure information, processing the target task using the target model and second prompt information to obtain a second processing result of the target task, the second prompt information including information of a second functional component, the resource consumption of the second functional component being greater than the resource consumption of the first functional component.

[0016] Another aspect of this disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the methods described above.

[0017] Another aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0019] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0020] Figure 1 This is a schematic diagram of an exemplary system architecture to which task processing methods and apparatus can be applied according to an embodiment of the present disclosure;

[0021] Figure 2 This is a flowchart of a task processing method according to an embodiment of the present disclosure;

[0022] Figure 3 This diagram illustrates the changes in the prompt information according to embodiments of the present disclosure;

[0023] Figure 4 A schematic block diagram of a task processing apparatus according to an embodiment of the present disclosure is shown.

[0024] Figure 5 A schematic block diagram of an electronic device that can be used to implement the task processing method of the embodiments of the present disclosure is shown. Detailed Implementation

[0025] The embodiments of this disclosure will now be described with reference to the accompanying drawings. Various details of the embodiments of this disclosure are included to aid understanding and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0027] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.

[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0029] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "having at least one of A, B and C" should include, but is not limited to, having only A, having only B, having only C, having A and B, having A and C, having B and C, and / or having A, B and C, etc.).

[0030] Before introducing the technical solutions provided in the embodiments of this disclosure, the relevant technologies involved in this disclosure will be explained first.

[0031] In related technologies, users configure various tools and skills for artificial intelligence models and agents to enable them to handle complex tasks.

[0032] However, in related technologies, the tools or skills that users configure for AI models and AI agents contain redundant tools and skills. Furthermore, before processing tasks, AI models and AI agents load all the tools and skills configured by the user, resulting in the loading of a large number of redundant tools and skills. This increases the loading time of AI models and AI agents and wastes their computing power and processing resources.

[0033] Furthermore, due to the existence of a large number of tools and skills with repetitive functions in related technologies, artificial intelligence models or agents need to decide which tools and skills to use among these repetitive tools and skills, resulting in additional computations for the artificial intelligence models or agents.

[0034] Based on this, the embodiments of this disclosure, after receiving the target task, first control the target model to process the target task using a first prompt message including information of a first functional component, and if the first processing result indicates processing failure, then use a second prompt message including information of a second functional component with greater resource consumption than the first functional component to process the target task. This achieves the priority of using the first functional component with less resource consumption to process the target task, and dynamically loading the second functional component with greater resource consumption when the first functional component fails to process the target task.

[0035] Figure 1 This is a schematic diagram of an exemplary system architecture to which task processing methods and apparatus can be applied according to an embodiment of this disclosure. It should be noted that... Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.

[0036] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the terminal devices 101, 102, and 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0037] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0038] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0039] It should be noted that the task processing method provided in this embodiment can generally be executed by server 105. Correspondingly, the task processing device provided in this embodiment can generally be located in server 105. The task processing method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the task processing device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.

[0040] Figure 2 This is a flowchart of a task processing method according to an embodiment of the present disclosure.

[0041] like Figure 2 As shown, the task processing method of this embodiment may include operations S210~S230.

[0042] In operation S210, the target task is received.

[0043] The target task can be a task instruction input by a user object. The target task can be unimodal information including text or images, or multimodal information including at least two of the following: text, images, and audio.

[0044] In operation S220, the target task is processed using the target model and the first prompt information to obtain the first processing result of the target task. The first prompt information includes information about the first functional component.

[0045] If the target task includes unimodal information, the target model can be a large language model or a neural network model. If the target task includes multimodal information, the target model can be a multimodal model. The target model can be one of the following: a large language model (LLM), a multimodal large model, a model capable of generating text, a model with more than 100 million adjustable parameters, a model that can output corresponding results based on input natural language instructions, a model that can convert input natural language instructions into feature sequences and infer output results based on feature sequences, a model that can convert input information into feature sequences and infer subsequent features of the feature sequences, or a model that can generate corresponding results based on prompt words.

[0046] The first prompt message may include information about multiple functional components, including information about the first functional component. This first prompt message can be used to guide the target model to select a functional component to process the target task based on the descriptions of the multiple functional components.

[0047] The first processing result can be either the result of the target model successfully processing the target task, or the result of processing the target task using the first prompt information but failing to do so.

[0048] In operation S230, in response to the first processing result including target task processing failure information, the target task is processed using the target model and the second prompt information to obtain the second processing result of the target task. The second prompt information includes information about the second functional component, and the resource consumption of the second functional component is greater than the resource consumption of the first functional component.

[0049] The target model represents the target task processing failure information based on the first prompt information including the first functional component, indicating the failure of the target task and the reason for the failure.

[0050] The information for the second functional component exists in the second prompt message but not in the first prompt message.

[0051] Resource consumption characterizes the number of tokens and computational cost consumed in inputting information from functional components into the target model. Resource consumption can be, for example, at least one of execution difficulty, token loading consumption, and invocation risk. Execution difficulty indicates whether the target model requires collaboration with other functional components, the number of collaborative functional components, and at least one of the node steps required to process the target task using the functional component. The higher the execution difficulty of the functional components used by the target model to process the target task, the more tokens and computational power are consumed during operation. Token loading consumption indicates the number of tokens consumed by the target model when loading information from functional components in the loading prompts. Invocation risk indicates whether interaction with the user is required during the use of the functional component, and whether the generated processing results will have irreversible effects, leading to complex rollback operations if the operation of the functional component needs to be restored, thus increasing token consumption.

[0052] According to embodiments of this disclosure, upon receiving a target task, the target model is preferentially controlled to use a first prompt message that includes information from a first functional component with low resource consumption but excludes information from a second functional component to process the target task. This avoids the problem of high resource consumption caused by fully loading information from all functional components in the first prompt message, thus reducing the resource consumption required to process the target task using functional components. Furthermore, if processing the target task using the first prompt message fails, information from the second functional component, which has high resource consumption, is then used to process the target task. This reduces the resource consumption of functional components while ensuring a high success rate in processing the target task using functional components.

[0053] In some embodiments, the second functional component may be a functional component among a plurality of preset functional components whose resource consumption is greater than that of the first functional component.

[0054] In some embodiments, some functional components with higher resource consumption than the first functional component can be selected from a plurality of preset functional components as the second functional component.

[0055] According to embodiments of this disclosure, the first prompt information and the second prompt information include functional description information of the functional components, and the target task processing failure information includes information about processing the target task using the first functional component in the first prompt information but failing to process it.

[0056] The task processing method further includes: in response to a first processing result including information that the target task was processed using a first functional component in a first prompt message but the processing failed, determining a second prompt message based on the functional description information of the first functional component that failed to process. The second prompt message includes functional description information of a second functional component that matches the functional description information of the first functional component that failed to process.

[0057] The functional description information indicates the type of task a functional component is used to process and the functions it can perform. The functional description information of a functional component can be determined based on at least one of the following from the functional component's schema information: tool name, functional component description information, parameter definitions, and special notes.

[0058] The target task processing failure information includes information about using the first functional component in the first prompt information to process the target task but failing to do so. This information indicates that the first functional component in the first prompt information is a functional component used to process the target task, and the functional description information of the first functional component matches the target task. However, the target model failed to process the target task using the first functional component.

[0059] If the functional description information of the first functional component matches the target task, a second prompt message can be generated based on the functional component that matches the functional description information of the first functional component and has a higher resource consumption than the second functional component.

[0060] For example, if the target model fails to execute the target task using the first functional component whose function description information is document conversion in the first prompt information, and the resource consumption of the first functional component is 10 units, then a functional component with a resource consumption greater than 10 units and whose function description information is document conversion can be selected from a number of preset functional components as the second functional component, and a second prompt information can be generated based on the second functional component.

[0061] According to embodiments of this disclosure, for target task processing failure information including a first functional component in the first prompt information that failed to process the target task, a second functional component can be selected based on the functional description information of the first functional component. This second functional component is then used to generate a second prompt information, avoiding the problem of excessive resource consumption caused by including information about resource consumption exceeding that of the first functional component in the second prompt information. Furthermore, selecting a matching second functional component based on the functional description information of the first functional component ensures that the second prompt information, including information about the second functional component, contains a functional component capable of processing the target task, thus improving the success rate of the target model in processing the target task.

[0062] In some embodiments, target task processing failure information may include information that processing failed because no functional component was matched that met the conditions for processing the target task.

[0063] During the processing of the target task, the target model will determine the processing conditions of the target task and determine whether there is a functional component description in the first prompt information that matches the processing conditions of the target task. If there is no functional component description that matches the processing conditions of the target task, the target task processing failure information will be returned, including the failure to find a functional component that meets the processing conditions of the target task.

[0064] According to an embodiment of this disclosure, the task processing method further includes: in response to a first processing result including information that a functional component fails to meet the processing conditions of the target task, determining a second prompt message based on a second functional component that meets the processing conditions.

[0065] The target task processing failure information may also include the processing conditions of the target task as determined by the target model. From a set of preset functional components, a functional component that does not exist in the first prompt information and meets the processing conditions of the target task can be selected as the second functional component.

[0066] For example, if the processing condition of the target task is to convert the document in the target task into an A format document, and the first prompt information only includes functional description information for functional components used for document translation and image processing, then the target model can generate information including the failure to match a functional component that meets the processing conditions of the target task, resulting in processing failure, and the target task processing failure information that requires converting the document into an A format.

[0067] According to embodiments of this disclosure, when the target task processing failure information includes information that no functional component matching the target task processing conditions was found, resulting in processing failure, the target model determines the target task processing requirements when querying the first prompt information based on the target task to see if a functional component matching the target task exists. From a set of preset functional components, a functional component meeting the processing requirements is selected as the second functional component. This allows for flexible loading of the second functional component according to the target task processing requirements, avoiding the inclusion of functional components in the second prompt information that do not match the target task processing requirements, thus preventing resource waste caused by the target model loading and analyzing unmatched functional components.

[0068] In some embodiments, the first prompt word can be improved by reusing the first prompt information to obtain the second prompt word.

[0069] For example, information about the second functional component can be added to the first prompt message to obtain the second prompt message. Alternatively, the information about the functional component in the first prompt message can be replaced with information about the second functional component to obtain the second prompt message.

[0070] According to embodiments of this disclosure, determining the second prompt information includes: replacing the target functional component information in the first prompt information with information from the second functional component. Then, based on the replaced first prompt information, the second prompt information is obtained.

[0071] The target functional component is at least one of the functional components included in the first prompt information. For example, if the target task processing failure information includes information about processing the target task using the first functional component in the first prompt information but failing, then the information of the first functional component that failed in the first prompt information can be replaced with the information of the second functional component to obtain the second prompt information. As another example, if the target task processing failure information includes information about processing failure due to the lack of a matching functional component that meets the conditions for processing the target task, then after determining the second functional component, the information of the second functional component is used to randomly replace the information of multiple first functional components in the first functional component.

[0072] According to embodiments of this disclosure, after determining the second functional component, the second prompt information is obtained based on the first prompt information by reusing the first prompt information. This reduces the computational cost and resource consumption required to generate the second prompt information including the second functional component using the target model. Furthermore, by replacing the target functional component information already stored in the first prompt information with the second prompt information, information about the second functional component used for processing the target task is added to the prompt information of the target model, while information about the first functional component unrelated to the target task is deleted. This avoids the situation where the second functional component includes first and second functional components with matching functional description information, causing interference from information about functional components unrelated to the target task when the target model processes the target task again.

[0073] In some embodiments, a score can be set for the functional components in the first prompt message. The score is used to represent the number of times each functional component in the first prompt message successfully executes a task. If a functional component successfully executes a task once, the score of that functional component is incremented by one. If a functional component fails to execute a task once, the score of that functional component is decremented by one.

[0074] After replacing the information of the first functional component with the information of the second functional component, the functional components that perform poorly in handling tasks or are called infrequently can be further removed.

[0075] According to embodiments of this disclosure, the task processing method further includes: reducing the score of a first functional component included in the first processing result, whereby the score of the first functional component represents the number of times the first functional component successfully executes the target task. Then, if the resource consumption of a second functional component exceeds a first resource consumption threshold, a second prompt message is obtained based on at least one of the information of removing functional components whose scores meet the score conditions and the information of functional components whose call frequencies meet the frequency requirements, and the information of the second functional component.

[0076] The scores of functional components can be saved in a preset score record file. For example, a functional component score table can be generated for each lifecycle of the target model processing the target task. The functional component score table includes the functional components included in the first prompt information, and the initial score of each functional component is a default value. If the target model uses the first functional component among multiple functional components during the lifecycle but fails to process the target task in all cases, the score of the first functional component in the functional component score table corresponding to this lifecycle is reduced by one.

[0077] The calling frequency of a functional component indicates the frequency with which the functional component is called to process the target task during the current lifecycle of the target model or the cumulative frequency of calls to process the target task in the past.

[0078] The frequency requirement can be the lowest frequency function called in the prompt message. Alternatively, it can be a function whose call frequency is below a preset frequency threshold.

[0079] For example, after determining the second functional component, the resource consumption of the information of the second functional component can be detected. If the resource consumption of the information of the second functional component is greater than the preset first resource consumption threshold, the first functional component with the lowest score in the functional component score table can be deleted from the first prompt information, and the functional component with the lowest call frequency can be further deleted to reduce the resource consumption of the second prompt information.

[0080] According to embodiments of this disclosure, by setting scores for functional components in the prompt information used in the lifecycle of the target model processing the target task, the functional components with poor task processing performance in the prompt information can be intuitively reflected. Furthermore, after replacing the information of the first functional component with the information of the second functional component and determining that the resource consumption of the second functional component is greater than the first resource consumption threshold, the resource consumption of the obtained second prompt information can be further reduced for functional components whose scores meet the score conditions or whose call frequencies meet the frequency requirements in the first prompt information, and for functional components with poor task processing performance or low call frequencies in the first prompt information.

[0081] In one embodiment, the first prompt information may be a prompt information generated by using the functional description information determined according to the processing conditions of the target task and the functional component that matches the processing conditions of the target task as the first functional component after receiving the target task.

[0082] In some embodiments, the first functional component may be the functional component with the lowest resource consumption among a plurality of preset functional components. The following describes the process of initially determining the functional component in the first prompt information, taking the determination of functional description information based on functional description text as an example.

[0083] According to embodiments of this disclosure, the functional description information of a functional component is determined based on the functional description text of the functional component. The task processing further includes: in response to the existence of multiple functional components with matching functional description information, determining the functional component whose functional description text satisfies a text quantity condition as a first functional component; and determining a second functional component based on functional components other than those satisfying the text quantity condition.

[0084] The functional description text may include at least one of the following: the functional name of the functional component, a description of the function, parameter mode information, and special instructions.

[0085] The text quantity condition can be to select the functional component with the smallest number of characters or words among multiple functional components, or to select the functional component with a number of characters or words that is less than a preset threshold among multiple functional components.

[0086] In determining the first prompt information, for multiple functional components whose functional description text meets the text quantity condition, the information of the functional component whose functional description text meets the text quantity condition can be selected to generate the first prompt information. This avoids the first prompt information including a large number of functional components whose functional descriptions match, and improves the situation where the first prompt information contains functional components with the same function.

[0087] For example, several preset functional components include Tool 1, Tool 2, and Tool 3. The functional descriptions of Tools 1 and Tool 2 match the processing requirements of the target task. Tool 1 has 10 characters, Tool 2 has 20 characters, and Tool 3 has 30 characters. In response to generating the first prompt, the information of Tool 1 with the lowest character count among the matching functional descriptions is selected to generate the first prompt. Tools 2 and Tool 3 are then used as the second functional components.

[0088] According to embodiments of this disclosure, multiple functional components whose functional descriptions match the text size are divided according to the text size of their functional descriptions. Functional components whose functional descriptions meet the text size requirement are selected as first functional components, and other functional components whose functional descriptions match the first functional component are selected as second functional components. This avoids wasting the target model's processing resources by including multiple functional components with the same function in the first prompt information. Furthermore, by prioritizing the selection of functional components whose functional descriptions meet the text size requirement as the first prompt information, the first prompt information is generated by prioritizing the selection of functional components that match the target task and meet the text size requirement. This reduces the resource consumption of the first prompt information and ensures that the first prompt information includes the first functional component that matches the processing requirements of the target task, thereby improving the success rate of the target model in processing the target task using the first prompt information.

[0089] In some embodiments, the first prompt message may be a pre-defined prompt message including multiple functional components. The pre-defined multiple functional components can be hierarchically classified to obtain a first set and a second set including different functional components, and the first prompt message is generated based on the information of the functional components included in the first set. The first set and the second set can be used to represent different levels.

[0090] According to embodiments of this disclosure, the first functional component is a set of functional components, and the second functional component is a set of functional components. The first and second sets are determined as follows: the first set is determined based on functional components among a plurality of functional components whose resource consumption is less than a second resource consumption threshold; the second set is determined based on functional components among a plurality of functional components whose resource consumption is greater than or equal to the second resource consumption threshold.

[0091] Multiple functional components are pre-configured by the user for the target model.

[0092] For example, if the preset multiple functional components include Tool 1, Tool 2, Tool 3 and Tool 4, Tool 1 has 10 characters, Tool 2 has 20 characters, Tool 3 has 30 characters, Tool 4 has 40 characters, and the second resource consumption threshold is 35, then Tool 1, Tool 2 and Tool 3 with a character count less than 35 can be added to the first set, and Tool 4 can be added to the second set.

[0093] It is understood that the division of multiple functional components into the first set and the second set in this disclosure is only for illustrative purposes. Alternatively, multiple functional components can be divided into two or more sets according to requirements using multiple resource consumption thresholds.

[0094] If there are two or more sets, and the number of functional components with the same functional description information exceeds the number of sets, one functional component with the same functional description information can be assigned to each of the non-highest sets, and the remaining functional components with the same functional description information can be added to the highest set. For example, if there are four functional components with matching functional description information: functional component 1, functional component 2, functional component 3, and functional component 4, and the text size of the functional description text is functional component 1 > functional component 2 > functional component 3 > functional component 4, and there are a first set, a second set, and a third set, then functional component 4 can be added to the first set, functional component 3 can be added to the second set, and functional components 1 and 2 can be added to the third set.

[0095] According to embodiments of this disclosure, by pre-filtering multiple tools according to a second resource consumption level to obtain a first set and a second set, the first prompt information can include information on functional components with various functional descriptions, improving the versatility of the first prompt information. Furthermore, the functional components included in the first set are all functional components with resource consumption less than a second resource consumption threshold, enabling the generation of the first prompt information using information from lightweight functional components. This allows the target model to prioritize the use of lightweight functional components in the first prompt information for processing during the target task.

[0096] According to embodiments of this disclosure, the task processing method further includes: in response to the existence of multiple functional components with the same functional description information in the first set, retaining one functional component among the multiple functional components.

[0097] In some embodiments, for multiple functional components in the first set that have the same functional description information, one functional component may be randomly retained.

[0098] In some embodiments, among multiple functional components with the same functional description information in the first set, functional components whose functional description text volume meets the text volume condition can be selected as the first functional component in the first set.

[0099] For example, if the preset functional components include Tool 1, Tool 2, Tool 3, and Tool 4, with Tool 1 having 10 characters, Tool 2 having 20 characters, Tool 3 having 30 characters, and Tool 4 having 40 characters, and the functional descriptions of Tool 1, Tool 2, and Tool 4 match, and the second resource consumption threshold is 35, then Tool 1, Tool 2, and Tool 3 can be identified as candidate functional components in the first set, and Tool 4 can be identified as a functional component in the second set. Then, among the candidate functional components in the first set, Tool 1 with the smallest character count and Tool 3 whose functional descriptions do not match those of Tool 1 and Tool 2 are selected as functional components in the first set, and Tool 2 is added to the second set.

[0100] According to embodiments of this disclosure, by filtering and retaining one functional component from the functional components whose functional description information matches in the first set, the first set includes functional components with different functional description information, thereby reducing the number of functional description information included in the first set. This reduces the amount of text in the first prompt information generated based on the first set, decreases the resources consumed by the target model in performing the target task using the first prompt information, and avoids the situation where the target model selects the first functional component based on functional components with the same functional description information in the first set.

[0101] After generating the second prompt message using the information from the second functional component and successfully executing the target task, the second functional component can be moved to the first set to prioritize the use of information from functional components with a high success rate in executing tasks to generate the first prompt message.

[0102] According to embodiments of this disclosure, after receiving the second prompt information, the task processing method further includes: in response to the existence of functional components in the first set whose scores meet the score conditions or whose call frequencies meet the frequency requirements, moving the functional components that meet the score conditions or frequency requirements from the first set to the second set, wherein the first set is used to generate the first prompt information and the second set is used to generate the second prompt information. Then, the functional components in the second set used to generate the second prompt information are moved from the second set to the first set.

[0103] After the target model determines the second prompt information, it can process the target task results based on the second prompt information and record the score and call frequency of the second functional component in this life cycle.

[0104] For example, after determining the second prompt message, the second functional component is added to the functional component scoring table, with an initial score of the second functional component as the default value. If the target task is successfully completed using the second prompt message, the score of the second functional component is incremented by one; if the target task fails to be completed using the second prompt message, the score of the second functional component is decremented by one.

[0105] In some embodiments, the scores of functional components corresponding to the lifecycles of multiple processing tasks of the target model can be statistically analyzed, and the scores of each functional component in multiple processing tasks can be combined. The first functional component with the lowest score exceeding a preset threshold number of times is selected and moved from the first set to the second set, and the second functional component with the highest score exceeding a preset threshold number of times is selected and moved from the second set to the first set.

[0106] For example, if in the lifecycle of processing the target task using the target model, the task fails to be processed using tool 1 in the first set but succeeds using tool 2 in the second set, then tool 1 is moved from the first set to the second set, and tool 2 is moved from the second set to the first set.

[0107] According to embodiments of this disclosure, the first functional component with the lowest score is moved from the first set to the second set to downgrade the first functional component with poor task processing performance, and the second functional component with the highest score is moved from the second set to the first set to upgrade the second functional component with good task processing performance. This avoids the existence of functional components in the first prompt message that have low resource consumption but poor task processing performance.

[0108] Figure 3 A schematic diagram illustrating the changes in prompt information according to embodiments of the present disclosure is shown.

[0109] exist Figure 3 In this context, the target model is a large language model, and the target task is the user's question.

[0110] At time 1, in response to the target model receiving the user's instruction to create a dialogue, the user's input is used as user information, and the first prompt information is generated using the preset system prompt words, user information, and information of functional components in the preset first set.

[0111] At time 2, in response to the target model being able to respond to the user's input based on the functional components in the first set, the content of the system prompts and the information of the functional components in the first prompt message remains unchanged, and the context information generated from the dialogue with the user is added to the user information.

[0112] At time 3, if the target model cannot process the user's input based on the first functional component in the first set, then a second functional component is selected from the second set, and the information of the target functional component in the first prompt message is replaced with the information of the second functional component to obtain the second prompt message. The information of the functional component in the second prompt message includes additional information about the second functional component compared to the information of the functional component in the first prompt message.

[0113] Figure 4A schematic block diagram of a task processing apparatus according to an embodiment of the present disclosure is shown.

[0114] like Figure 4 As shown, the apparatus 400 in this embodiment includes a receiving module 410, a first generating module 420, and a second generating module 430.

[0115] The receiving module 410 is used to receive the target task.

[0116] The first generation module 420 is used to process the target task using the target model and the first prompt information to obtain the first processing result of the target task. The first prompt information includes information of the first functional component.

[0117] The second generation module 430 is configured to, in response to the first processing result including target task processing failure information, process the target task using the target model and the second prompt information to obtain a second processing result of the target task, wherein the second prompt information includes information of a second functional component, and the resource consumption of the second functional component is greater than the resource consumption of the first functional component.

[0118] According to embodiments of this disclosure, the first and second prompt messages include functional description information of the functional components, and the target task processing failure information includes information about processing the target task using the first functional component in the first prompt message but failing. The second generation module 430 is further configured to: in response to the first processing result including information about processing the target task using the first functional component in the first prompt message but failing, determine the second prompt message based on the functional description information of the first functional component that failed; wherein the functional description information of the second functional component included in the second prompt message matches the functional description information of the first functional component that failed.

[0119] According to an embodiment of this disclosure, the target task processing failure information includes information that the processing failed because no functional component that meets the conditions for processing the target task was matched; the second generation module 430 is further configured to: in response to the first processing result including information that the processing failed because no functional component that meets the processing conditions for the target task was matched, determine a second prompt information based on a second functional component that meets the processing conditions.

[0120] According to an embodiment of this disclosure, the second generation module 430 determines the second prompt information in the following manner: replacing the target functional component information in the first prompt information with the information of the second functional component, wherein the target functional component is at least one of the functional components included in the first prompt information; and obtaining the second prompt information based on the replaced first prompt information.

[0121] According to an embodiment of this disclosure, the second generation module 430 is further configured to: reduce the score of the first functional component included in the first processing result, wherein the score of the first functional component represents the number of times the first functional component successfully executes the target task; and, if the resource consumption of the second functional component is greater than the first resource consumption threshold, obtain a second prompt message based on at least one of the information of removing functional components whose scores meet the score conditions and the information of functional components whose call frequencies meet the frequency requirements, and the information of the second functional component.

[0122] According to embodiments of this disclosure, the functional description information of a functional component is determined based on the functional description text of the functional component. The second generation module 430 is further configured to: in response to the existence of multiple functional components with matching functional description information, determine the functional component whose functional description text satisfies the text quantity condition as a first functional component; and determine a second functional component based on the functional components other than those satisfying the text quantity condition among the multiple functional components.

[0123] According to embodiments of this disclosure, the first functional component is a set of functional components, and the second functional component is a set of functional components. The first set and the second set are determined as follows: the first set is determined based on functional components whose resource consumption is less than a second resource consumption threshold; the second set is determined based on functional components whose resource consumption is greater than or equal to the second resource consumption threshold.

[0124] According to embodiments of this disclosure, it further includes: in response to the existence of multiple functional components with the same functional description information in the first set, reserving one functional component among the multiple functional components.

[0125] According to an embodiment of this disclosure, after obtaining the second prompt information, the second generation module 430 is further configured to: in response to the existence of a functional component in the first set whose score meets the score condition or whose call frequency meets the frequency requirement, move the functional component that meets the score condition or frequency requirement from the first set to the second set, wherein the first set is used to generate the first prompt information and the second set is used to generate the second prompt information; and move the functional component in the second set used to generate the second prompt information from the second set to the first set.

[0126] This disclosure also discloses an electronic device, comprising: a storage device for storing one or more programs; and a processor for receiving a target task; processing the target task using a target model and first prompt information to obtain a first processing result of the target task, the first prompt information including information of a first functional component; and, in response to the first processing result including target task processing failure information, processing the target task using a target model and second prompt information to obtain a second processing result of the target task, the second prompt information including information of a second functional component, the resource consumption of the second functional component being greater than the resource consumption of the first functional component.

[0127] Figure 5 A schematic block diagram of an electronic device that can be used to implement the task processing method of the embodiments of the present disclosure is shown.

[0128] like Figure 5 As shown, an electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage portion 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0129] RAM 503 stores various programs and data required for the operation of electronic device 500. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 performs various operations of the method flow according to embodiments of this disclosure by executing programs in ROM 502 and / or RAM 503. It should be noted that the programs may also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 may also implement the methods provided in embodiments of this disclosure by executing programs stored in said one or more memories.

[0130] According to embodiments of this disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.

[0131] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0132] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503 described above.

[0133] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this disclosure.

[0134] When the computer program is executed by the processor 501, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0135] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0136] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0137] It should be noted that the collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information in this disclosed technical solution comply with relevant laws and regulations, necessary confidentiality measures have been taken, and it does not violate public order and good morals. In this disclosed technical solution, user authorization or consent has been obtained before acquiring or collecting user personal information.

[0138] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0139] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0140] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0141] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A task processing method, comprising: Receive the target task; The target task is processed using the target model and the first prompt information to obtain a first processing result of the target task, wherein the first prompt information includes information of the first functional component; In response to the first processing result including target task processing failure information, the target task is processed using the target model and the second prompt information to obtain a second processing result of the target task. The second prompt information includes information about a second functional component, and the resource consumption of the second functional component is greater than the resource consumption of the first functional component.

2. The method according to claim 1, wherein the first prompt information and the second prompt information include functional description information of the functional components, and the target task processing failure information includes information about processing the target task using the first functional component in the first prompt information but failing to process it; Also includes: In response to the first processing result including information that the target task was processed using the first functional component in the first prompt information but the processing failed, the second prompt information is determined based on the functional description information of the first functional component that failed to process; The second prompt information includes a functional description of the second functional component that matches the functional description of the first functional component that failed to process.

3. The method according to claim 1, wherein the target task processing failure information includes information that the processing failed because no functional component that meets the conditions for processing the target task was matched; Also includes: In response to the first processing result including information that the processing failed due to the absence of a functional component that meets the processing conditions of the target task, the second prompt information is determined based on a second functional component that meets the processing conditions.

4. The method according to claim 2 or 3, wherein determining the second prompt information includes: The target functional component information in the first prompt information is replaced with the information of the second functional component, wherein the target functional component is at least one of the functional components included in the first prompt information; The second prompt information is obtained based on the replaced first prompt information.

5. The method according to claim 1, further comprising: Reduce the score of the first functional component included in the first processing result, whereby the score of the first functional component represents the number of times the first functional component successfully executes the target task; If the resource consumption of the second functional component is greater than the first resource consumption threshold, the second prompt information is obtained based on at least one of the information of the functional component whose removal score meets the score condition and the information of the functional component whose call frequency meets the frequency requirement, as well as the information of the second functional component.

6. The method according to claim 1, wherein the functional description information of the functional component is determined based on the functional description text of the functional component; further comprising: In response to the existence of multiple functional components with matching functional description information, the functional component whose functional description text satisfies the text quantity condition among the multiple functional components is determined as the first functional component; The second functional component is determined based on the functional components other than the functional components that meet the text volume condition among the plurality of functional components.

7. The method according to claim 1, wherein the first functional component is a functional component included in the first set, and the second functional component is a functional component included in the second set; The first set and the second set are determined in the following manner: The first set is determined based on the functional components whose resource consumption is less than the second resource consumption threshold among multiple functional components; The second set is determined based on the functional components whose resource consumption is greater than or equal to the second resource consumption threshold among the plurality of functional components.

8. The method according to claim 7, further comprising: In response to the existence of multiple functional components with the same functional description information in the first set, one functional component is retained among the multiple functional components.

9. The method according to claim 5, further comprising, after obtaining the second prompt information: In response to the presence of functional components in the first set whose scores meet the score conditions or whose call frequencies meet the frequency requirements, the functional components that meet the score conditions or frequency requirements are moved from the first set to the second set. The first set is used to generate the first prompt information, and the second set is used to generate the second prompt information. The functional component used to generate the second prompt information in the second set is moved from the second set to the first set.

10. An electronic device, comprising: Storage device for storing one or more programs. The processor is used to receive the target task; The target task is processed using the target model and the first prompt information to obtain a first processing result of the target task. The first prompt information includes information about a first functional component. In response to the first processing result including target task processing failure information, the target task is processed using the target model and the second prompt information to obtain a second processing result of the target task. The second prompt information includes information about a second functional component, and the resource consumption of the second functional component is greater than the resource consumption of the first functional component.