Model training methods and apparatus

By training the sample set with the initial model and multi-task structure, the task embedding dense vector and mixed vector are calculated. The model is trained using multi-task joint loss, which solves the problem of dependence on data richness in the existing technology and achieves accuracy in task execution time prediction and reduces data dependence.

CN121480628BActive Publication Date: 2026-05-26ZHEJIANG NIAOCHAO SUPPLY CHAIN MANAGEMENT CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG NIAOCHAO SUPPLY CHAIN MANAGEMENT CO LTD
Filing Date
2026-01-08
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing models rely heavily on data richness when estimating task execution time, which limits their prediction capabilities when data is insufficient, thus impacting user experience.

Method used

An initial model is adopted, including a first expert network, a second expert network, a third expert network, a first gating network, a second gating network, a first task tower, and a second task tower. The task embedding dense vector and mixed vector are calculated through the training sample set. The model is trained using multi-task joint loss to obtain the predicted values ​​of execution time and bearing parameters.

Benefits of technology

While ensuring the accuracy of task execution time prediction, it reduces the dependence on data richness and improves the accuracy of the prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121480628B_ABST
    Figure CN121480628B_ABST
Patent Text Reader

Abstract

This invention discloses a model training method and apparatus. After obtaining an initial model and a training sample set, the method determines the input to the initial model based on task-related information in each training sample set. Based on the multi-task structure of the initial model, multiple expert networks of the initial model are used to calculate the dense embedding vectors corresponding to different tasks and the shared dense embedding vector. Gating networks for different tasks are used to calculate the corresponding task mixture vectors. These task mixture vectors are then input into the corresponding task stacks to obtain predicted execution duration and task-related parameters. Based on these predicted values, the task execution duration, and the task-related parameters, a multi-task joint loss is calculated as the training objective of the initial model. The initial model is then trained based on this multi-task joint loss to obtain a data prediction model. Therefore, this method can reduce the model's dependence on data richness while ensuring the accuracy of task execution duration prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically to a model training method and apparatus. Background Technology

[0002] In daily life, the ability of the task performer to fulfill its obligations, especially its ability to fulfill them on time, has a significant impact on the satisfaction of the client. Existing technologies can predict task execution time through models, but they are highly dependent on the richness of data. If the data richness is low, the time prediction ability of existing models is usually limited. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a model training method and apparatus to reduce the model's dependence on data richness while ensuring the accuracy of task execution time prediction.

[0004] In a first aspect, embodiments of the present invention provide a model training method, the method comprising:

[0005] Obtain an initial model, wherein the initial model includes a first expert network, a second expert network, a third expert network, a first gating network, a second gating network, a first task tower for predicting task execution time, and a second task tower for predicting task undertaking parameters;

[0006] Obtain a training sample set, which includes multiple training samples. Each training sample includes task-related information of the sample task, the task execution time of the sample task, and the task undertaking parameters of the task execution object. The task undertaking parameters are used to characterize the number of tasks that the task execution object has undertaken but not completed.

[0007] The input vector of the initial model is determined based on the relevant information of each task. The input vector is then input into the first expert network to determine the first task embedding dense vector, into the second expert network to determine the shared embedding dense vector, and into the third expert network to determine the second task embedding dense vector.

[0008] The first task embedding dense vector and the shared embedding dense vector are weighted and summed to determine the first task hybrid vector, wherein the weights of the weighted summation are determined by the first gating network based on the input vector;

[0009] The second task embedding dense vector and the shared embedding dense vector are weighted and summed to determine the second task hybrid vector, wherein the weights of the weighted summation are determined by the second gating network based on the input vector;

[0010] The first task mixing vector is input into the first task tower to determine the predicted execution time value;

[0011] Input the second task mixing vector into the second task tower to determine the predicted values ​​of the undertaking parameters;

[0012] Calculate the multi-task joint loss based on the predicted execution duration and the predicted undertaking parameters, as well as the task execution duration and the task undertaking parameters;

[0013] The initial model is trained based on the multi-task joint loss to obtain a data prediction model.

[0014] Optionally, the first task tower is a regression task tower, and the second task tower is a multi-classification task tower.

[0015] Optionally, the first mission tower includes:

[0016] The first fully connected layer is used to perform a linear transformation on the first task mixture vector to determine the first fully connected mixture vector.

[0017] A first activation function layer is used to perform a nonlinear transformation on the first fully connected hybrid vector to determine the first nonlinear hidden layer vector.

[0018] The first regularization layer is used to randomly set the first nonlinear hidden layer vector to zero in order to determine the first regularized hidden layer vector.

[0019] The first output layer is used to perform a linear transformation on the first regularized hidden layer vector as the execution duration prediction value.

[0020] Optionally, the second mission tower includes:

[0021] The second fully connected layer is used to perform a linear transformation on the second task mixture vector to determine the second fully connected mixture vector.

[0022] The second activation function layer is used to perform a nonlinear transformation on the second fully connected hybrid vector to determine the second nonlinear hidden layer vector;

[0023] The second regularization layer is used to randomly set the second nonlinear hidden layer vector to zero in order to determine the second regularized hidden layer vector.

[0024] The second output layer uses the softmax function to convert the second regularized hidden layer vector into class probability values ​​for a multi-class task, which are then used as the predicted values ​​for the bearing parameters.

[0025] Optionally, calculating the multi-task joint loss based on the predicted execution duration, the predicted task assignment parameters, the task execution duration, and the task assignment parameters includes:

[0026] The duration loss value is determined based on the predicted execution duration value and the corresponding task execution duration;

[0027] The parameter loss value is determined based on the predicted values ​​of each of the aforementioned task-bearing parameters and the corresponding task-bearing parameters;

[0028] The duration loss value and the parameter loss value are weighted and summed to determine the multi-task joint loss.

[0029] Optionally, training the initial model based on the multi-task joint loss to obtain a data prediction model includes:

[0030] The parameters of the first expert network, the second expert network, the third expert network, the first gating network, the second gating network, the first task tower for predicting task execution duration, and the second task tower for predicting task undertaking parameters are adjusted according to the multi-task joint loss to update the data prediction model.

[0031] Optionally, the task-related information includes provider information of the provider, which includes object information of each execution object within a predetermined geographical range, wherein the predetermined geographical range is the geographical range where the provider is located.

[0032] Optionally, the provider information also includes the provider's task allocation method, which is used to characterize the way the sample task is allocated to the task execution object. The task allocation method includes allocation before the execution status of the sample task is updated to "ready" and allocation after the execution status is updated to "ready".

[0033] Optionally, the task assignment parameter is a classification of the number of tasks, and the classification is determined based on the difference between the historical task execution time and the predicted historical execution time of multiple historical tasks.

[0034] Optionally, the first expert network, the second expert network, and the third expert network have the same network structure and do not share parameters.

[0035] Secondly, embodiments of the present invention provide a model training apparatus, the apparatus comprising:

[0036] An initial model acquisition unit is used to acquire an initial model, wherein the initial model includes a first expert network, a second expert network, a third expert network, a first gating network, a second gating network, a first task tower for predicting task execution time, and a second task tower for predicting task undertaking parameters;

[0037] A sample acquisition unit is used to acquire a training sample set, which includes multiple training samples. Each training sample includes task-related information of the sample task, the task execution time of the sample task, and the task undertaking parameters of the task execution object. The task undertaking parameters are used to characterize the number of tasks that the task execution object has undertaken but not completed.

[0038] The first training unit is configured to determine the input vector of the initial model based on the relevant information of each task, and input the input vector into the first expert network to determine the first task embedding dense vector, into the second expert network to determine the shared embedding dense vector, and into the third expert network to determine the second task embedding dense vector.

[0039] The second training unit is used to perform a weighted summation of the first task embedding dense vector and the shared embedding dense vector to determine the first task hybrid vector, wherein the weights of the weighted summation are determined by the first gating network based on the input vector;

[0040] The third training unit is used to perform a weighted summation of the second task embedding dense vector and the shared embedding dense vector to determine the second task hybrid vector, wherein the weights of the weighted summation are determined by the second gating network based on the input vector;

[0041] The fourth training unit is used to input the first task mixing vector into the first task tower to determine the execution time prediction value;

[0042] The fifth training unit is used to input the second task mixing vector into the second task tower to determine the predicted values ​​of the undertaking parameters;

[0043] The sixth training unit is used to calculate the multi-task joint loss based on the predicted execution time and the predicted task parameters, as well as the task execution time and the task task parameters.

[0044] The seventh training unit is used to train the initial model based on the multi-task joint loss to obtain a data prediction model.

[0045] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of the first aspects.

[0046] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any one of the first aspects.

[0047] Fifthly, embodiments of the present invention provide a computer program product, the computer program product including a computer program / instruction, which, when executed by a processor, implements the method as described in any one of the first aspects.

[0048] In this embodiment of the invention, after obtaining the initial model and training sample set, the input of the initial model is determined based on the task-related information in each training sample set. Based on the multi-task structure of the initial model, multiple expert networks of the initial model are used to calculate the dense embedding vectors corresponding to different tasks and the shared dense embedding vector. Gating networks for different tasks are used to calculate the corresponding task mixture vectors. These different task mixture vectors are then input into the corresponding task stacks to obtain the predicted execution time and task-related parameters. Based on these predicted values, the task execution time, and the task-related parameters, the multi-task joint loss is calculated as the training objective of the initial model. The initial model is then trained based on the multi-task joint loss to obtain a data prediction model. Therefore, while ensuring the accuracy of task execution time prediction, the model's dependence on data richness can be reduced. Attached Figure Description

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

[0050] Figure 1 This is a flowchart of the model training method according to an embodiment of the present invention;

[0051] Figure 2 This is a schematic diagram of the structure of an initial model according to an embodiment of the present invention;

[0052] Figure 3 This is another structural schematic diagram of the initial model of an embodiment of the present invention;

[0053] Figure 4 This is a schematic diagram of the mission tower according to an embodiment of the present invention;

[0054] Figure 5 This is a schematic diagram of the model training device according to an embodiment of the present invention;

[0055] Figure 6 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0056] The present application is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without these details. To avoid obscuring the substance of the present application, well-known methods, processes, flows, elements, and circuits are not described in detail.

[0057] Furthermore, those skilled in the art should understand that the accompanying drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.

[0058] Unless the context explicitly requires it, words such as "including" or "contains" throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".

[0059] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0060] The technical solution of this invention can be applied to the transaction and delivery services of instant e-commerce platforms, such as Taobao Flash Sale, Taoxianda, Ele.me takeaway and retail.

[0061] In daily life, the ability of the task performer to fulfill its obligations, especially its ability to fulfill them on time, has a significant impact on the satisfaction of the client. Existing technologies can predict task execution time through models, but they are highly dependent on the richness of data. If the data richness is low, the time prediction ability of existing models is usually limited.

[0062] Taking the application scenario of instant retail as an example, in one possible situation, when a user is browsing a store recommendation page, the instant e-commerce platform usually estimates the delivery time of store S1 to be 30 minutes based on the average delivery time of store S1 or the store information of store S1. However, after the user selects product G1 from store S1, or submits an order based on product G1, the instant e-commerce platform can estimate the delivery time of product G1 to be 45 minutes to 1 hour based on the store information of store S1 and the product information of product G1. This is significantly longer than the delivery time of store S1 when the user browses the store recommendation page. Even if the delivery capacity can deliver product G1 in a delivery time of 45 minutes to 1 hour, it will still significantly reduce the user's experience and reduce the user's willingness to select store S1.

[0063] To address the aforementioned issues, this invention proposes a model training method and apparatus to reduce the model's dependence on data richness while ensuring the accuracy of task execution time prediction.

[0064] In this embodiment of the invention, the demand side is the user of the instant e-commerce platform, the recommended entity is the store managed by the instant e-commerce platform, the execution object is the delivery capacity (such as delivery personnel, delivery drones, delivery robots, etc.) for takeaway orders, and the task execution time is the delivery time of takeaway orders, as an example for illustration. However, those skilled in the art will readily understand that the method of this embodiment of the invention is equally applicable in other application scenarios.

[0065] The following describes the method through examples. Figure 1 This is a flowchart of the model training method according to an embodiment of the present invention. Figure 1 As shown, the method in this embodiment may include the following steps:

[0066] Step S100: Obtain the initial model.

[0067] In this embodiment, the initial model mainly consists of a task tower, a gating network, and expert networks. Specifically, the task tower includes a first task tower and a second task tower, where the first task tower is used to predict task execution time, and the second task tower is used to predict task parameters; the gating network includes a first gating network and a second gating network; and the expert network module includes a first expert network, a second expert network, and a third expert network.

[0068] Figure 2 This is a schematic diagram of the initial model of an embodiment of the present invention. For example... Figure 2 As shown, the arrows indicate the direction of data processing. The initial model 20 includes expert networks 21, 22, 23, gating networks 24 and 25, a task tower 26, and a task tower 27. Specifically, expert network 21 is the first expert network, expert network 22 is the third expert network, expert network 23 is the second expert network, gating network 24 is the first gating network, gating network 25 is the second gating network, task tower 26 is the first task tower, and task tower 27 is the second task tower. Optionally, the first, second, and third expert networks have the same network structure and do not share parameters.

[0069] Figure 3 This is another structural schematic diagram of the initial model of an embodiment of the present invention. For example... Figure 3 As shown, in one optional implementation, expert networks 21, 22, and 23 can each include multiple expert network units. Expert network 21 includes... to common Expert network units, expert network 22 includes to common Expert network units, expert network 23 includes to common Each expert network unit is an independent neural network, typically composed of fully connected layers, convolutional layers, or transformer sublayers, and is specifically designed to process a certain type of pattern in the input, such as user interests, product attributes, or scene features.

[0070] Gated networks 24 and 25 may include a selector, a fully connected layer, and a softmax layer (i.e., a softmax function). Taking gated network 24 as an example, gated network 24 includes a selector 31, a fully connected layer 32, and a softmax layer 33. The selector 31 is used to initially filter multiple representations of the input vector, i.e., vectors 1 to m, to determine k candidate input vectors (k is an integer less than or equal to m). The fully connected layer 32 is used to compress the candidate input vectors into a low-dimensional space and learn the correlation between candidate input vectors through linear transformation. The softmax layer 33 is used to perform nonlinear transformation and normalization on the output vector of the fully connected layer 32 to generate k weight values. The selector 31 generates an expert selection signal based on the generated k weight values ​​to determine the expert network units participating in the current task, and performs a weighted summation of the output vectors of the selected expert network units according to their corresponding weights to obtain a weighted summation vector.

[0071] Both Mission Tower 26 and Mission Tower 27 can include multiple substructures. The substructures of Mission Tower 26 include... Substructure, i-th substructure Used for the (i-1)th substructure Alternatively, the task-specific intermediate features output by the gating network 24 can be further modified, and finally determined by the first... Each substructure outputs the task execution time. Similarly, the substructures of Task Tower 27 include... Substructure, j-th substructure Used for the (j-1)th substructure Alternatively, the task-specific intermediate features output by the gating network 25 can be further modified, and finally determined by the first... Each substructure outputs the task assignment parameters.

[0072] In one optional implementation, the first task tower may include a first fully connected layer, a first activation function layer, a first regularization layer, and a first output layer. The first fully connected layer performs a linear transformation on the data input to the first fully connected layer; the first activation function layer performs a non-linear transformation on the data input to the first activation function layer; the first regularization layer randomly sets the data input to the first regularization layer to zero; and the first output layer performs a linear transformation on the data input to the first output layer.

[0073] Similarly, the second task tower may include a second fully connected layer, a second activation function layer, a second regularization layer, and a second output layer. The second fully connected layer performs a linear transformation on the data input to it; the second activation function layer performs a non-linear transformation on the data input to it; the second regularization layer randomly zeros the data input to it; and the second output layer converts the data input to it into class probability values ​​for a multi-class classification task based on a softmax function.

[0074] Figure 4 This is a schematic diagram of the mission tower according to an embodiment of the present invention. Figure 4 As shown, taking task tower 26 as an example, task tower 26 may include a fully connected layer 41, an activation function layer 42, a regularization layer 43, and an output layer 44.

[0075] Step S200: Obtain the training sample set of the initial model.

[0076] In practical applications, the number of tasks that a delivery capacity has undertaken but not yet completed (i.e., the order backlog) will affect the delivery time of an order. For example: If the order backlog of a delivery capacity is 1, including order Or1, the delivery time for order Or1 is t1. If, before delivering order Or1, the order backlog increases to 4, including orders Or1, Or2, Or3, and Or4, the delivery capacity needs to go to the stores corresponding to orders Or2, Or3, and Or4 to pick up the takeout items for those orders before delivering order Or1. The delivery time to the store corresponding to order Or2 is t2, the time to the store corresponding to order Or3 is t3, the time to the store corresponding to order Or4 is t4, and the time to get from the store corresponding to order Or4 to the delivery location of order Or1 is t5. Then, the delivery time for order Or1 will be updated from t1 to (t2+t3+t4+t5), which is significantly longer than t1.

[0077] Therefore, in this embodiment, the initial model's training sample set may include multiple training samples, and each training sample may include task-related information of the sample task, the task execution duration of the sample task, and the task-assignment parameters of the task execution object. Specifically, the task-related information may include user information and store information corresponding to the sample task; the task execution object is the actual execution object of the sample task; the task execution duration may be the actual delivery duration of the sample order; and the task-assignment parameters characterize the number of tasks that the task execution object has undertaken but not yet completed.

[0078] In this embodiment, user information can be set according to actual needs, and may include at least one of the following: user's order delivery location, user's identity type, geographical range of the user's order delivery location, and population density of the geographical range of the user's order delivery location.

[0079] Furthermore, the user's identity type can be used to indicate whether the user is a new user or a member user of the instant e-commerce platform; the geographical range type of the user's order delivery location can be used to indicate whether the geographical range of the user's order delivery location is an office area, residential area, school, train station, airport, etc.; the personnel density type of the geographical range of the user's order delivery location can be used to indicate whether the geographical range of the user's order delivery location belongs to a high personnel density (e.g., personnel density is higher than a preset density threshold).

[0080] Store information can also be set according to actual needs. For example, it can include the store's location information and the delivery capacity information of each delivery capacity within the geographical range (i.e., the predetermined geographical range) where the store is located. It can also include at least one of the following: store type, range type of the predetermined geographical range, and store on-time rate.

[0081] Furthermore, the delivery capacity information for each delivery capacity within the predetermined geographical area may include at least one of the following: the actual order volume handled by each delivery capacity (representing the number of takeout orders allocated to the delivery capacity but not yet completed), the location information of each delivery capacity, and the attribute information of each delivery capacity (e.g., delivery capacity identity type, delivery capacity on-time rate, delivery capacity late rate, delivery capacity rating, delivery capacity average delivery time, delivery capacity delivery level, etc.). The store type may be used to indicate whether the store is a chain store or a restaurant. The geographical area type may be used to indicate whether the predetermined geographical area is an office area, residential area, school, train station, airport, etc. The delivery capacity identity type may be used to indicate whether the delivery capacity is a dedicated delivery capacity. The delivery capacity on-time rate can be determined based on the ratio of the number of on-time takeout orders delivered by the delivery capacity to the total number of takeout orders delivered over a past period (e.g., the past week, the past month, etc.). The delivery capacity late rate can be determined based on the ratio of the number of late takeout orders delivered by the delivery capacity to the total number of takeout orders delivered over a past period.

[0082] After obtaining the user's order delivery location, the store's location information, and the location information of each delivery capacity, the distance between the user and the store, and the distance between each delivery capacity and the store, can also be obtained. The distance between the user and the store can be the straight-line distance between the user and the store, or it can be the navigation distance between the user and the store (i.e., the length of the navigation route between the user and the store); similarly, the distance between each delivery capacity and the store can be the straight-line distance between each delivery capacity and the store, or it can be the navigation distance between each delivery capacity and the store. This embodiment does not impose any restrictions on this.

[0083] In one optional implementation, to improve the training efficiency of the data prediction model and enable it to specifically learn the task execution time of sample tasks, the first task tower in this embodiment can be a regression task tower, and the second task tower can be a multi-classification task tower. Therefore, in this optional implementation, the task assignment parameter can be a classification of the number of tasks that the task execution object has undertaken but not completed, and this classification can be determined based on the difference between the historical task execution time and the predicted historical execution time of multiple historical tasks.

[0084] Furthermore, the predicted historical execution time of each historical task can be determined based on a large language model or other pre-trained machine learning models, along with relevant historical task information. The difference between the predicted and historical execution times of each historical task can be determined using various error metrics, such as Mean Absolute Error (MAE) and Mean Squared Error (MSE). After determining the difference between the predicted and historical execution times of each historical task, the mapping relationship between the number of historical tasks and the aforementioned difference can be established. Furthermore, the number of historical tasks whose predicted and historical execution times differ within the same error segment and are consecutive can be classified as having the same number of tasks.

[0085] For example, the average absolute error between the predicted delivery time (i.e., the predicted historical execution time) and the actual delivery time (i.e., the historical task execution time) of each historical order is distributed between 0.1 minutes and 1 minute. This can be categorized into error segments of 0.1-0.5 minutes, 0.5-0.8 minutes, and 0.8-1 minute. If the number of back-orders (i.e., the number of historical tasks) with an average absolute error between 0.1-0.5 minutes is 3 and 4, the number of back-orders with an average absolute error between 0.5-0.8 minutes is 1, 2, and 5-10, and the number of back-orders with an average absolute error between 0.8-1 minutes is more than 10, then the order undertaking parameters (i.e., the task undertaking parameters) can be categorized into four types based on the number of tasks: Category C1: 1 and 2, Category C2: 3 and 4, Category C3: 5-10, and Category C4: 11 and more.

[0086] In the actual order allocation process, instant e-commerce platforms or stores can use different methods to allocate orders to delivery capacity. For example, orders can be allocated before the execution status is updated to "ready" (i.e., simultaneous call). In this method, the process of the provider preparing the takeaway goods and the process of the delivery capacity going to the provider to retrieve the takeaway goods can be executed in parallel. Alternatively, orders can be allocated after the execution status is updated to "ready" (i.e., call after delivery). In this method, the delivery capacity will only go to the provider to retrieve the takeaway goods after the provider has finished preparing the takeaway goods. Furthermore, instant e-commerce platforms or order providers can use different methods to allocate takeaway orders to delivery capacity based on the type of takeaway goods. For example, they can be divided into catering and non-catering types (i.e., retail types). Therefore, order allocation methods can include simultaneous call for catering, call after delivery for catering, simultaneous call for retail, and call after delivery for retail. These different order allocation methods will result in differences in the delivery time of takeaway orders. Therefore, in an optional implementation of this embodiment, the store information can also include the order allocation method.

[0087] Depending on actual needs, this embodiment can also obtain other information, such as holiday information corresponding to the order (i.e., whether it is a holiday) and weather information corresponding to the order (i.e., whether it is rainy / snowy / sunny, etc.). This embodiment does not limit this.

[0088] Step S300: Determine the input vector of the initial model based on the relevant information of each task, and input the input vector into the first expert network to determine the first task embedding dense vector, into the second expert network to determine the shared embedding dense vector, and into the third expert network to determine the second task embedding dense vector.

[0089] In this step, the task-related information of each sample task can be preprocessed by outlier cleaning, missing value imputation, etc. The preprocessed task-related information of each sample task is then input into the corresponding data type embedding layer according to the data type. The embedding vectors output by each embedding layer are integrated into the input vector of the initial model through fusion strategies such as concatenation and attention weighting.

[0090] Then, the input vector corresponding to the sample task can be input into the first expert network, and the output vector of the first expert network can be determined as the first task embedding dense vector. The input vector corresponding to each sample task can be input into the shared expert network, and the output vector of the shared expert network can be determined as the shared task embedding dense vector. The input vector corresponding to the sample task can be input into the second expert network, and the output vector of the second expert network can be determined as the second task embedding dense vector.

[0091] by Figure 2 Taking the structure of the initial model shown as an example, after obtaining the input vector of the initial model based on the task-related information of each sample task, the input vector of each sample task can be input into expert network 21, expert network 22 and expert network 23 respectively. The output vector of expert network 21 is also the first task embedding dense vector, the output vector of expert network 22 is also the shared task embedding dense vector, and the output vector of expert network 23 is also the second task embedding dense vector.

[0092] Step S400: Perform a weighted summation of the first task embedded dense vector and the shared embedded dense vector to determine the first task hybrid vector.

[0093] After obtaining the first task embedding dense vector output by the first expert network and the shared embedding dense vector output by the second expert network, the first task embedding dense vector and the shared embedding dense vector can be weighted and summed to obtain the first task hybrid vector.

[0094] In this embodiment, the weights of the first task embedding dense vector and the shared embedding dense vector can be adaptively allocated by the gating network based on the input vector. Specifically, the initial model can map the input vector to two-dimensional logits (raw unnormalized scores) through the fully connected layers in the gating network, and then normalize it using the softmax function to obtain the weights allocated to the first task embedding dense vector and the weights allocated to the shared embedding dense vector.

[0095] by Figure 2 Taking the structure of the initial model shown as an example, the input vector can also be used as the input to the gating network 24. Specifically, the gating network 24 maps the input vector to two-dimensional logits through the internal fully connected layer 32, and then normalizes it through the softmax layer 33 to obtain two weight values. Subsequently, the initial model can perform a weighted summation of the first task embedding dense vector and the shared embedding dense vector according to the above two weights to obtain the first task hybrid vector.

[0096] In one optional implementation, each expert network unit of the first expert network outputs a first task embedding dense vector, and each expert network unit of the second expert network outputs a shared embedding dense vector. Therefore, the gating network can generate weights corresponding to each expert network unit, and select the first task embedding dense vector or the shared embedding dense vector from each first task embedding dense vector or each shared embedding dense vector according to each weight. Then, the selected first task embedding dense vector or the shared embedding dense vector is weighted and summed according to the weights to obtain the first task hybrid vector.

[0097] Step S500: Perform a weighted summation of the second task embedded dense vector and the shared embedded dense vector to determine the second task hybrid vector.

[0098] After obtaining the second task embedding dense vector output by the third expert network and the shared embedding dense vector output by the second expert network, the second task embedding dense vector and the shared embedding dense vector can be weighted and summed to obtain the second task hybrid vector.

[0099] In this embodiment, the weights of the second task embedding dense vector and the shared embedding dense vector can also be adaptively allocated by the gating network based on the input vector. In this embodiment, the generation method of the weights of the second task embedding dense vector and the shared embedding dense vector can refer to the generation method of the weights of the first task embedding dense vector and the shared embedding dense vector, and will not be repeated here.

[0100] Step S600: Input the first task mixing vector into the first task tower to determine the predicted execution time value.

[0101] In this step, the first task mixing vector can be input into the first task tower, and the execution time prediction value of the sample task can be determined based on the output of the first task tower.

[0102] In one alternative implementation, the first task mixing vector can be input into the first fully connected layer, and the output vector of the first fully connected layer can be determined as the first fully connected mixing vector; the first fully connected mixing vector can be input into the first activation function layer, and the output vector of the first activation function layer can be determined as the first nonlinear hidden layer vector; the first nonlinear hidden layer vector can be input into the first regularization layer, and the output vector of the first nonlinear hidden layer vector can be determined as the first regularized hidden layer vector; then the first regularized hidden layer vector can be input into the first output layer, and the value output by the first output layer can be determined as the execution time prediction value.

[0103] by Figure 4 Taking the structure of the task tower shown as an example, the first task mixing vector can be input into the fully connected layer 41 to obtain the first fully connected mixing vector, then input into the activation function layer 42 to obtain the first nonlinear hidden layer vector, then input into the first regularization layer to obtain the first regularized hidden layer vector, and then input into the output layer 44 to obtain the execution time prediction value.

[0104] Step S700: Input the second task mixing vector into the second task tower to determine the predicted value of the undertaking parameter.

[0105] In this step, the second task mixing vector can be input into the second task tower, and the predicted values ​​of the sample task's undertaking parameters can be determined based on the output of the second task tower.

[0106] In one optional implementation, if the second task tower is a classification task tower, the second task mixing vector can be input into the second fully connected layer, and the output vector of the second fully connected layer can be determined as the second fully connected mixing vector; the second fully connected mixing vector can be input into the second activation function layer, and the output vector of the second activation function layer can be determined as the second nonlinear hidden layer vector; the second nonlinear hidden layer vector can be input into the second regularization layer, and the output vector of the second nonlinear hidden layer vector can be determined as the second regularized hidden layer vector; then the second regularized hidden layer vector can be input into the second output layer, and the class probability value output by the second output layer can be determined as the predicted value of the bearing parameter.

[0107] Step S800: Calculate the multi-task joint loss based on the predicted execution duration and the predicted task parameters, as well as the task execution duration and the task task parameters.

[0108] In this step, the duration loss value of the initial model can be determined based on the predicted execution time of each sample task and the corresponding task execution time. The parameter loss value of the initial model can be determined based on the predicted parameter values ​​of each sample task and the corresponding task parameter values. Then, the duration loss value and the parameter loss value are weighted and summed to obtain the multi-task joint loss of the initial model.

[0109] Depending on the actual settings, the duration loss and parameter loss values ​​can be determined using various error measurement algorithms; this embodiment does not impose any restrictions on this. Optionally, the duration loss value of the initial model... This can be expressed by the following formula:

[0110] ;

[0111] Where m represents the total number of sample tasks. This represents the execution time of the i-th sample task. This represents the predicted execution time output by the first task tower.

[0112] Optionally, the parameter loss value of the initial model This can be expressed by the following formula:

[0113] ;

[0114] Where c represents the total number of categories of tasks. This represents the task-related parameters for the i-th sample task. This represents the probability value of the second task tower output under the category of the c-th task number.

[0115] The initial model's multi-task joint loss This can be expressed by the following formula:

[0116]

[0117] Where w represents The corresponding weights can be set according to actual needs.

[0118] Step S900: Train the initial model based on the multi-task joint loss to obtain the data prediction model.

[0119] In this step, the parameters of the first expert network, the second expert network, the third expert network, the first gating network, the second gating network, the first task tower for predicting task execution duration, and the second task tower for predicting task performance parameters can be adjusted based on the multi-task joint loss to update the data prediction model. Optionally, the adjusted initial model can be determined as the data prediction model when the multi-task joint loss converges.

[0120] Optionally, other model evaluation metrics can also be obtained, such as the accuracy parameter of the initial model. When the accuracy parameter meets the evaluation criteria (e.g., the accuracy parameter is higher than the preset accuracy threshold) and the multi-task joint loss converges, the adjusted initial model is determined as the data prediction model.

[0121] This invention, by combining the actual task-bearing situation of the task's actual execution object, can predict the task execution time. This can effectively compensate for the low accuracy of task execution time prediction caused by the inability to determine the delivery capacity of the delivery task before the user places an order. Therefore, it can improve the accuracy of task execution time prediction while reducing the dependence on data diversity.

[0122] In this embodiment of the invention, after obtaining the initial model and training sample set, the input of the initial model is determined based on the task-related information in each training sample set. Based on the multi-task structure of the initial model, multiple expert networks of the initial model are used to calculate the dense embedding vectors corresponding to different tasks and the shared dense embedding vector. Gating networks for different tasks are used to calculate the corresponding task mixture vectors. These different task mixture vectors are then input into the corresponding task stacks to obtain the predicted execution time and task-related parameters. Based on these predicted values, the task execution time, and the task-related parameters, the multi-task joint loss is calculated as the training objective of the initial model. The initial model is then trained based on the multi-task joint loss to obtain a data prediction model. Therefore, while ensuring the accuracy of task execution time prediction, the model's dependence on data richness can be reduced.

[0123] Figure 5 This is a schematic diagram of a model training device according to an embodiment of the present invention. Figure 5As shown, the model training device in this embodiment includes an initial model acquisition unit 501, a sample acquisition unit 502, a first training unit 503, a second training unit 504, a third training unit 505, a fourth training unit 506, a fifth training unit 507, a sixth training unit 508, and a seventh training unit 509.

[0124] The initial model acquisition unit 501 is used to acquire an initial model, which includes a first expert network, a second expert network, a third expert network, a first gating network, a second gating network, a first task tower for predicting task execution time, and a second task tower for predicting task undertaking parameters. The sample acquisition unit 502 is used to acquire a training sample set, which includes multiple training samples. Each training sample includes task-related information of the sample task, the task execution time of the sample task, and task undertaking parameters of the task execution object. The task undertaking parameters characterize the number of tasks undertaken but not completed by the task execution object. The first training unit 503 is used to determine the input vector of the initial model based on the task-related information, and inputs the input vector to the first expert network to determine a first task embedding dense vector, to the second expert network to determine a shared embedding dense vector, and to the third expert network to determine a second task embedding dense vector. The second training unit 503... Training unit 54 is used to perform a weighted summation of the first task embedding dense vector and the shared embedding dense vector to determine the first task mixture vector, wherein the weights of the weighted summation are determined by the first gating network based on the input vector; training unit 505 is used to perform a weighted summation of the second task embedding dense vector and the shared embedding dense vector to determine the second task mixture vector, wherein the weights of the weighted summation are determined by the second gating network based on the input vector; training unit 506 is used to input the first task mixture vector into the first task tower to determine the execution duration prediction value; training unit 507 is used to input the second task mixture vector into the second task tower to determine the task assignment parameter prediction value; training unit 508 is used to calculate the multi-task joint loss based on the execution duration prediction value, the task assignment parameter prediction value, the task execution duration, and the task assignment parameter; training unit 509 is used to train the initial model based on the multi-task joint loss to obtain a data prediction model.

[0125] Furthermore, the first task tower is a regression task tower, and the second task tower is a multi-classification task tower.

[0126] Furthermore, the first task tower includes a first fully connected layer, a first activation function layer, a first regularization layer, and a first output layer.

[0127] The first fully connected layer is used to perform a linear transformation on the first task mixture vector to determine the first fully connected mixture vector; the first activation function layer is used to perform a nonlinear transformation on the first fully connected mixture vector to determine the first nonlinear hidden layer vector; the first regularization layer is used to randomly set the first nonlinear hidden layer vector to zero to determine the first regularized hidden layer vector; and the first output layer is used to perform a linear transformation on the first regularized hidden layer vector as the execution time prediction value.

[0128] Furthermore, the second task tower includes a second fully connected layer, a second activation function layer, a second regularization layer, and a second output layer.

[0129] The second fully connected layer is used to linearly transform the second task mixture vector to determine the second fully connected mixture vector; the second activation function layer is used to nonlinearly transform the second fully connected mixture vector to determine the second nonlinear hidden layer vector; the second regularization layer is used to randomly zero out the second nonlinear hidden layer vector to determine the second regularized hidden layer vector; and the second output layer uses the softmax function to convert the second regularized hidden layer vector into the category probability value of the multi-class task as the predicted value of the bearing parameter.

[0130] Furthermore, the sixth training unit 508 includes a first loss value determination subunit, a second loss value determination subunit, and a third loss value determination subunit.

[0131] The first loss value determination subunit is used to determine the duration loss value based on the predicted execution duration value and the corresponding task execution duration; the second loss value determination subunit is used to determine the parameter loss value based on the predicted undertaking parameter value and the corresponding task undertaking parameter; and the third loss value determination subunit is used to perform a weighted summation of the duration loss value and the parameter loss value to determine the multi-task joint loss.

[0132] Furthermore, the seventh training unit 509 is further configured to adjust the parameters of the first expert network, the second expert network, the third expert network, the first gating network, the second gating network, the first task tower for predicting task execution duration, and the second task tower for predicting task undertaking parameters according to the multi-task joint loss, so as to update the data prediction model.

[0133] Furthermore, the task-related information includes provider information, which includes object information of each execution object within a predetermined geographical range, wherein the predetermined geographical range is the geographical range where the provider is located.

[0134] Furthermore, the provider information also includes the provider's task allocation method, which is used to characterize the way the sample task is allocated to the task execution object. The task allocation method includes allocation before the execution status of the sample task is updated to "ready" and allocation after the execution status is updated to "ready".

[0135] Furthermore, the task assignment parameter is a classification of the number of tasks, and the classification is determined based on the difference between the historical task execution time and the predicted historical execution time of multiple historical tasks.

[0136] Furthermore, the first expert network, the second expert network, and the third expert network have the same network structure and do not share parameters.

[0137] In this embodiment of the invention, after obtaining the initial model and training sample set, the input of the initial model is determined based on the task-related information in each training sample set. Based on the multi-task structure of the initial model, multiple expert networks of the initial model are used to calculate the dense embedding vectors corresponding to different tasks and the shared dense embedding vector. Gating networks for different tasks are used to calculate the corresponding task mixture vectors. These different task mixture vectors are then input into the corresponding task stacks to obtain the predicted execution time and task-related parameters. Based on these predicted values, the task execution time, and the task-related parameters, the multi-task joint loss is calculated as the training objective of the initial model. The initial model is then trained based on the multi-task joint loss to obtain a data prediction model. Therefore, while ensuring the accuracy of task execution time prediction, the model's dependence on data richness can be reduced.

[0138] Figure 6 This is a schematic diagram of an electronic device according to an embodiment of the present invention. In this embodiment, the electronic device includes a server, a terminal, etc. Figure 6 As shown, the electronic device includes at least one processor 601; a memory 602 communicatively connected to at least one processor 601; and a communication component 603 communicatively connected to a scanning device, wherein the communication component 603 receives and transmits data under the control of the processor 601; wherein the memory 602 stores instructions executable by at least one processor 601, which are executed by at least one processor 601 to implement the above-described model training method.

[0139] Specifically, the electronic device includes: one or more processors 601 and a memory 602. Figure 6 Taking a processor 601 as an example, the processor 601 and the memory 602 can be connected via a bus or other means. Figure 6Taking a bus connection as an example, memory 602, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Processor 601 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions, and modules stored in memory 602, thereby implementing the aforementioned model training method.

[0140] Memory 602 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store an option list, etc. Furthermore, memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 602 may optionally include memory remotely located relative to processor 601, and these remote memories may be connected to external devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0141] One or more modules are stored in memory 602, and when executed by one or more processors 601, they execute the model training method in any of the above method embodiments.

[0142] The above-mentioned products can perform the methods provided in the embodiments of this application, and have the corresponding functional modules and beneficial effects of performing the methods. For technical details not described in detail in this embodiment, please refer to the methods provided in the embodiments of this application.

[0143] In this embodiment of the invention, after obtaining the initial model and training sample set, the input of the initial model is determined based on the task-related information in each training sample set. Based on the multi-task structure of the initial model, multiple expert networks of the initial model are used to calculate the dense embedding vectors corresponding to different tasks and the shared dense embedding vector. Gating networks for different tasks are used to calculate the corresponding task mixture vectors. These different task mixture vectors are then input into the corresponding task stacks to obtain the predicted execution time and task-related parameters. Based on these predicted values, the task execution time, and the task-related parameters, the multi-task joint loss is calculated as the training objective of the initial model. The initial model is then trained based on the multi-task joint loss to obtain a data prediction model. Therefore, while ensuring the accuracy of task execution time prediction, the model's dependence on data richness can be reduced.

[0144] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program for use by a computer to execute some or all of the above-described method embodiments.

[0145] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0146] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A model training method, characterized in that, The method includes: Obtain an initial model, wherein the initial model includes a first expert network, a second expert network, a third expert network, a first gating network, a second gating network, a first task tower for predicting task execution time, and a second task tower for predicting task undertaking parameters; Obtain a training sample set, which includes multiple training samples. Each training sample includes task-related information of the sample task, the task execution time of the sample task, and the task undertaking parameters of the task execution object. The task undertaking parameters are used to characterize the number of tasks that the task execution object has undertaken but not completed. The input vector of the initial model is determined based on the relevant information of each task. The input vector is then input into the first expert network to determine the first task embedding dense vector, into the second expert network to determine the shared embedding dense vector, and into the third expert network to determine the second task embedding dense vector. The first task embedding dense vector and the shared embedding dense vector are weighted and summed to determine the first task hybrid vector, wherein the weights of the weighted summation are determined by the first gating network based on the input vector; The second task embedding dense vector and the shared embedding dense vector are weighted and summed to determine the second task hybrid vector, wherein the weights of the weighted summation are determined by the second gating network based on the input vector; The first task mixing vector is input into the first task tower to determine the predicted execution time value; Input the second task mixing vector into the second task tower to determine the predicted values ​​of the undertaking parameters; Calculate the multi-task joint loss based on the predicted execution duration and the predicted undertaking parameters, as well as the task execution duration and the task undertaking parameters; The initial model is trained based on the multi-task joint loss to obtain a data prediction model; The task-related information includes provider information, which includes object information of each execution object within a predetermined geographical range, where the predetermined geographical range is the geographical range where the provider is located.

2. The method according to claim 1, characterized in that, The first task tower is a regression task tower, and the second task tower is a multi-classification task tower.

3. The method according to claim 2, characterized in that, The first mission tower includes: The first fully connected layer is used to perform a linear transformation on the first task mixture vector to determine the first fully connected mixture vector. A first activation function layer is used to perform a nonlinear transformation on the first fully connected hybrid vector to determine the first nonlinear hidden layer vector. The first regularization layer is used to randomly set the first nonlinear hidden layer vector to zero in order to determine the first regularized hidden layer vector. The first output layer is used to perform a linear transformation on the first regularized hidden layer vector as the execution duration prediction value.

4. The method according to claim 2, characterized in that, The second mission tower includes: The second fully connected layer is used to perform a linear transformation on the second task mixture vector to determine the second fully connected mixture vector. The second activation function layer is used to perform a nonlinear transformation on the second fully connected hybrid vector to determine the second nonlinear hidden layer vector; The second regularization layer is used to randomly set the second nonlinear hidden layer vector to zero in order to determine the second regularized hidden layer vector. The second output layer uses the softmax function to convert the second regularized hidden layer vector into class probability values ​​for a multi-class task, which are then used as the predicted values ​​for the bearing parameters.

5. The method according to claim 1, characterized in that, The step of calculating the multi-task joint loss based on the predicted execution duration, the predicted task assignment parameters, the task execution duration, and the task assignment parameters includes: The duration loss value is determined based on the predicted execution duration value and the corresponding task execution duration; The parameter loss value is determined based on the predicted values ​​of each of the aforementioned task-bearing parameters and the corresponding task-bearing parameters; The duration loss value and the parameter loss value are weighted and summed to determine the multi-task joint loss.

6. The method according to claim 1, characterized in that, The step of training the initial model based on the multi-task joint loss to obtain a data prediction model includes: The parameters of the first expert network, the second expert network, the third expert network, the first gating network, the second gating network, the first task tower for predicting task execution duration, and the second task tower for predicting task undertaking parameters are adjusted according to the multi-task joint loss to update the data prediction model.

7. The method according to claim 1, characterized in that, The provider information also includes the provider's task allocation method, which is used to characterize the way the sample task is allocated to the task execution object. The task allocation method includes allocation before the execution status of the sample task is updated to "ready" and allocation after the execution status is updated to "ready".

8. The method according to claim 1, characterized in that, The task assignment parameter is the classification of the number of tasks, and the classification is determined based on the difference between the historical execution time of multiple historical tasks and the predicted historical execution time.

9. The method according to claim 1, characterized in that, The first expert network, the second expert network, and the third expert network have the same network structure and do not share parameters.

10. A model training device, characterized in that, The device includes: An initial model acquisition unit is used to acquire an initial model, wherein the initial model includes a first expert network, a second expert network, a third expert network, a first gating network, a second gating network, a first task tower for predicting task execution time, and a second task tower for predicting task undertaking parameters; A sample acquisition unit is used to acquire a training sample set, which includes multiple training samples. Each training sample includes task-related information of the sample task, the task execution time of the sample task, and the task undertaking parameters of the task execution object. The task undertaking parameters are used to characterize the number of tasks that the task execution object has undertaken but not completed. The first training unit is configured to determine the input vector of the initial model based on the relevant information of each task, and input the input vector into the first expert network to determine the first task embedding dense vector, into the second expert network to determine the shared embedding dense vector, and into the third expert network to determine the second task embedding dense vector. The second training unit is used to perform a weighted summation of the first task embedding dense vector and the shared embedding dense vector to determine the first task hybrid vector, wherein the weights of the weighted summation are determined by the first gating network based on the input vector; The third training unit is used to perform a weighted summation of the second task embedding dense vector and the shared embedding dense vector to determine the second task hybrid vector, wherein the weights of the weighted summation are determined by the second gating network based on the input vector; The fourth training unit is used to input the first task mixing vector into the first task tower to determine the execution time prediction value; The fifth training unit is used to input the second task mixing vector into the second task tower to determine the predicted values ​​of the undertaking parameters; The sixth training unit is used to calculate the multi-task joint loss based on the predicted execution time and the predicted task parameters, as well as the task execution time and the task task parameters. The seventh training unit is used to train the initial model based on the multi-task joint loss to obtain a data prediction model; The task-related information includes provider information, which includes object information of each execution object within a predetermined geographical range, where the predetermined geographical range is the geographical range where the provider is located.

11. An electronic device comprising a memory and a processor, characterized in that, The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-9.

13. A computer program product, characterized in that, The computer program product includes a computer program / instruction that, when executed by a processor, implements the method as described in any one of claims 1-9.