Task model switching method and device, electronic equipment and storage medium
By judging the abnormal state of the target task model and determining the reference task model based on similarity configuration information, the problem of low switching accuracy in multi-task model deployment is solved, and efficient switching of task models and continuity of task execution are achieved.
Patent Information
- Application Number
- CN202511683968.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-17
AI Technical Summary
In multi-task model deployments, the accuracy of task model switching is low, which affects the continuity and richness of task execution.
By determining whether the target task model is in a preset abnormal state and determining the reference task model based on the similarity configuration information, which records the similarity between multiple task models, the reference task model is the model whose similarity to the target task model is greater than a preset similarity threshold, thus realizing the switching of task models.
This improved the accuracy of task model switching and ensured the continuity and stability of task execution.
Smart Images

Figure CN121542083A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer technology, and in particular to a task model switching method and device, electronic equipment and storage medium. BACKGROUND
[0002] With the large-scale application of artificial intelligence tasks, multi-task model deployment has become the main way to ensure the continuity and richness of tasks. Multi-task model deployment can switch the current task model to a backup task model when the current task model executing an artificial intelligence task is abnormal. When the task model is switched, the similarity between the task models needs to be relied on. However, when determining the similarity between the task models, the determined similarity between the task models is likely to be high, which reduces the accuracy of switching the task model. SUMMARY
[0003] The present application provides a task model switching method, device, electronic equipment and storage medium to solve the problem of low accuracy of task model switching in multi-task model deployment.
[0004] According to an aspect of the present application, a task model switching method is provided, which comprises:
[0005] determining whether the target task model is in a preset abnormal state when executing a target task, the target task being at least one of a text generation task, an image recognition task and a speech processing task;
[0006] In the case where the target task model is in the preset abnormal state, determining a reference task model based on similarity configuration information; the similarity configuration information records the similarity between each two task models in a plurality of task models, the plurality of task models at least including the target task model, the similarity between the task models being determined based on the similarity between the target information of the task models, the target information including input features, output features and task adaptation degrees, the task adaptation degrees being used to indicate the matching degree of the task model and the target task; the reference task model being a task model in the plurality of task models whose similarity with the target task model is greater than a preset similarity threshold;
[0007] switching the target task model to the reference task model, and continuing to execute the target task using the reference task model.
[0008] According to another aspect of the present application, a task model switching device is provided, which comprises:
[0009] a first determining module for determining whether the target task model is in a preset abnormal state when executing a target task, the target task being at least one of a text generation task, an image recognition task and a speech processing task;
[0010] The first determining module is configured to determine a reference task model based on the similarity configuration information when the target task model is in the preset abnormal state, the similarity configuration information recording similarities between each two task models in a plurality of task models, the plurality of task models at least including the target task model, the similarity between the task models being determined based on similarity degrees between target information of the task models, the target information including input features, output features and task adaptation degrees, the task adaptation degrees being used to indicate matching degrees of the task models and the target task, and the reference task model being a task model in the plurality of task models and having a similarity greater than a preset similarity threshold with the target task model.
[0011] The first switching module is configured to switch the target task model to the reference task model and continue to execute the target task by using the reference task model.
[0012] According to another aspect of the present application, an electronic device is provided, which comprises:
[0013] at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the task model switching method of any of the embodiments of the present application.
[0014] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to implement the task model switching method of any of the embodiments of the present application when executed by the processor.
[0015] The technical scheme of the embodiments of the present application determines whether the target task model is in a preset abnormal state when executing the target task, and determines a reference task model based on the similarity configuration information when the target task model is in the preset abnormal state, the similarity configuration information recording similarities between each two task models in a plurality of task models, the plurality of task models at least including the target task model, the reference task model being a task model in the plurality of task models and having a similarity greater than a preset similarity threshold with the target task model, thereby determining the similarity between the task models based on the input features, the output features and the task adaptation degrees of the task models, effectively avoiding the similarity determined based on a single dimension being too high, and improving the accuracy of determining the similarity; switching the target task model to the reference task model and continuing to execute the target task by using the reference task model, thereby determining the reference task model based on the similarity configuration information and the preset similarity threshold, and switching the target task model to the reference task model, which effectively improves the accuracy of switching the task model and guarantees the continuity of executing the target task.
[0016] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart of a task model switching method provided in an embodiment of the present invention;
[0019] Figure 2 A flowchart of another task model switching method provided in an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of the structure of a task model switching device provided in an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of the structure of an electronic device that implements a task model switching method according to an embodiment of the present invention. Detailed Implementation
[0022] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] Figure 1 This is a flowchart illustrating a task model switching method provided in an embodiment of the present invention. This embodiment is applicable to situations involving task model switching in multi-task model deployments. The method can be executed by a task model switching device, which can be implemented in hardware and / or software and configured in an electronic device implementing the task model switching method. Figure 1 As shown, the task model switching method includes:
[0025] S101. Determine whether the target task model is in a preset abnormal state when performing the target task. The target task is at least one of the following: text generation task, image recognition task, and speech processing task.
[0026] The target task model can be trained based on a deep learning model and the target task. Text generation tasks can be used to instruct the generation of text information that meets the requirements. Image recognition tasks can be used to instruct the conversion of visual information in images into labeled information or structured data. Speech processing tasks can be used to instruct the analysis, conversion, or generation of speech information. A target task model being in a preset abnormal state can mean that the model's output, performance, or dependencies do not meet the corresponding pre-defined range. Specifically, during the execution of the target task, it can be determined in real time whether the target task model is in a preset abnormal state.
[0027] S102. When the target task model is in a preset abnormal state, a reference task model is determined based on the similarity configuration information. The similarity configuration information records the similarity between every two task models in multiple task models. The multiple task models include at least the target task model. The similarity between task models is determined based on the degree of similarity between the target information of the task models. The target information includes input features, output features, and task fit. The task fit is used to indicate the degree of matching between the task model and the target task. The reference task model is the task model among the multiple task models whose similarity to the target task model is greater than a preset similarity threshold.
[0028] The input features of the task model refer to the input data required for the task model to perform calculations and decisions. The input features of the task model may include at least one of the following: input text information, input image information, and input speech information. Input text information may include at least: input text length, domain label, and intent label; input image information may include at least: input image resolution, number of input images, and scene label; input speech information may include at least: input speech duration, input speech noise intensity, and language label.
[0029] The output features of a task model refer to the output results generated by the task model based on the input features. The output features of a task model can include: text generation results, image recognition results, and speech processing results. Text generation results can include at least: the length of the generated text and the keywords in the generated text; image recognition results can include at least: the image recognition category, confidence score, and bounding box coordinates; speech processing results can include at least: speech-to-text accuracy and speech emotion recognition results.
[0030] Specifically, determining the similarity between task models based on their input features, output features, and task fit effectively avoids similarity discrepancies determined by a single dimension, thus improving the accuracy of similarity determination. Furthermore, when a target task model is identified as being in a pre-defined abnormal state during task execution, the similarity recorded in the similarity configuration information associated with the target task model can be used as the target similarity. A reference task model is then determined based on any similarity among the target similarities that exceeds a pre-defined similarity threshold, thereby improving the efficiency of subsequent task model switching.
[0031] S103. Switch the target task model to the reference task model and continue to execute the target task using the reference task model.
[0032] Specifically, the reference task model is determined based on similarity configuration information to facilitate switching the target task model to the reference task model, effectively improving the accuracy of task model switching. Furthermore, continuing to execute the target task using the reference task model effectively ensures the continuity of the target task's execution.
[0033] As an optional implementation of this invention, the task model switching method further includes: if there is no task model among the multiple task models whose similarity to the target task model is greater than a preset similarity threshold, then a candidate task model is determined based on the similarity configuration information, and the target task model is switched to the candidate task model so as to continue to execute the target task using the candidate task model. The candidate task model is the task model with the highest similarity to the target task model among the multiple task models.
[0034] Specifically, if none of the similarities recorded in the similarity configuration information associated with the target task model are greater than a preset similarity threshold, a candidate task model can be determined based on the maximum value among the similarities associated with the target task model. Then, by switching the target task model to the candidate task model, the target task can continue to be executed using the candidate task model, ensuring that the target task can continue to be executed.
[0035] As an optional implementation of this invention, the task model switching method further includes: automatically updating the similarity configuration information when there is a changed task model among multiple task models.
[0036] In this context, a change in the task model can refer to adjustments in the core algorithms, associated configurations, or application parameters upon which the task model relies. For example, a change in the task model could be a version iteration. Specifically, when a changed task model exists among multiple task models, the similarity between the changed task model and other task models is reassessed, and the similarity configuration information is automatically updated to ensure its accuracy.
[0037] The technical solution of this invention determines whether the target task model is in a preset abnormal state when executing the target task. If the target task model is in a preset abnormal state, a reference task model is determined based on similarity configuration information. The similarity configuration information records the similarity between every two task models in a plurality of task models, including at least the target task model. The reference task model is the task model in the plurality of task models whose similarity to the target task model is greater than a preset similarity threshold. This realizes the determination of the similarity between task models based on the input features, output features, and task adaptability of the task models, which can effectively avoid similarity deviations determined based on a single dimension and improve the accuracy of similarity determination. The target task model is then switched to the reference task model, and the target task is continued to be executed using the reference task model. This realizes the determination of the reference task model based on the similarity configuration information and the preset similarity threshold, and the switching of the target task model to the reference task model can effectively improve the accuracy of task model switching and ensure the continuity of target task execution.
[0038] Figure 2 This is a flowchart of another task model switching method provided by an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of determining whether the target task model is in a preset abnormal state when executing the target task, based on the technical solutions of the above embodiments. Solutions not described in detail in this embodiment can be found in the above embodiments. This embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 2 As shown, the task model switching method includes:
[0039] S201. Collect reference information of the target task model. The reference information is used to indicate the non-functional indicators of the target task model when performing the target task.
[0040] The non-functional metrics of the target task model can be used to describe the operational quality of the target task model. Non-functional metrics can include at least one of the following: performance metrics, reliability metrics, and security metrics. Specifically, non-functional metrics of the target task model can be collected from the log information of the target task model during the execution of the target task through a pre-defined application programming interface (API) to obtain reference information about the target task model.
[0041] S202. When the reference information does not meet the preset index threshold, the target task model is determined to be in a preset abnormal state.
[0042] Specifically, the reference information of the target task model is used to determine whether the target task model is in a preset abnormal state, so as to improve the efficiency and accuracy of the judgment of the target task model.
[0043] S203. When the target task model is in a preset abnormal state, a reference task model is determined based on the similarity configuration information. The similarity configuration information records the similarity between every two task models in multiple task models. The multiple task models include at least the target task model. The similarity between task models is determined based on the degree of similarity between the target information of the task models. The target information includes input features, output features, and task fitness. The task fitness is used to indicate the degree of matching between the task model and the target task. The reference task model is the task model among the multiple task models whose similarity to the target task model is greater than a preset similarity threshold.
[0044] As an optional implementation of this invention, the process of determining similarity configuration information includes the following steps A1-A3:
[0045] Step A1: Determine the target information of each task model in the multiple task models.
[0046] Step A2: For every two task models in the multiple task models, determine the similarity between the two task models based on their respective target information.
[0047] Step A3: Generate similarity configuration information based on the similarity between every two task models in multiple task models.
[0048] Specifically, the target information of the task model can be obtained by collecting its input features, output features, and task fit. Then, by iterating through each pair of task models, the similarity between the two task models is determined based on the similarity between their respective target information, thus obtaining the similarity configuration information.
[0049] For example, the output features of multiple task models can be determined based on the same test input data. The test input data can be automatically generated by a pre-defined model or obtained by extracting input requests from the log information of the target task model during the execution of the target task. For instance, in a text generation task, the test input data may include multiple input texts of different lengths automatically generated by a pre-defined model; in an image recognition task, the test input data may include test images generated by calling publicly available scene datasets.
[0050] For example, referring to Table 1, the similarity configuration information can be represented in a table structure. The column and row headers in Table 1 are the identifiers of the task models, and the cells in Table 1 are the similarity values between two task models.
[0051] Table 1 Similarity Configuration Information
[0052]
[0053] As an optional implementation of this invention, determining the similarity between two task models based on their respective target information includes the following steps B1-B2:
[0054] Step B1: Determine the first similarity, second similarity, and third similarity based on the target information of the two task models. The first similarity is the similarity between the input features of the two task models; the second similarity is the similarity between the output features of the two task models; and the third similarity is the similarity between the task fit of the two task models.
[0055] Step B2: Determine the similarity between the two task models based on the first similarity, the second similarity, and the third similarity.
[0056] The similarity between input features can refer to the degree of similarity in the dimension, type, or semantics of the input data. The similarity between output features can refer to the degree of similarity in the format, purpose, or semantic category of the output results. The third similarity can be determined based on the deviation between the task fit of the two task models. The closer the difference in task fit is to 0 or the closer the ratio is to 1, the closer the third similarity is to the preset maximum threshold.
[0057] Specifically, the sum of the first similarity, the second similarity, and the third similarity can be used as the similarity between the two task models; or the similarity between the two task models can be obtained by pre-setting the weights corresponding to the first similarity, the second similarity, and the third similarity, and then summing the first similarity, the second similarity, and the third similarity.
[0058] For example, the similarity between two task models is calculated in the following way. :
[0059] ;
[0060] in, Indicates the first similarity. This represents the weight corresponding to the first similarity. Indicates the second similarity. This represents the weight corresponding to the second similarity. Indicates the third similarity. This represents the weight corresponding to the third similarity.
[0061] For example, the second similarity can be determined based on the sixth and seventh similarities. The sixth similarity can refer to the similarity of the text generation results in the output features of the two task models. The seventh similarity can refer to the similarity of the image recognition results in the output features of the two task models. The similarity of the text generation results can be determined using semantic vector cosine similarity. The similarity of the image recognition results can be determined using the consistency rate of the recognized categories and the deviation of the confidence scores.
[0062] As an optional implementation of this invention, determining the first similarity based on the target information of the two task models includes the following steps C1-C2:
[0063] Step C1: Determine the fourth and fifth similarities based on the input features of the two task models. The fourth similarity is the similarity between the structured features in the input features of the two task models, and the fifth similarity is the similarity between the unstructured labels in the input features of the two task models.
[0064] Step C2: Determine the first similarity based on the fourth and fifth similarities.
[0065] Among these, structured features in the input features can refer to structured data with a fixed format. For example, structured features can be text length, image resolution, or speech duration. The fourth similarity can be calculated using normalized Euclidean distance based on the structured features in the input features of each of the two task models.
[0066] Unstructured labels in the input features refer to labels assigned to unstructured data within the input features. For example, unstructured labels can be domain labels, scene labels, or language labels. The fifth similarity can be calculated using the intersection-union similarity ratio (IUGR) based on the unstructured labels in the input features of each of the two task models.
[0067] Specifically, the sum of the fourth and fifth similarities can be used as the first similarity; or the first similarity can be obtained by pre-setting the weights corresponding to the fourth and fifth similarities and then summing the fourth and fifth similarities by weight.
[0068] S204. Switch the target task model to the reference task model and continue executing the target task using the reference task model.
[0069] The technical solution of this invention collects reference information of the target task model. This reference information indicates non-functional indicators of the target task model when executing the target task. When the reference information does not meet a preset indicator threshold, the target task model is determined to be in a preset abnormal state, effectively improving the efficiency and accuracy of determining whether the target task model is in a preset abnormal state. When the target task model is in a preset abnormal state, a reference task model is determined based on similarity configuration information. This similarity configuration information records the similarity between every two task models in a plurality of task models, including at least the target task model. The reference task model is the task model among the multiple task models whose similarity to the target task model is greater than a preset similarity threshold. This achieves the determination of similarity between task models based on the input features, output features, and task adaptability of the task models, improving the accuracy of similarity determination. Switching the target task model to the reference task model and continuing to execute the target task using the reference task model effectively improves the accuracy of task model switching and ensures the continuity of target task execution.
[0070] Figure 3 This is a schematic diagram of a task model switching device provided in an embodiment of the present invention. The present invention is applicable to situations where task models are switched in a multi-task model deployment, and the device can be implemented in hardware and / or software. Figure 3 As shown, the task model switching device includes:
[0071] The first judgment module 301 is used to judge whether the target task model is in a preset abnormal state when performing the target task. The target task is at least one of text generation task, image recognition task and speech processing task.
[0072] The first determining module 302 is used to determine a reference task model based on similarity configuration information when the target task model is in a preset abnormal state. The similarity configuration information records the similarity between every two task models in a plurality of task models, and the plurality of task models includes at least the target task model. The similarity between task models is determined based on the degree of similarity between the target information of the task models. The target information includes input features, output features, and task fit. The task fit is used to indicate the degree of matching between the task model and the target task. The reference task model is the task model in the plurality of task models whose similarity with the target task model is greater than a preset similarity threshold.
[0073] The first switching module 303 is used to switch the target task model to the reference task model and continue to execute the target task using the reference task model.
[0074] Based on any of the above optional technical solutions, the process of determining similarity configuration information may include: determining the target information of each task model in the multiple task models; for every two task models in the multiple task models, determining the similarity between the two task models based on their respective target information; and generating similarity configuration information based on the similarity between every two task models in the multiple task models.
[0075] Based on any of the above optional technical solutions, optionally, the similarity between the two task models is determined based on their respective target information, including: determining a first similarity, a second similarity, and a third similarity based on the target information of the two task models, wherein the first similarity is the similarity between the input features of the two task models; the second similarity is the similarity between the output features of the two task models; and the third similarity is the similarity between the task fit of the two task models; and the similarity between the two task models is determined based on the first similarity, the second similarity, and the third similarity.
[0076] Based on any of the above optional technical solutions, optionally, the first similarity is determined based on the target information of the two task models, including: determining the fourth similarity and the fifth similarity based on the input features of the two task models, wherein the fourth similarity is the similarity between structured features in the input features of the two task models, and the fifth similarity is the similarity between unstructured labels in the input features of the two task models; and determining the first similarity based on the fourth similarity and the fifth similarity.
[0077] Based on any of the above optional technical solutions, optionally, the first judgment module 301 includes: a first acquisition unit and a second determination unit. The first acquisition unit is used to acquire reference information of the target task model, which indicates non-functional indicators of the target task model when performing the target task; the second determination unit is used to determine that the target task model is in a preset abnormal state when the reference information does not meet a preset indicator threshold.
[0078] Optionally, based on any of the above-mentioned optional technical solutions, the task model switching device further includes a second switching module. The second switching module is configured to, if none of the multiple task models has a similarity greater than a preset similarity threshold with the target task model, determine a candidate task model based on similarity configuration information and switch the target task model to the candidate task model so that the target task can continue to be executed using the candidate task model. The candidate task model is the task model with the highest similarity to the target task model among the multiple task models.
[0079] Optionally, based on any of the above-mentioned optional technical solutions, the task model switching device may further include: a first update module. The first update module is used to automatically update the similarity configuration information when a changed task model exists among multiple task models.
[0080] The technical solution of this invention involves a first judgment module 301 determining whether the target task model is in a preset abnormal state when executing the target task; and a first determination module 302 determining a reference task model based on similarity configuration information when the target task model is in a preset abnormal state. The similarity configuration information records the similarity between every two task models in a plurality of task models, including at least the target task model. The reference task model is the task model among the multiple task models whose similarity to the target task model is greater than a preset similarity threshold. This achieves the determination of the similarity between task models based on the input features, output features, and task adaptability of the task models, effectively avoiding similarity errors determined based on a single dimension and improving the accuracy of similarity determination. Finally, a first switching module 303 switches the target task model to the reference task model, and the target task continues to be executed using the reference task model. This achieves the determination of the reference task model based on the similarity configuration information and the preset similarity threshold, and the switching of the target task model to the reference task model, effectively improving the accuracy of task model switching and ensuring the continuity of target task execution.
[0081] The task model switching device provided in this embodiment of the invention can execute the task model switching method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0082] Figure 4 This is a schematic diagram of an electronic device implementing a task model switching method according to an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0083] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0084] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0085] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as task model switching methods.
[0086] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication unit 19, or installed from storage unit 18, or installed from ROM 12. When the computer program is executed by processor 11, it performs the functions defined in the methods of the embodiments of the present invention.
[0087] In some embodiments, the task model switching method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the task model switching method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the task model switching method by any other suitable means (e.g., by means of firmware).
[0088] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0089] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0090] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0091] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0092] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0093] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0094] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0095] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A task model switching method, characterized in that, The method includes: Determine whether the target task model is in a preset abnormal state when performing the target task, wherein the target task is at least one of text generation task, image recognition task, and speech processing task; When the target task model is in a preset abnormal state, a reference task model is determined based on similarity configuration information. This similarity configuration information records the similarity between every two task models from a plurality of task models, including at least the target task model. The similarity between the task models is determined based on the degree of similarity between their target information, which includes input features, output features, and task fit. The task fit indicates the degree of matching between the task model and the target task. The reference task model is the task model from the plurality of task models whose similarity to the target task model is greater than a preset similarity threshold. The target task model is switched to the reference task model, and the target task is continued to be executed using the reference task model.
2. The method according to claim 1, characterized in that, The process of determining the similarity configuration information includes: Determine the target information of each task model among the multiple task models; For every two task models among the plurality of task models, the similarity between the two task models is determined based on the target information of each of the two task models. The similarity configuration information is generated based on the similarity between every two task models in the plurality of task models.
3. The method according to claim 2, characterized in that, The similarity between the two task models is determined based on their respective target information, including: Based on the target information of each of the two task models, a first similarity, a second similarity, and a third similarity are determined. The first similarity is the similarity between the input features of the two task models; the second similarity is the similarity between the output features of the two task models; and the third similarity is the similarity between the task fit of the two task models. The similarity between the two task models is determined based on the first similarity, the second similarity, and the third similarity.
4. The method according to claim 3, characterized in that, The first similarity is determined based on the target information of each of the two task models, including: The fourth and fifth similarities are determined based on the input features of the two task models. The fourth similarity is the similarity between the structured features in the input features of the two task models, and the fifth similarity is the similarity between the unstructured labels in the input features of the two task models. The first similarity is determined based on the fourth similarity and the fifth similarity.
5. The method according to claim 1, characterized in that, Determine whether the target task model is in a preset abnormal state when executing the target task, including: Collect reference information of the target task model, the reference information being used to indicate the non-functional indicators of the target task model when performing the target task; When the reference information does not meet the preset indicator threshold, the target task model is determined to be in a preset abnormal state.
6. The method according to claim 1, characterized in that, The method further includes: If none of the multiple task models has a similarity greater than a preset similarity threshold with the target task model, then a candidate task model is determined based on the similarity configuration information, and the target task model is switched to the candidate task model so that the target task can continue to be executed using the candidate task model. The candidate task model is the task model with the highest similarity to the target task model among the multiple task models.
7. The method according to claim 1, characterized in that, The method further includes: When a task model changes among the multiple task models, the similarity configuration information is automatically updated.
8. A task model switching device, characterized in that, The device includes: The first judgment module is used to determine whether the target task model is in a preset abnormal state when executing the target task, wherein the target task is at least one of text generation task, image recognition task and speech processing task. The first determining module is used to determine a reference task model based on similarity configuration information when the target task model is in a preset abnormal state. The similarity configuration information records the similarity between every two task models in a plurality of task models, wherein the plurality of task models includes at least the target task model. The similarity between the task models is determined based on the degree of similarity between the target information of the task models. The target information includes input features, output features, and task fit, wherein the task fit is used to indicate the degree of matching between the task model and the target task. The reference task model is the task model among the plurality of task models whose similarity to the target task model is greater than a preset similarity threshold. The first switching module is used to switch the target task model to the reference task model, and continue to execute the target task using the reference task model.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the task model switching method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the task model switching method of any one of claims 1-7.