Task processing method and device

By selecting the appropriate target output module and dimensions, the processing process of the deep learning model is optimized, and the contradiction between resource and accuracy of the model in different tasks is solved, and efficient task processing is achieved.

CN120407118APending Publication Date: 2025-08-01LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510550504.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing processing models based on deep learning technology are difficult to meet the requirements of high accuracy and resource efficiency at the same time when processing different tasks, resulting in the results not meeting the requirements in tasks with high accuracy requirements or the resources are wasted in tasks with low accuracy requirements.

Method used

By selecting appropriate target output modules and dimensions based on the attribute information of the task to be processed and the conditions of the processing model, the processing process is optimized to meet different task requirements, including methods for determining target output modules such as performance indicator matching, resource matching and training sample data matching.

Benefits of technology

It achieves more accurate results in high-accuracy tasks, while reducing resource overhead in low-accuracy tasks, improving resource utilization efficiency of processing models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407118A_ABST
    Figure CN120407118A_ABST
Patent Text Reader

Abstract

The invention discloses a task processing method and device, and the method comprises the steps: obtaining a to-be-processed task; a target output module of a target processing model is determined according to the attribute information of the to-be-processed task and the current processing condition of the target processing model, the target processing model comprises multiple processing modules connected in series, and the target output module is at least one of the multiple processing modules; and processing the to-be-processed task by using the target processing model, and outputting a target processing result at a target output module of the target processing model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of task processing technology, and in particular to a task processing method and device. Background Art

[0002] At present, various processing models based on deep learning technology have been widely used to process various tasks.

[0003] Different tasks have different processing requirements. For example, some tasks require higher accuracy, while some tasks do not. When using a processing model to process tasks with higher accuracy requirements, it may be difficult to obtain results that meet the accuracy requirements. When using a processing model to process tasks with lower accuracy requirements, unnecessary resource overhead will be generated due to the large number of model parameters contained in the model. Summary of the Invention

[0004] To this end, this application discloses the following technical solutions:

[0005] A first aspect of the present application provides a task processing method, comprising:

[0006] Get pending tasks;

[0007] determining a target output module of the target processing model according to the attribute information of the task to be processed and the current processing condition of the target processing model, wherein the target processing model includes a plurality of processing modules connected in series, and the target output module is at least one of the plurality of processing modules;

[0008] The target processing model is used to process the task to be processed, and the target output module of the target processing model outputs the target processing result.

[0009] Optionally, also include:

[0010] Determining a target dimension of the target processing model according to the attribute information of the task to be processed and the current processing condition of the target processing model, wherein the target dimension is at least one of the multiple processing dimensions of the target processing model;

[0011] The step of processing the to-be-processed task using the target processing model and outputting the target processing result in the target output module of the target processing model includes:

[0012] The target dimension of the target processing model is used to process the task to be processed, and the target processing result is output in the target output module of the target processing model.

[0013] Optionally, determining the target output module of the target processing model according to the attribute information of the task to be processed and the current processing condition of the target processing model includes:

[0014] Determine the target output module of the target processing model according to the performance indicators of the target processing model when processing tasks with the same attribute information under the current processing conditions.

[0015] The performance indicators include the accuracy of the processing results output by multiple processing modules and / or the processing duration used by multiple processing modules to output the processing results.

[0016] Optionally, the determining the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model includes:

[0017] Determine the processing module whose matching degree between the corresponding processing label and the attribute information of the task to be processed in the target processing model meets the target condition as the target output module;

[0018] Wherein, the processing label corresponding to the processing module is related to the attribute information of the sample data used to train the processing module.

[0019] Optionally, it further includes:

[0020] In the case where the matching degree corresponding to each processing module does not meet the target condition, obtain target sample data having the same attribute information as the task to be processed;

[0021] Train the processing module with the highest matching degree corresponding to the target sample data to obtain a processing module whose matching degree meets the target condition.

[0022] Optionally, the determining the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model includes:

[0023] Determine the required resource amount for processing the task to be processed according to the task type of the task to be processed;

[0024] Determine the target output module of the target processing model according to the required resource amount and the current available resource amount of the target processing model.

[0025] Optionally, the model loss of the target processing model is obtained by fusing the module losses of multiple processing modules and the dimension losses of multiple processing dimensions;

[0026] The module loss of the processing module is determined according to the dispersion degree of the output of the processing module relative to the output of the last processing module;

[0027] The dimension loss is determined according to the difference between the processing result obtained by processing the sample using the corresponding processing dimension and the sample label.

[0028] Optionally, it further includes:

[0029] Process a variety of sample data with different attribute information according to the target processing model, and obtain the processing results of each sample data. The processing result corresponding to each sample data is output by a corresponding processing module in the target processing model;

[0030] Train the corresponding processing module in the target processing model according to the processing results of each sample data;

[0031] Configure a processing label for the corresponding processing module according to the attribute information of each sample data.

[0032] Optionally, the task to be processed includes a text generation task, and the target processing result includes a response text generated based on the task text included in the text generation task;

[0033] Or, the task to be processed includes an image generation task, and the target processing result includes a task image generated based on the image information included in the image generation task;

[0034] Or, the task to be processed includes a text matching task, and the target processing result includes the relative relevance between the text to be matched included in the text matching task and the target text.

[0035] The second aspect of this application provides a task processing device, including:

[0036] An obtaining unit, configured to obtain a task to be processed;

[0037] A determining unit, configured to determine the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model. The target processing model includes a plurality of serially connected processing modules, and the target output module is at least one of the plurality of processing modules;

[0038] A processing unit, configured to process the task to be processed using the target processing model, and output a target processing result at the target output module of the target processing model. Description of the Drawings

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0040] Figure 1 It is a flowchart of a task processing method provided by an embodiment of the present application;

[0041] Figure 2 It is a schematic structural diagram of a target processing model provided by an embodiment of the present application;

[0042] Figure 3 It is a schematic structural diagram of another target processing model provided by an embodiment of the present application;

[0043] Figure 4 It is a schematic structural diagram of a task processing device provided by an embodiment of the present application;

[0044] Figure 5 It is a schematic structural diagram of another task processing device provided by an embodiment of the present application. Detailed implementation manners

[0045] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0046] This embodiment provides a task processing method. Please refer to Figure 1 and the method may include the following steps.

[0047] S101, obtain the task to be processed.

[0048] The task processing method of this embodiment can be executed by an electronic device configured with a target processing model. The target processing model can be any task processing model implemented based on deep learning technology. For example, it can be a large language model (LLM) or other deep learning models, without limitation.

[0049] The type of the task to be processed is not limited. For example, the task to be processed may include a text generation task. In this case, the task to be processed may include task text, which can be input by the user or read by the electronic device from sources such as documents and web pages based on the user's operation instructions.

[0050] The task to be processed may include an image generation task. In this case, the task to be processed may include image information related to the image to be generated, and the image information can be image information in text form, audio form, or image form.

[0051] The task to be processed may include a text matching task. In this case, the task to be processed may contain the text to be matched and the target text that need to be matched. The target text may be the text input by the user, and the text to be matched may be the text searched or generated according to the target text.

[0052] S102. Determine the target output module of the target processing model according to the attribute information of the task to be processed and the processing conditions in which the target processing model is currently located. The target processing model includes a plurality of processing modules connected in series, and the target output module is at least one of the plurality of processing modules.

[0053] The target processing model includes a plurality of processing modules connected in series. The total number of processing modules is not limited. For example, the target processing model may include 10 processing modules, 20 processing modules, or 30 processing modules.

[0054] Each processing module includes a number of weight parameters. The values of these weight parameters can be determined when training the target processing model. The number of weight parameters contained in different processing modules can be different, and the values of the weight parameters contained can be different.

[0055] As an example, please refer to Figure 2 , which is a schematic structural diagram of a target processing model. The target processing model includes 33 processing modules, which are sequentially denoted as processing module 0, processing module 1, processing module 2, processing module 3... processing module 31, processing module 32.

[0056] The attribute information of the task to be processed may include the task type of the task to be processed, may include the data volume of the task to be processed, may include the field to which the task to be processed belongs, or may include other information related to the task to be processed, without limitation.

[0057] The data volume of the task to be processed refers to the data volume of the data contained in the task to be processed. For example, if the task to be processed is a text generation task, the data volume of the task to be processed may be the data volume of the task text contained in the task to be processed; if the task to be processed is an image generation task, the data volume of the task to be processed may be the data volume of the image information contained in the task to be processed; if the task to be processed is a text matching task, the data volume of the task to be processed may be the data volume of the text to be matched and the target text contained in the task to be processed.

[0058] The field to which the task to be processed belongs is related to the content of the data contained in the task to be processed. For example, when the task to be processed contains text and these texts are related to medicine, the field to which it belongs is the medical field; if these texts are related to drone technology, the field to which it belongs is the drone field.

[0059] The processing conditions in which the target processing model is currently located can characterize the amount of computing resources that the target processing model can use. For example, the processing conditions can include the size of the memory space that the target processing model can use, the number and frequency of the cores of the processors that can be used, etc. Among them, the processors include but are not limited to the central processing unit CPU, the graphics processing unit GPU, and the neural network processing unit NPU.

[0060] In step S102, the target output module can be determined according to the attribute information and the current processing conditions, or the target output module can be determined only according to the attribute information, or the target output module can be determined only according to the current processing conditions.

[0061] The target output module can be any processing module in the target processing model. Figure 2 For example, the target output module can be processing module 31.

[0062] S103, use the target processing model to process the task to be processed, and output the target processing result at the target output module of the target processing model.

[0063] In step S103, the data contained in the task to be processed (such as the aforementioned task text, image information) can be first input into the first processing module of the target processing model. The first processing module processes the input based on the weight parameters contained therein and then outputs feature data with a certain dimension (such as feature data of 512 dimensions) to the second processing module. The second processing module processes the input feature data based on the contained weight parameters and then outputs feature data with a certain dimension to the third processing module, and so on, until the target output module outputs the target processing result.

[0064] That is to say, the input of the first processing module is the data contained in the task to be processed. After that, the input of all processing modules up to the target output module is the output of the previous processing module, and the output of the target output module is the target processing result. Among them, since the numerical values of the weight parameters contained in each processing module are different and the input of each processing module is different, the output of each processing module can be different.

[0065] Through a series of multiple processing modules, when the target processing model processes the task to be processed, it can extract different levels of features of the data contained in the task to be processed, and then output the target processing result from the target output module based on the extracted features.

[0066] For example, when the data contained in the task to be processed is text, the processing module that is positioned earlier in the target processing model, that is, farther away from the target output module, can output feature data representing the semantics of the characters, words or local fragments of the text, and the processing module that is positioned later, that is, closer to the target output module, can output feature data representing the overall semantics of the text. Finally, the target output module generates the target processing result based on the input feature data.

[0067] Combine Figure 2 For example, when the target processing model is applied to process the task to be processed, the data contained in the task to be processed can be first input into processing module 0, and processing module 0 outputs feature data with a certain dimension after processing based on the weight parameters contained therein, and these feature data are input into processing module 1; processing module 1 also outputs feature data with a certain dimension after processing based on the weight parameters contained therein, and gives it to processing module 2, and so on, until processing module 31 outputs the target processing result.

[0068] In order to enable each processing module in the target processing model to output the target processing result, an output layer can be configured for multiple processing modules in the target processing model. Correspondingly, the target output module can be any processing module among the multiple processing modules configured with an output layer.

[0069] Each output layer may include several weight parameters. The values of the weight parameters contained in the output layers of different processing modules may be different. The values of these weight parameters may be determined when training the target processing model.

[0070] by Figure 2 For example, in the target processing model, processing modules 2 to 32 are all configured with corresponding output layers.

[0071] For any processing module, the output layer of the processing module is used to convert the output of the processing module into the target processing result corresponding to the task to be processed.

[0072] When a processing module is not determined as a target output module, the output layer of the processing module may be in a disabled state. At this time, after the processing module obtains the input, it processes the input based on the weight parameters contained in itself except the output layer, obtains feature data of a certain dimension and outputs it to the next processing module; when a processing module is determined as a target output module, the output layer of the target output module may be in an enabled state. At this time, after the target output module obtains the input, it processes the input based on the weight parameters contained in itself except the output layer, obtains feature data of a certain dimension, and then sends the obtained feature data to the output layer of the target output module. The output layer of the target output module processes the input feature data based on its own weight parameters to obtain the target processing result, and then outputs the target processing result.

[0073] The form of the target processing result is not limited and can be text, image, or data corresponding to the task to be processed.

[0074] For example, if the task to be processed is a text generation task, the target processing result may include a response text generated based on the task text included in the text generation task;

[0075] If the task to be processed is an image generation task, the target processing result may include a task image generated based on the image information included in the image generation task;

[0076] If the task to be processed is a text matching task, the target processing result may include the relative relevance data of the text to be matched and the target text included in the text matching task.

[0077] As an example, when the task to be processed is a text matching task, the target text may be "What is a panda?", and the text to be matched may include Text 1 "A cat", Text 2 "It is a rare mammal living in the mountainous areas of southwestern China, belonging to the bear family Ailuropodinae of the order Carnivora. With big 'black eye circles'", and Text 3 "A bear with black and white colors".

[0078] The output target processing results may be: 0.71, 0.92, 0.88. Among them, 0.71 is the relative relevance between Text 1 and the target text, 0.92 is the relative relevance between Text 2 and the target text, and 0.88 is the relative relevance between Text 3 and the target text.

[0079] The beneficial effect of this embodiment lies in:

[0080] This solution can select an appropriate target output module according to the attribute information of the task to be processed and the processing conditions of the target processing model, so as to meet the requirements of different tasks to be processed. It can not only obtain more accurate processing results when dealing with tasks with higher accuracy requirements for processing needs, but also reduce the number of model parameters and resource overhead when dealing with tasks with lower accuracy requirements for processing needs.

[0081] In an optional embodiment, the target processing model may also have multiple processing dimensions, each processing dimension corresponding to a dimension of feature data, and the numerical values of the dimensions corresponding to different processing dimensions are different.

[0082] As an example, please refer to Figure 3 , the target processing model may have 4 processing dimensions, namely the first processing dimension, the second processing dimension, the third processing dimension, and the fourth processing dimension. Among them, the first processing dimension corresponds to a dimension of 512, the second processing dimension corresponds to a dimension of 1024, the third processing dimension corresponds to a dimension of 2048, and the fourth processing dimension corresponds to a dimension of 4096.

[0083] On the premise of having multiple processing dimensions, before using the target processing model to process the task to be processed, the following steps can also be executed:

[0084] Determine the target dimension of the target processing model according to the attribute information of the task to be processed and the processing conditions where the target processing model is currently located. The target dimension is at least one of the multiple processing dimensions of the target processing model;

[0085] Correspondingly, using the target processing model to process the task to be processed in step S103 is equivalent to:

[0086] Using the target dimension of the target processing model to process the task to be processed, and outputting the target processing result at the target output module of the target processing model.

[0087] The target dimension can be any one of the multiple processing dimensions. As an example, in the Figure 3 shown target processing model, the second processing dimension can be selected as the target dimension.

[0088] When using the target dimension of the target processing model to process the task to be processed, the dimensionality of the feature data output by each processing module between the target output modules can match the selected target dimension, that is, the dimensionality of the feature data output by the processing module can be equal to the dimensionality corresponding to the target dimension.

[0089] Combined with the foregoing example, if the second processing dimension in Figure 3 is selected as the target dimension, since the second processing dimension corresponds to a dimensionality of 1024, when using the target processing model to process the task to be processed, each processing module before the target output module outputs 1024-dimensional feature data to the next processing module after processing the input data based on its own weight parameters.

[0090] As another example, if the fourth processing dimension in Figure 3 is selected as the target dimension, and the fourth processing dimension corresponds to a dimensionality of 4096, each processing module before the target output module outputs 4096-dimensional feature data to the next processing module.

[0091] That is to say, different processing dimensions of the target processing model correspond to different dimensionalities. During the process of using the target dimension of the target processing model to process the task to be processed, each processing module before the target output module outputs feature data with the dimensionality corresponding to the target dimension to the next processing module.

[0092] When the dimensionality of the feature data output by the processing module is large, more abundant information can be carried in this feature data. Therefore, selecting the corresponding processing dimension with a larger dimensionality can enable the processing module located later in the target processing model to obtain more information about the task to be processed, which is conducive to improving the accuracy of the finally obtained target processing result.

[0093] When the dimension of the feature data output by the processing module is small, the amount of data of the feature data is small, and the amount of data to be processed by the subsequent processing module that obtains the feature data is also small. Therefore, selecting a corresponding processing dimension with a larger dimension can reduce the amount of data to be processed by each processing module in the target processing model, reduce the resource overhead of the target processing model, and is beneficial to shortening the processing time of the task to be processed.

[0094] It can be seen that this embodiment can select a suitable target dimension according to the attribute information of the task to be processed and the current processing conditions, so as to use a single target processing model to balance the need to obtain accurate target processing results in some scenarios and the need to process the task to be processed with less resource overhead and shorter duration in other scenarios.

[0095] In some alternative embodiments, the manner of determining the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model may be:

[0096] Determine the target output module of the target processing model according to the performance metrics of the target processing model when processing tasks with the same attribute information under the current processing conditions;

[0097] The performance metrics include the accuracy of the processing results output by multiple processing modules and / or the processing duration used for the processing results output by multiple processing modules.

[0098] Tasks with the same attribute information, which can also be referred to as sample tasks, can be understood as tasks belonging to the same type as the task to be processed. For example, both the task to be processed and the sample task belong to the text generation task, or both belong to the image generation task, or both belong to the text matching task, etc.

[0099] When the number of tasks to be processed is multiple, one of the multiple tasks to be processed can be selected as the sample task.

[0100] When the number of tasks to be processed is one, a sample task of the same type can be selected from multiple preset sample tasks according to the task type of the task to be processed.

[0101] The sample tasks can be pre-configured by relevant manufacturers when the electronic device leaves the factory, or during the user's use of the electronic device, the target processing model can select the processed historical tasks and save them as sample tasks. Each sample task can correspond to a sample processing result as a standard. In the former case, the sample processing result can be pre-configured by relevant manufacturers. In the latter case, the target processing model can save the processed and user-confirmed processing result as the sample processing result.

[0102] After obtaining a sample task, under the current processing conditions, the target processing model can be called to process the sample task, and the processing results of multiple processing modules during the processing can be obtained. Here, the multiple processing modules can include each processing module in the target processing model that can output processing results. Taking Figure 2 as an example, it can include processing modules 2 to 32 in the target processing model.

[0103] In the above processing process, the output layer corresponding to each processing module can be set to the startup state, so that each processing module can output the corresponding processing result. At the same time, the feature data processed by each processing module based on the weight parameters other than the output layer is intercepted and transmitted to the next processing module, so that the next processing module can also participate in processing the task to be processed to obtain the corresponding processing result.

[0104] Combined with Figure 2 the example, after processing module 2 processes the feature data based on the weight parameters other than the output layer, on the one hand, it is provided to the output layer of processing module 2, and the processing result of processing module 2 is obtained by the output layer of processing module 2. On the other hand, it is provided to processing module 3, and the processing result of processing module 3 is obtained after being processed by processing module 3 and its output layer, and so on, to obtain the intercepted and transmitted to the next processing module, so that the next processing module can also participate in processing the task to be processed to obtain 31 processing results corresponding to 31 processing modules from processing module 2 to processing module 32.

[0105] After obtaining multiple processing results, the accuracy of each processing result can be evaluated. For the case of a preset sample task, the processing results output by each processing module can be compared with the sample processing result corresponding to the sample task, and the similarity between the two is used as the accuracy of the processing result. The higher the similarity, the higher the accuracy.

[0106] For the case where the sample task is one selected from multiple tasks to be processed, the multiple processing results can be output to the user respectively, prompting the user to evaluate the accuracy of these processing results, and the accuracy corresponding to the processing result is obtained based on the evaluation result input by the user. For example, the user is prompted to input a score for the processing result (between 0 and 100), and then the ratio obtained by dividing the score corresponding to the processing result by 100 is used as the accuracy of the processing result.

[0107] After obtaining the accuracy corresponding to multiple processing results, the processing result with the highest accuracy can be directly found among them, and then the processing module that outputs this processing result can be determined as the target output module.

[0108] Or, after obtaining the accuracy corresponding to multiple processing results, the time taken to obtain each processing result can be further determined. Taking Figure 2For example, assume that the data contained in the task to be processed is input into processing module 0 at time T0, and processing module 2 outputs a processing result at time T2. Then, the time taken for processing module 2 to output the processing result is T2 - T0. Similarly, if processing module 3 outputs a processing result at time T3, the time taken for processing module 3 to output the processing result is T3 - T0.

[0109] Then, the accuracy of the processing result corresponding to the processing module can be combined with the time taken for the processing module to obtain the processing result, to obtain a fusion performance metric that is related to both accuracy and time. The value of this fusion performance metric can be positively correlated with accuracy and negatively correlated with time. Finally, among multiple processing modules, select the processing module corresponding to the largest value of the fusion performance metric as the target output module.

[0110] The method of combining accuracy and time to obtain the fusion performance metric can be to obtain the maximum value among the times taken by multiple processing modules. For example Figure 2 the time taken by processing module 32 in

[0111] That is, T32 - T0, where T32 represents the time when processing module 32 outputs the processing result;

[0112] Finally, the accuracy corresponding to the processing module can be subtracted by the corresponding normalized time to obtain the fusion performance metric, or the accuracy corresponding to the processing module can be divided by the corresponding normalized time to obtain the fusion performance metric, or the accuracy corresponding to the processing module can be divided by the corresponding normalized time through other means to obtain the fusion performance metric.

[0113] Optionally, the method of selecting the target dimension can refer to the method of selecting the target output module described above. That is, under the current processing conditions, sample tasks with the same attribute information are processed respectively based on each processing dimension of the target processing model, and the performance metric corresponding to each dimension is determined according to the processing result corresponding to each dimension. Then, the target dimension is selected according to the performance metric.

[0114] The advantage of selecting the target output module and the target dimension according to the above method is that, under the current processing conditions, the processing module with the optimal performance among multiple processing modules can be selected as the target output module, and the processing dimension with the optimal performance among multiple processing dimensions can be selected as the target dimension, so as to obtain a more accurate processing result in the shortest possible time.

[0115] Optionally, when training the target processing model, various sample data with different attribute information can be obtained, different processing modules are trained respectively using different sample data, and corresponding processing labels are configured for each processing module after training. The related training process is as follows:

[0116] Process a variety of sample data with different attribute information according to the target processing model, and obtain the processing results of each sample data. The processing results corresponding to each sample data are output by a corresponding processing module in the target processing model.

[0117] Train the corresponding processing module in the target processing model according to the processing results of each sample data.

[0118] Configure a processing label for the corresponding processing module according to the attribute information of each sample data.

[0119] During the above training process, the corresponding relationship between the attribute information and the processing module can be preset. For example, it is set that the text generation task in the astronomy field corresponds to processing module 4, and the text generation task in the medical field corresponds to processing module 8.

[0120] Taking processing module 4 as an example, during training, sample data in the astronomy field can be input into the target processing model to obtain the processing results output by the corresponding processing module 4. According to the difference between the processing results output by processing module 4 and the standard results corresponding to the sample data, determine the loss of processing module 4, and then update the weight parameters contained in processing module 4 according to the loss. Repeat this process until the loss of processing module 4 meets the preset convergence condition. Thus, the training process of processing module 4 ends. After that, the processing label of processing module 4 can be configured according to the sample data used to train processing module 4, for example, configured as "astronomy field, text generation task".

[0121] Among them, when training any specific processing module of the target processing model, the weight parameters contained in other processing modules remain unchanged, and only the numerical values of the weight parameters contained in the trained processing module are updated according to the loss.

[0122] Optionally, based on the above training method, the way to determine the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model can also be:

[0123] Determine the processing module whose matching degree between the corresponding processing label and the attribute information of the task to be processed in the target processing model meets the target condition as the target output module;

[0124] Among them, the processing label corresponding to the processing module is related to the attribute information of the sample data used to train the processing module.

[0125] Optionally, the processing label corresponding to the processing module can be a set of the attribute information of the sample data used to train the processing module.

[0126] For example, the sample data of processing module 3 for training the target processing module includes problem texts in the medical field and problem texts in the consumer electronics field. Then, the processing labels of processing module 2 can include: text generation tasks, the medical field, and the consumer electronics field; the sample data of processing module 5 for training the target processing model includes problem texts related to computer programming languages and problem texts related to computer hardware architectures. Then, the processing labels of processing module 5 can include: text generation tasks, the programming field, and the computer hardware architecture field.

[0127] In the above embodiments, the processing labels and the attribute information of the task to be processed can both be input into a matching model with text matching capabilities in text form, and the matching model is used to determine the matching degree between the processing labels and the attribute information. The higher the matching degree between the processing labels of the processing module and the attribute information, the more similar the task to be processed is to the sample data used to train the processing module.

[0128] The processing module that meets the target conditions can be the processing module with the highest matching degree among multiple processing modules; it can also be the processing module with the highest matching degree among multiple processing modules and with a matching degree greater than a preset matching degree threshold; it can also be any processing module with a matching degree greater than the preset matching degree threshold.

[0129] Optionally, if there are multiple processing modules that meet the target conditions, the processing module that is the earliest in position among them can be selected as the target output module.

[0130] Select the method type of the target dimension. When training the target processing model, different processing dimensions in the target processing model can be trained based on different sample data, and the attribute information of these sample data is obtained as the processing label for each processing dimension. When processing the task to be processed, the matching degree between the processing label and the attribute information of the task to be processed can be obtained, and the processing dimension corresponding to the matching degree that meets the target conditions is determined as the target dimension.

[0131] The advantage of selecting the target output module and the target dimension according to the above method is that when training the target processing model, the numerical values of the weight parameters of the model can be adjusted according to the sample data used for training to adapt to the potential characteristics of the sample data used for training. Therefore, the more similar the task to be processed is to the sample data used for training, the more the corresponding processing module and processing dimension can adapt to the potential characteristics of the task to be processed, which is conducive to obtaining more accurate processing results.

[0132] Optionally, if the target output module is selected in the above manner, the method of this embodiment may further include the following steps:

[0133] When the matching degrees corresponding to each processing module do not meet the target conditions, obtain target sample data with the same attribute information as the task to be processed;

[0134] Train the processing module with the highest corresponding matching degree according to the target sample data to obtain a processing module whose matching degree meets the target conditions.

[0135] If the target condition requires that the matching degree is greater than a preset matching degree threshold, it is possible that the matching degree of the processing module with the highest matching degree is still less than the matching degree threshold. For this situation, the above steps can be executed to obtain a processing module whose matching degree meets the target conditions as the target output module.

[0136] In the above steps, based on the attribute information of the task to be processed, target sample data with the same attribute information can be retrieved from the network or a preset sample database.

[0137] For example, if the task to be processed is a text generation task and the field is the astronomy field, then relevant question texts in the astronomy field can be searched, and the answer texts corresponding to these question texts can be searched. The searched question texts and answer texts are used as target sample data with the same attribute information.

[0138] The method of training a processing module according to the target sample data can be:

[0139] Determine the processing module to be trained as the output module, and then input the target sample data into the target processing model for processing to obtain the processing result output by the output module;

[0140] Compare the processing result of the output module with the standard processing result set in the target sample data to determine the loss of this processing module;

[0141] Keep the weight parameters contained in other processing modules in the target processing model unchanged, and only update the numerical values of the weight parameters contained in the processing module to be trained according to the loss. After the update is completed, repeat the above process until the obtained loss meets the preset convergence condition (such as being less than a preset threshold). When the loss meets the convergence condition, the training process of this processing module ends.

[0142] Combined with the foregoing example, the target sample data input to the target processing model for processing can be the searched question texts related to the astronomy field, and the standard processing result for comparison can be the searched answer texts corresponding to the question texts.

[0143] Optionally, if the target processing model has multiple processing dimensions, when training a specific processing module, the highest corresponding processing dimension among the multiple processing dimensions can be used to process the sample data, so that the trained processing module can be applicable to both the highest corresponding processing dimension and be downward compatible with other processing dimensions with lower dimensions.

[0144] When determining the target dimension, if the matching degrees of the processing labels of each processing dimension do not meet the target conditions, the processing dimension with the highest matching degree can also be trained according to the above method, and after the training is completed, the processing dimension with the highest matching degree is determined as the target dimension.

[0145] Optionally, when training a processing module, only the weight parameters contained in the output layer of the processing module can be updated, and the other weight parameters in the processing module except the output layer are not updated.

[0146] A method for training a specific processing dimension of the target processing model using sample data can be:

[0147] Use the processing dimension to be trained of the target processing model to process the sample data, obtain the processing result output by the last processing module in the target processing model, compare this processing result with the standard processing result set in the target sample data to determine the dimension loss of the processing dimension to be trained, and update the weight parameters contained in all processing modules in the target processing model according to this dimension loss. Repeat this process until the model loss meets the preset convergence condition, so as to complete the training of the processing dimension to be trained of the target processing model.

[0148] The advantages of obtaining the target output module and the target dimension according to the above method are as follows:

[0149] When the matching degrees of each processing module and each processing dimension in the target processing model do not meet the target conditions, directly selecting the target output module and the target dimension may result in a relatively low accuracy of the processing result output by the target processing model. In this case, using the target sample data with the same attribute information as the task to be processed to train the target output module and the target dimension can enable the target processing model based on the target output module and the target dimension to better adapt to the potential features of the task to be processed, thereby obtaining a more accurate target processing result. And selecting the processing module and the processing dimension with the highest matching degree for training is conducive to shortening the training time.

[0150] Optionally, the way to determine the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model can also be:

[0151] Determine the required resource amount for processing the task to be processed according to the task type of the task to be processed;

[0152] Determine the target output module of the target processing model according to the required resource amount and the current available resource amount of the target processing model.

[0153] In this embodiment, the target processing model can record the task type of each historical task processed in the past, as well as the amount of computing resources actually occupied when processing each historical task. Thus, for each task type, the amount of computing resources occupied when processing multiple historical tasks corresponding to this task type can be summarized, and these amounts of computing resources are fused (for example, taking the average value, median, etc.) to obtain the expected resource amount corresponding to this task type. The expected resource amount represents how much computing resources are expected to be occupied when processing tasks of this task type.

[0154] When determining the task to be processed, the expected resource amount corresponding to the task type of the task to be processed can be directly determined as the required resource amount of the task to be processed, or the expected resource amount corresponding to the task type of the task to be processed can be adjusted according to the data volume of the task to be processed to obtain the required resource amount of the task to be processed.

[0155] For the latter case, the data volume of the task to be processed can be compared with the data volume of the historical task of the same type (or the average value of the data volumes of multiple historical tasks). If the data volume of the task to be processed is greater than the data volume of the historical task (or the average value), then the expected resource amount corresponding to the task type is appropriately increased to obtain the required resource amount of the task to be processed; if the data volume of the task to be processed is less than the data volume of the historical task (or the average value), then the expected resource amount corresponding to the task type is appropriately decreased to obtain the required resource amount of the task to be processed; the adjustment amplitude in both of the above cases is positively correlated with the absolute value of the difference in data volume.

[0156] The required resource amount of the task to be processed can be understood as how much computing resources are expected to be occupied in order to obtain as accurate a processing result as possible when processing the task to be processed with the target processing model.

[0157] After obtaining the required resource amount, the current available resource amount of the target processing model can be obtained from the current processing conditions. The current available resource amount represents the upper limit of the computing resources that the electronic device to which the target processing model belongs can currently allocate for the target processing model to use.

[0158] Then, the required resource amount and the available resource amount can be compared. If the available resource amount is greater than the required resource amount, then among the multiple processing modules connected in series of the target processing model, the last processing module can be selected as the target output module; or, according to the selection method based on the fusion performance index in the foregoing embodiment, the processing module with the largest fusion performance index among the multiple processing modules can be selected as the target output module;

[0159] If the available resource amount is less than the required resource amount, other processing modules except the last one can be selected as the target output module according to the difference between the two, or the processing module with the maximum fusion performance metric can be determined, and other processing modules before this processing module can be selected as the target output module;

[0160] Among them, the greater the extent that the available resource amount is less than the required resource amount, or in other words, the greater the difference between the required resource amount minus the available resource amount, the more forward the position of the selected target output module.

[0161] Take Figure 2 as an example. Assume that in the target processing model, the processing module with the maximum fusion performance metric is processing module 27. When the available resource amount is greater than the required resource amount, processing module 32 can be selected as the target output module, or processing module 27 can be selected as the target output module;

[0162] When the available resource amount is less than the required resource amount, the processing module before processing module 27 can be selected as the target output module. For example, processing module 20 can be selected as the target output module, and processing module 10 can be selected as the target output module.

[0163] Optionally, the target dimension can also be selected according to the required resource amount and the available resource amount. The selection method can be that if the available resource amount is greater than the required resource amount, the processing dimension with the largest corresponding dimension can be selected as the target dimension. For example, select Figure 3 the fourth processing dimension in Figure 3 as the target dimension; if the available resource amount is less than the required resource amount, the processing dimension with a smaller corresponding dimension can be selected as the target dimension. The less the available resource amount, the smaller the dimension corresponding to the selected target dimension. For example, if the available resource amount is slightly less than the required resource amount, select Figure 3 the third processing dimension in

[0164] as the target dimension. If the available resource amount is significantly less than the required resource amount, select

[0165] the second processing dimension in The advantage of determining the target output module and the target dimension according to the above method is that when the available resource amount is greater than the required resource amount, due to sufficient computing resources, the target output module and the target dimension with relatively high expected accuracy can be selected to obtain as accurate a processing result as possible. When the available resource amount is less than the required resource amount, the target output module and the target dimension that occupy less computing resources can be selected, so as to process the task to be processed with a small amount of computing resources and ensure that the target processing model can run smoothly.

[0165] Optionally, when training the target processing model, the sample data can be processed by the target processing model, the model loss of the target processing model can be obtained based on the processing results of the sample data, and the weight parameters included in the target processing model can be updated according to the model loss until the model loss meets the preset convergence condition.

[0166] Among them, the model loss of the target processing model is obtained by fusing the module losses of multiple processing modules and the dimension losses of multiple processing dimensions;

[0167] The module loss of the processing module is determined according to the dispersion of the output of the processing module relative to the output of the last processing module;

[0168] The dimension loss is determined according to the difference between the processing result obtained by processing the sample using the corresponding processing dimension and the sample label.

[0169] Optionally, the sample for training the target processing model can be a text prediction task sample. The text prediction task is a task of determining whether the input text paragraph contains an answer that matches the input query information. As an example, one text prediction task sample can include the following text data:

[0170] "query": "A white puppy is running on the street", "pos": ["A puppy is running"], "neg": ["A certain person A did not keep his original story", "This rule does not encourage people to pay child support", "A man wearing a vest is sitting in the car", "A person wearing black clothes, a white turban and sunglasses is waiting at the bus stop", "Neither newspaper XX nor newspaper Y commented on the current situation of the road system in country A"], "prompt": "Determine whether the paragraph contains the answer to the query by providing a prediction of 'Yes' or 'No'.

[0171] Among them, the text after query is the query information, the text after neg is the text paragraph to be judged, and the text after prompt is used to indicate the form of the processing result output by the target processing model.

[0172] The target processing model can process the input sample based on one or more processing dimensions to obtain the dimension losses of one or more processing dimensions.

[0173] If only processing the input sample based on one processing dimension, then this processing dimension can be the processing dimension with the largest corresponding dimension.

[0174] The dimension loss corresponding to a processing dimension can be calculated using the following cross-entropy loss calculation formula (1).

[0175] Loss1 = -[ylog(q)+(1 - y)log(1 - q)], (1).

[0176] Among them, Loss1 represents the dimensionality loss, q represents the processing result output after the target processing model processes the input samples based on this processing dimension, and this processing result q can be the probability value with the answer "Yes". y represents the label of the input sample. If the label is "Yes", then y is equal to 1. If the label is "NO", then y is equal to 0. The label of the sample can be manually configured by the relevant user.

[0177] In the case of multiple samples, the label y of each sample and the corresponding processing result q can be calculated according to the right side of formula (1), and then the sum of all calculation results is obtained as the dimensionality loss.

[0178] The module loss Loss_extra can be calculated based on the following dispersion calculation formula (2).

[0179] Loss_extra = (1 / N - 1) * teacher_pred * log(softmax(student_pred)), (2).

[0180] In formula (2), N represents the total number of processing modules in the target processing model that can output processing results. teacher_pred represents the processing result output by the last processing module in the target processing model when processing the sample. student_pred represents the processing results output by other processing modules in the target processing model except the last processing module when processing the sample. log represents the logarithmic operation with base 10, and softmax represents the normalized exponential function.

[0181] Combined with Figure 2 the example, N can be equal to 31. teacher_pred represents the processing result of processing module 32 when the target processing model processes the sample. student_pred represents the processing results of processing modules 2 to 31 when the target processing model processes the sample.

[0182] When calculating the module loss, the target processing model can default to processing the sample with the processing dimension having the largest corresponding dimension.

[0183] Through the above formula (2), the method of this embodiment can use the processing result of the last processing module as the teacher and the processing results of the processing modules except the last processing module as the students, and train the target processing model through the method of knowledge distillation.

[0184] After obtaining the above module loss and dimensionality loss, the two can be summed to obtain the model loss Loss of the target processing model, that is:

[0185] Loss = Loss1 + Loss_extra, (3).

[0186] Among them, if the target processing model processes samples based on multiple processing dimensions respectively when determining the dimensional loss, then Loss1 in formula (3) can be the sum of the dimensional losses corresponding to multiple processing dimensions.

[0187] The advantage of training the target processing model according to the above method is that:

[0188] It is possible to combine the processing results corresponding to multiple processing modules and multiple processing dimensions, and simultaneously train the weight parameters contained in the target processing model, so that when the trained target processing model outputs the processing result based on any processing module and any processing dimension, a relatively accurate processing result can be obtained.

[0189] This embodiment also provides a task processing device. Please refer to Figure 4 , which is a schematic structural diagram of the device. The device may include the following units.

[0190] An obtaining unit 401, configured to obtain a task to be processed;

[0191] A determining unit 402, configured to determine the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model. The target processing model includes a plurality of processing modules connected in series, and the target output module is at least one of the plurality of processing modules;

[0192] A processing unit 403, configured to process the task to be processed using the target processing model, and output a target processing result at the target output module of the target processing model.

[0193] Optionally, the determining unit 402 is further configured to:

[0194] Determine the target dimension of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model. The target dimension is at least one of the multiple processing dimensions of the target processing model;

[0195] When the processing unit 403 processes the task to be processed using the target processing model and outputs a target processing result at the target output module of the target processing model, it may be used to:

[0196] Process the task to be processed using the target dimension of the target processing model, and output a target processing result at the target output module of the target processing model.

[0197] Optionally, when the determining unit 402 determines the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model, it may be used to:

[0198] Determine the target output module of the target processing model according to the performance index of the target processing model when processing tasks with the same attribute information under the current processing conditions;

[0199] The performance index includes the accuracy of the processing results output by multiple processing modules and / or the processing duration used by multiple processing modules to output the processing results.

[0200] Optionally, when the determining unit 402 determines the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model, it can be used for:

[0201] Determine the processing module whose matching degree between the corresponding processing label and the attribute information of the task to be processed in the target processing model meets the target condition as the target output module;

[0202] Among them, the processing label corresponding to the processing module is related to the attribute information of the sample data used to train the processing module.

[0203] Optionally, when the determining unit 402 determines the target output module of the target processing model according to the attribute information of the task to be processed and the current processing conditions of the target processing model, it can be used for:

[0204] Determine the required resource amount for processing the task to be processed according to the task type of the task to be processed;

[0205] Determine the target output module of the target processing model according to the required resource amount and the current available resource amount of the target processing model.

[0206] Optionally, please refer to Figure 5 , another task processing device provided in this embodiment, which may include Figure 4 each unit of the device shown, and may further include a training unit 501 for:

[0207] Obtain target sample data with the same attribute information as the task to be processed when the matching degree corresponding to each processing module does not meet the target condition;

[0208] Train the processing module with the highest matching degree according to the target sample data to obtain a processing module whose matching degree meets the target condition.

[0209] Optionally, the model loss of the target processing model is obtained by fusing the module losses of multiple processing modules and the dimension losses of multiple processing dimensions;

[0210] The module loss of the processing module is determined according to the dispersion degree of the output of the processing module relative to the output of the last processing module;

[0211] The dimensionality loss is determined based on the difference between the processing result obtained by processing the sample using the corresponding processing dimension and the sample label.

[0212] Optionally, the training unit 501 can also be used for:

[0213] Processing multiple sample data with different attribute information respectively according to the target processing model to obtain the processing result of each sample data, and the processing result corresponding to each sample data is output by a corresponding processing module in the target processing model;

[0214] Training the corresponding processing module in the target processing model according to the processing result of each sample data;

[0215] Configuring a processing label for the corresponding processing module according to the attribute information of each sample data.

[0216] Optionally, the task to be processed includes a text generation task, and the target processing result includes a response text generated based on the task text included in the text generation task;

[0217] Alternatively, the task to be processed includes an image generation task, and the target processing result includes a task image generated based on the image information included in the image generation task;

[0218] Alternatively, the task to be processed includes a text matching task, and the target processing result includes the relative relevance between the text to be matched included in the text matching task and the target text.

[0219] For the task processing device provided in this embodiment, its working principle can refer to the relevant steps of the task processing method in the foregoing embodiment, which will not be elaborated.

[0220] It should be noted that the various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts among the various embodiments can be referred to each other.

[0221] For the convenience of description, when describing the above system or device, it is divided into various modules or units according to functions for description. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0222] As can be seen from the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0223] Finally, it should also be noted that in this article, relational terms such as first, second, third, and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0224] The above are only the preferred embodiments of this application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. A task processing method, comprising: Obtaining a task to be processed; Determining a target output module of the target processing model according to the attribute information of the task to be processed and the processing conditions in which the target processing model is currently located, the target processing model including a plurality of processing modules connected in series, and the target output module being at least one of the plurality of processing modules; Processing the task to be processed using the target processing model, and outputting a target processing result at the target output module of the target processing model.

2. The method according to claim 1, further comprising: Determining a target dimension of the target processing model according to the attribute information of the task to be processed and the processing conditions in which the target processing model is currently located, the target dimension being at least one of a plurality of processing dimensions of the target processing model; The step of processing the task to be processed using the target processing model and outputting a target processing result at the target output module of the target processing model includes: Processing the task to be processed using the target dimension of the target processing model, and outputting a target processing result at the target output module of the target processing model.

3. The method according to claim 1, wherein the step of determining the target output module of the target processing model according to the attribute information of the task to be processed and the processing conditions in which the target processing model is currently located includes: Determining the target output module of the target processing model according to the performance metrics of the target processing model when processing tasks with the same attribute information under the current processing conditions; The performance metrics include the accuracy of the processing results output by the plurality of processing modules and / or the processing duration used by the plurality of processing modules to output the processing results.

4. The method according to claim 1, wherein the step of determining the target output module of the target processing model according to the attribute information of the task to be processed and the processing conditions in which the target processing model is currently located includes: Determining, as the target output module, a processing module in the target processing model whose matching degree between the corresponding processing label and the attribute information of the task to be processed meets the target condition; Wherein, the processing label corresponding to the processing module is related to the attribute information of the sample data used to train the processing module.

5. The method according to claim 4, further comprising: When the matching degree corresponding to each processing module does not meet the target condition, obtaining target sample data having the same attribute information as the task to be processed; Training the processing module with the highest corresponding matching degree according to the target sample data to obtain a processing module whose matching degree meets the target condition.

6. The method according to claim 1, wherein the step of determining the target output module of the target processing model according to the attribute information of the task to be processed and the processing conditions in which the target processing model is currently located includes: Determining the required resource amount for processing the task to be processed according to the task type of the task to be processed; Determining the target output module of the target processing model according to the required resource amount and the current available resource amount of the target processing model.

7. The method according to claim 2, wherein the model loss of the target processing model is obtained by fusing the module losses of multiple said processing modules and the dimension losses of multiple said processing dimensions; The module loss of the processing module is determined according to the dispersion of the output of the processing module relative to the output of the last processing module; The dimension loss is determined according to the difference between the processing result obtained by processing a sample using a corresponding processing dimension and the sample label.

8. The method according to claim 4, further comprising: Processing various sample data with different attribute information respectively by the target processing model to obtain the processing results of each said sample data, and the processing result corresponding to each said sample data is output by a corresponding processing module in the target processing model; Training the corresponding processing module in the target processing model according to the processing results of each said sample data; Configuring a processing label for the corresponding processing module according to the attribute information of each said sample data.

9. The method according to claim 1, wherein the task to be processed includes a text generation task, and the target processing result includes a reply text generated based on the task text included in the text generation task; Alternatively, the task to be processed includes an image generation task, and the target processing result includes a task image generated based on the image information included in the image generation task; Alternatively, the task to be processed includes a text matching task, and the target processing result includes the relative relevance between the text to be matched included in the text matching task and the target text.

10. A task processing device, comprising: An obtaining unit, configured to obtain a task to be processed; A determining unit, configured to determine the target output module of the target processing model according to the attribute information of the task to be processed and the processing conditions in which the target processing model is currently located, the target processing model includes a plurality of serially connected processing modules, and the target output module is at least one of the plurality of processing modules; A processing unit, configured to process the task to be processed using the target processing model, and output a target processing result at the target output module of the target processing model.