Task unloading method and device, equipment and storage medium
By building a deep neural network model based on meta-learning and combining it with pruning and quantization technology, the dynamic adaptability problem of task offloading strategy in serverless computing environment is solved, the optimal offloading of tasks and delay minimization are achieved, and the computing efficiency and response speed of edge servers are improved.
Patent Information
- Application Number
- CN202510948505.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-10-10
AI Technical Summary
Traditional task offloading strategies are difficult to adapt to the dynamically changing wireless edge networks in serverless computing environments, resulting in network congestion and computing delays. In addition, a single offloading strategy is difficult to meet the needs of diverse application scenarios.
By building a deep neural network model based on meta-learning, combined with pruning and quantization techniques, the initial network model is trained, and the offloading decision model is fine-tuned in the target task scenario to generate the optimal offloading decision and dynamically select how the task is processed on the edge server or serverless platform.
It achieves optimal offloading of tasks and minimization of delays in a serverless computing environment, improves the resource utilization efficiency and task response speed of edge servers, and adapts to the needs of diverse application scenarios.
Smart Images

Figure CN120762779A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of edge computing technology, and in particular to a task offloading method, apparatus, device and storage medium. Background Art
[0002] With the rapid development of wireless communications and cloud computing technologies, an increasing number of application scenarios require processing large amounts of data in complex network environments. Serverless computing and wireless edge computing are becoming important means to achieve efficient computing and low-latency responses. In this context, serverless computing environments dynamically allocate computing resources to support massive user requests, thereby avoiding the resource waste and management burden of traditional server architectures. Traditional task offloading strategies, often based on fixed network architectures and static resource allocation, struggle to adapt to the dynamic environment of wireless edge networks. Especially in situations with high device density, resource contention and channel fluctuations can lead to severe network congestion and computing delays, directly impacting task processing efficiency and user experience. Furthermore, due to the diverse nature of tasks and computing requirements, a single offloading strategy is unable to meet the needs of diverse application scenarios. Furthermore, wireless edge networks are plagued by issues such as channel instability and uneven network load.
[0003] In summary, how to achieve optimal task offloading and latency minimization in a serverless computing environment is a technical problem that needs to be solved urgently. Summary of the Invention
[0004] In view of this, the present invention aims to provide a task offloading method, apparatus, device, and storage medium that can achieve optimal task offloading and latency minimization in a serverless computing environment. The specific solution is as follows:
[0005] In a first aspect, the present application provides a task offloading method, comprising:
[0006] Acquire historical data samples corresponding to several historical task scenarios, and construct a first target data set based on each of the historical data samples; the historical data samples include real-time performance indicators, wireless channel status, and offloading decision labels of the target serverless platform;
[0007] Using a preset meta-learning method and the first target data set to minimize mean square error loss, a deep neural network model is trained to obtain a corresponding initial network model; and the initial network model is compressed based on a preset pruning technique and a preset quantization technique to obtain a corresponding target network model;
[0008] Creating an initial offloading decision model corresponding to a target task scenario according to the target network model, and fine-tuning the initial offloading decision model based on a second target data set corresponding to the target task scenario by minimizing mean square error loss to obtain a target offloading decision model;
[0009] An offloading decision corresponding to a target computing task in a target edge server is generated based on the target offloading decision model, and the target computing task is offloaded from the target edge server to a target computing node of the target serverless platform based on the offloading decision.
[0010] Optionally, the task scenario includes several computing tasks and weights corresponding to the computing tasks; wherein the computing tasks are tasks performed by each of the target edge servers within a preset time period, and the weights are weights determined based on a preset discrete weight set.
[0011] Optionally, the step of training a deep neural network model to obtain a corresponding initial network model based on a preset meta-learning method and the first target dataset by minimizing the mean square error loss includes:
[0012] Randomly extracting a target historical data sample from the first target data set, and determining a target output result corresponding to the target historical data sample based on the deep neural network model;
[0013] Determine a target loss value between the target output result and the target unloading decision label corresponding to the target historical data sample based on a preset mean square error loss function, and determine a first target gradient based on a preset back propagation algorithm and the target loss value;
[0014] Based on the preset gradient descent algorithm and the first target gradient, the parameters of the deep neural network model are updated, and the process jumps to the step of randomly extracting target historical data samples from the first target data set until the corresponding initial network model is obtained based on the preset meta-learning method and the updated deep neural network model by minimizing the mean square error loss or the preset number of iterations.
[0015] Optionally, the compressing the initial network model based on a preset pruning technology and a preset quantization technology to obtain a corresponding target network model includes:
[0016] Determining the importance of each weight based on the weight of each parameter in the initial network model and the gradient corresponding to the weight, and determining a target weight threshold based on a preset pruning ratio condition and the importance of each weight;
[0017] Determining the weight that is higher than the target weight threshold as a target weight, and determining a target parameter in the initial network model based on the target weight;
[0018] Pruning the initial network model according to the target parameters and the preset pruning technology, and fine-tuning the pruned initial network model based on the first target data set to obtain a model to be quantized;
[0019] The weights of the model to be quantized are converted into target integers based on preset data type conditions, so as to compress the model to be quantized to obtain the corresponding target network model.
[0020] Optionally, creating an initial offloading decision model corresponding to a target task scenario according to the target network model, and fine-tuning the initial offloading decision model based on a second target data set corresponding to the target task scenario by minimizing mean square error loss to obtain a target offloading decision model includes:
[0021] Creating the initial offloading decision model corresponding to the target task scenario according to the parameters corresponding to the target network model, and randomly extracting target data samples from the second target data set;
[0022] The initial offloading decision model is fine-tuned based on the target data sample by minimizing the mean square error loss. During the fine-tuning of the initial offloading decision model, the parameters of the target feature extraction layer corresponding to the initial offloading decision model are controlled to remain unchanged, and the target parameter layer corresponding to the initial offloading decision model is fine-tuned.
[0023] Optionally, the task offloading method further includes:
[0024] Determining an updated task scenario based on the historical task scenario and the target task scenario, and determining a target cosine similarity between the two task scenarios based on a target real-time performance indicator corresponding to each task scenario in the updated task scenario;
[0025] Determining a target similarity matrix corresponding to the updated task scenario based on the target cosine similarity, and dividing the updated task scenario according to a preset hierarchical clustering algorithm, a preset quantity condition, and the target similarity matrix to obtain clusters corresponding to the updated task scenario;
[0026] Constructing a target joint loss function according to a preset weighted mean square error and an L1 regularization term, and randomly extracting a target cluster from the clusters to determine a target joint loss value corresponding to the target cluster based on the target joint loss function;
[0027] Determining a second target gradient corresponding to each parameter in the target network model based on the target joint loss value, and determining a weight of each task scenario in the target cluster;
[0028] Based on the preset gradient descent algorithm, the weight and the second target gradient, the parameters in the target network model are updated to obtain the updated target network model, and the process jumps to the step of randomly extracting the target cluster from the cluster until the updated target network model meets the preset convergence condition, thereby obtaining the optimized target network model, so as to create the initial unloading decision model based on the optimized target network model.
[0029] Optionally, the task offloading method further includes:
[0030] Determining a transmission channel bandwidth and a target transmit power between the target edge server and the target serverless platform, and determining a second target data size of a target computing result corresponding to the target computing task;
[0031] Determine an uplink transmission delay based on a first target data size of the target computing task, the target transmit power, and the transmission channel bandwidth, and determine a downlink transmission delay based on the second target data size, the target transmit power, and the transmission channel bandwidth;
[0032] Determining the number of machine cycles required to complete the target computing task and determining a target execution rate for the target computing task;
[0033] Determining a target cold start delay corresponding to the target computing task based on a preset micro-indicator function and a preset cold start delay, and determining a computing delay corresponding to the target computing task based on the number of machine cycles, the target execution rate, and the target cold start delay;
[0034] The communication delay corresponding to the target computing task is determined based on the uplink transmission delay and the downlink transmission delay, and the target total delay is determined based on the communication delay and the computing delay, so as to evaluate the offloading decision corresponding to the target computing task based on the target total delay.
[0035] In a second aspect, the present application provides a task offloading device, comprising:
[0036] A first target data set construction module is configured to obtain historical data samples corresponding to a plurality of historical task scenarios and construct a first target data set based on each of the historical data samples; the historical data samples include real-time performance indicators, wireless channel status, and offload decision labels of the target serverless platform;
[0037] a target network model determination module, configured to train a deep neural network model based on a preset meta-learning method and the first target data set using a minimum mean square error loss to obtain a corresponding initial network model; and to compress the initial network model based on a preset pruning technique and a preset quantization technique to obtain a corresponding target network model;
[0038] a target offloading decision model determination module, configured to create an initial offloading decision model corresponding to a target task scenario according to the target network model, and fine-tune the initial offloading decision model based on a second target data set corresponding to the target task scenario by minimizing mean square error loss to obtain a target offloading decision model;
[0039] The target computing task offloading module is used to generate an offloading decision corresponding to the target computing task in the target edge server based on the target offloading decision model, and offload the target computing task from the target edge server to the target computing node of the target serverless platform based on the offloading decision.
[0040] In a third aspect, the present application provides an electronic device, comprising:
[0041] Memory, used to store computer programs;
[0042] The processor is used to execute the computer program to implement the aforementioned task offloading method.
[0043] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned task offloading method is implemented.
[0044] In the present application, first, a plurality of historical data samples corresponding to historical task scenarios are acquired, and a first target data set is constructed based on each of the historical data samples; the historical data samples include real-time performance indicators of a target serverless platform, wireless channel states, and offloading decision labels; then, an initial network model is obtained by training a deep neural network model based on a preset meta-learning method and the first target data set using a least mean square error loss; and the initial network model is compressed to obtain a target network model based on a preset pruning technique and a preset quantization technique; then, an initial offloading decision model corresponding to a target task scenario is created according to the target network model, and the initial offloading decision model is fine-tuned to obtain a target offloading decision model based on a second target data set corresponding to the target task scenario using a least mean square error loss; finally, an offloading decision corresponding to a target computing task in a target edge server is generated based on the target offloading decision model, and the target computing task is offloaded from the target edge server to a target computing node of the target serverless platform based on the offloading decision. As can be seen from the above, in the present application, a first target data set is generated based on historical data samples of historical task scenarios, and an initial network model is constructed according to the first target data set, then the initial network model is compressed to obtain a target network model based on a preset pruning technique and a preset quantization technique, then an initial offloading decision model corresponding to a target task scenario is created based on a preset meta-learning method and the target network model, then the initial offloading decision model is fine-tuned to obtain a target offloading decision model, and an offloading decision corresponding to a target computing task is generated using the target offloading decision model, so as to offload the target computing task based on the offloading decision. In this way, meta-learning enables the target network model to have high generalization ability after initial training, and can quickly adapt to new task scenarios through fine-tuning of a small number of samples, thereby providing an efficient and low-computing-cost offloading decision for an edge server. At the same time, the present application can flexibly select local processing or offloading to a serverless platform for a computing task by monitoring real-time performance indicators and channel states of the serverless platform in real time, ensuring efficient allocation of resources and fast response of tasks in a high-concurrency scenario. In this way, the present application can maximize the reduction of task processing delay of an edge server without increasing network burden, and achieve optimal offloading and delay minimization of tasks in a serverless computing environment. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, brief descriptions will be given below for the drawings needed to be used in the embodiments or prior art descriptions. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of the provided drawings.
[0046] Figure 1A task offloading method flowchart provided for the present application;
[0047] Figure 2 A specific task offloading method flowchart provided for the present application;
[0048] Figure 3 A task offloading device structure schematic diagram provided for the present application;
[0049] Figure 4 An electronic device structure diagram provided for the present application. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.
[0051] With the rapid development of wireless communication and cloud computing technologies, more and more application scenarios need to process a large amount of data in complex network environments, and serverless computing and wireless edge computing are gradually becoming important means to realize efficient computing and low-latency response. In this context, serverless computing environments support massive user requests by dynamically allocating computing resources, thereby avoiding resource waste and management burden in traditional server architectures. Traditional task offloading strategies are usually based on fixed network architectures and static resource allocation, which are difficult to adapt to the dynamically changing environment in wireless edge networks. Especially in the case of high-density device access, resource contention and channel fluctuations can cause serious network congestion and computing delay, directly affecting the processing efficiency of tasks and user experience. At the same time, due to the differences in task characteristics and computing requirements, a single offloading strategy cannot meet the needs of diversified application scenarios, and in wireless edge networks, there are problems such as unstable channels and uneven network load. Therefore, the present application provides a task offloading scheme that can achieve optimal task offloading and delay minimization in a serverless computing environment.
[0052] Referring to Figure 1 The embodiments of the present application disclose a task offloading method, which can include:
[0053] Step S11, obtaining a plurality of historical data samples corresponding to historical task scenarios, and constructing a first target data set based on each historical data sample; the historical data sample includes real-time performance indicators of a target serverless platform, wireless channel state and offloading decision labels.
[0054] In this embodiment, consider a wireless edge network containing a first target dataset of different serverless task scenarios each task scenario contains data samples, denoted as wherein, is a wireless channel state, is a real-time performance indicator of the serverless platform, is an offloading decision label. In this embodiment, the task scenario includes a plurality of computing tasks and weights corresponding to the computing tasks; wherein the computing task is a task executed by each target edge server within a preset time period, and the weight is a weight determined based on a preset discrete weight set. Specifically, in this embodiment, a network composed of a plurality of distributed computing nodes and N edge servers is considered, denoted as Each edge server needs to perform a prioritized computing task at time t, and the weight corresponding to the computing task is According to the specific task category, the weight value is adjusted in a discrete set W. The set composed of the computing tasks of all edge servers and the unique weights corresponding to the computing tasks is defined as a task scenario, denoted as .
[0055] It should be noted that in order to achieve optimal allocation of computing resources and minimize delay, each computing task can be selected to be offloaded to a dynamically allocated computing node for execution, or processed locally on the device. Denote as the offloading decision corresponding to the computing task at time t, wherein, indicates that the edge server n offloads its computing task to a dynamic computing node, and indicates that the computing task is executed locally by the edge server. In a serverless environment, this offloading decision can be adjusted in real time according to the load and available resources of the node.
[0056] Step S12, training a deep neural network model based on a preset meta-learning method and the first target dataset using a minimum mean square error loss to obtain a corresponding initial network model; and compressing the initial network model based on a preset pruning technique and a preset quantization technique to obtain a corresponding target network model.
[0057] In this embodiment, a meta-learning-based efficient task offloading algorithm (EQLO) can be used to achieve efficient task offloading decisions through pruning and quantization techniques and a small number of training samples. The above-mentioned method of training a deep neural network model to obtain a corresponding initial network model based on a preset meta-learning method and the first target dataset using the minimum mean square error loss can include: first randomly extracting a target historical data sample from the first target dataset, and determining the target output result corresponding to the target historical data sample based on the deep neural network model; then determining the target loss value between the target output result and the target offloading decision label corresponding to the target historical data sample based on a preset mean square error loss function, and determining a first target gradient based on a preset backpropagation algorithm and the target loss value; finally, updating the parameters of the deep neural network model based on a preset gradient descent algorithm and the first target gradient, and jumping to the step of randomly extracting a target historical data sample from the first target dataset, until the corresponding initial network model is obtained based on the preset meta-learning method and the updated deep neural network model using the minimum mean square error loss or a preset number of iterations. Specifically, a target historical data sample is first randomly extracted from the first target dataset. This historical data sample is then used to train and fine-tune the deep neural network model by minimizing the mean squared error loss. During the model training and fine-tuning process, the model parameters are gradually updated according to a preset gradient descent algorithm and the first target gradient until the model's mean squared error loss converges or the set number of training rounds is reached, resulting in the initial network model.
[0058] It should be noted that the above-mentioned compression processing of the initial network model based on the preset pruning technology and the preset quantization technology to obtain the corresponding target network model may include: first, determining the importance of each weight based on the weight of each parameter in the initial network model and the gradient corresponding to the weight, and determining the target weight threshold based on the preset pruning ratio condition and the importance of each weight; then determining the weight higher than the target weight threshold as the target weight, and determining the target parameter in the initial network model based on the target weight; then pruning the initial network model according to the target parameter and the preset pruning technology, and fine-tuning the pruned initial network model based on the first target data set to obtain the model to be quantized; finally, converting the weight of the model to be quantized into a target integer based on the preset data type condition, so as to compress the model to be quantized to obtain the corresponding target network model. Specifically, in this embodiment, the importance of the weight is determined in combination with the absolute value of the weight of each parameter and the absolute value of the gradient corresponding to the weight, and the weight The importance of can be expressed as:
[0059] ;
[0060] in, Represents the weight of the parameter The importance of The loss function L is the weight The absolute value of the partial derivative of .
[0061] In this embodiment, in order to avoid the uncertainty caused by setting a fixed threshold, the target weight threshold can be set based on the importance of the weight by using the pruning ratio method. , is the critical point of the absolute value of the weight, and the formula is as follows:
[0062] ;
[0063] After all the following The weights of The weight is determined as the target weight to obtain the target parameter in the initial network model corresponding to the target weight , and then fine-tune the pruned initial network model using the first target dataset to maintain the generalization ability of the model:
[0064] ;
[0065] in, is the model parameter after pruning The parameter set obtained after fine-tuning, is the learning rate, which is a hyperparameter used to control the step size of each parameter update. Express Find the gradient, that is, calculate the loss function L with respect to The gradient vector of The model parameters are The output of the model at this time. During fine-tuning, continuously monitor the performance changes of the model on the validation set. If the performance is close to the original model, stop fine-tuning; otherwise, adjust the learning rate or fine-tuning step appropriately. After pruning and fine-tuning, to reduce memory usage and computational burden, the model to be quantized can be compressed by converting the weights from 32-bit floating point numbers to 8-bit integers. The quantization formula is as follows:
[0066] ;
[0067] Where z is the zero point correction value used to align floating point and integer representations, and The minimum and maximum weight values of the model parameters are rounded off by rounding. In order to ensure the computational efficiency during inference, the activation value of the model can also be quantized. The target network model obtained after quantization is then Deployed in a serverless environment, pruning removes low-importance connections and quantizing weights from floating-point numbers to integers, significantly reducing the computational burden of decision-making in serverless edge environments and accelerating task response.
[0068] Step S13: creating an initial offloading decision model corresponding to a target task scenario according to the target network model, and fine-tuning the initial offloading decision model based on a second target data set corresponding to the target task scenario by minimizing mean square error loss to obtain a target offloading decision model.
[0069] In this embodiment, the above-mentioned creation of the initial uninstallation decision model corresponding to the target task scenario based on the target network model, and using the minimized mean square error loss to fine-tune the initial uninstallation decision model based on the second target data set corresponding to the target task scenario to obtain the target uninstallation decision model, may include: first creating the initial uninstallation decision model corresponding to the target task scenario based on the parameters corresponding to the target network model, and randomly extracting target data samples from the second target data set; then using the minimized mean square error loss to fine-tune the initial uninstallation decision model based on the target data samples, and in the process of fine-tuning the initial uninstallation decision model, controlling the parameters of the target feature extraction layer corresponding to the initial uninstallation decision model to remain unchanged, and fine-tuning the target parameter layer corresponding to the initial uninstallation decision model. It can be understood that when there is a new serverless task scenario , that is, when the target task scenario appears, a corresponding initial offloading decision model can be created based on the target network model, and the model can be fine-tuned to obtain the target offloading decision model. Specifically, the model corresponding to the task scenario is first initialized using the parameters of the target network model:
[0070] ;
[0071] in, are the parameters of the target network model, are the parameters of the initial offloading decision model corresponding to the new task scenario. Then, we randomly extract target data samples from the second target dataset corresponding to the new task scenario and fine-tune the initial offloading decision model based on the target data samples by minimizing the mean squared error loss. We keep the parameters of the general feature extraction layer of the model unchanged and only fine-tune the parameter layer related to the task. The formula is as follows:
[0072] ;
[0073] in, For task-related parameters After fine-tuning the parameters, The parameter rate for fine-tuning the initial offloading decision model, is the loss function Task-related parameters The gradient of . In this embodiment, the model is optimized by minimizing the mean square error loss, and the formula is as follows:
[0074] ;
[0075] Where N represents the number of target data samples randomly selected from the second target data set, represents the square of the L2 norm of the vector, The model parameters are The output of the model is is the unloading decision label corresponding to the k-th sample.
[0076] It is understandable that since the initial offloading decision model is the target network model after pruning and quantization, the computational overhead is greatly reduced, so that in a serverless environment, the initial offloading decision model can obtain the target offloading decision model after a small number of training steps, thereby quickly adapting to new task scenarios.
[0077] Step S14: Generate an offloading decision corresponding to the target computing task in the target edge server based on the target offloading decision model, and offload the target computing task from the target edge server to the target computing node of the target serverless platform based on the offloading decision.
[0078] In this embodiment, an offloading strategy is designed based on minimizing the weighted total delay Q , through the uninstall policy Ability to efficiently generate optimal offloading decisions , which can be expressed as:
[0079] ;
[0080] in, represents the optimal unloading decision at time t, Indicates that the system state at time t Mapping to optimal offloading decision .
[0081] In this embodiment, in order to determine the total delay between the edge server and the serverless platform when the computing task is directly offloaded to the computing node, the transmission channel bandwidth and the target transmission power between the target edge server and the target serverless platform are first determined, and the second target data size of the target computing result corresponding to the target computing task is determined; then, the uplink transmission delay is determined based on the first target data size of the target computing task, the target transmission power and the transmission channel bandwidth, and the downlink transmission delay is determined based on the second target data size, the target transmission power and the transmission channel bandwidth; then, the number of machine cycles corresponding to the target computing task is determined, and the target execution rate corresponding to the target computing task is determined; then, the target cold start delay corresponding to the target computing task is determined based on the preset micro-indicator function and the preset cold start delay, and the computing delay corresponding to the target computing task is determined based on the number of machine cycles, the target execution rate and the target cold start delay; finally, the communication delay corresponding to the target computing task is determined based on the uplink transmission delay and the downlink transmission delay, and the target total delay is determined based on the communication delay and the computing delay, so as to evaluate the offloading decision corresponding to the target computing task based on the target total delay. In a specific embodiment, a triple is used To represent the target computing task of edge server n, where Indicates the size of the input data of the target computing task, Indicates the data size of the result returned from the serverless computing node. Indicates the number of CPU cycles required to complete the target computing task. When edge server n uploads the target computing task to the serverless platform, the serverless platform automatically allocates bandwidth and computing nodes for the target computing task. The communication rate formula between edge server n and the serverless platform is:
[0082] ;
[0083] ;
[0084] in, is the communication rate when uploading data, is the communication rate when data is returned, is the transmission channel bandwidth between the edge server n and the computing nodes of the serverless platform, is the transmission power of edge server n used to offload the target computing task, and is also the transmission power when the computing node returns the computing result to edge server n. is the background noise power, is the corresponding channel gain. Definition , N is each edge server, assuming Its value remains unchanged during the transmission of the target computing task. Then, the total communication delay can be expressed as the sum of the upstream and downstream transmission delays as shown below:
[0085] ;
[0086] in, Indicates the size of the input data of the target computing task, Indicates the data size of the result returned from the serverless compute node.
[0087] It should be noted that in this embodiment, a high-frequency task is split into multiple target computing tasks and uploaded to the computing node for processing. The computing node only executes the split target computing tasks, ensuring a fast response and reducing the impact of cold starts. The serverless platform independently allocates resources for each target computing task and automatically adjusts the number of nodes and execution rate according to the load without user intervention. By splitting the tasks, the dependence of long-term tasks on cold starts can be reduced. The computational delay of the target computing task of edge server n can be expressed as:
[0088] ;
[0089] in, Indicates the number of CPU cycles required to complete the target computing task, Calculate the execution rate of tasks for the current target, To reduce the impact of cold start delay, the serverless platform will preheat some computing nodes when it detects high-frequency tasks. ; If the node is in cold start state, there will be an additional startup delay, A micro-indicator function is used to indicate whether a computing node is in a warm-up state or a cold-start state. Thus, the node warm-up mechanism of this embodiment effectively reduces the initial delay caused by cold-start when handling frequent tasks, ensuring rapid response of device task processing in high-concurrency situations.
[0090] Therefore, the total latency of edge server n is It can be expressed as the sum of total communication delay and computation delay as follows:
[0091] ;
[0092] .
[0093] In a specific embodiment, it is assumed that there are multiple drones N in a monitoring area, each of which is equipped with a camera for real-time image capture and identification of abnormal targets in a designated area, such as fire, illegal entry, etc., wherein: Due to the limited computing power of drones, the image recognition task of drones can be offloaded to the computing nodes of the serverless platform or completed locally on the drone. In a serverless environment, the importance of the drone's image recognition task is different, with weights Evaluation priority, weight set Each UAV task needs to generate an offloading decision at each time point to decide whether to offload the image processing task to the computing node. First, determine the total delay when offloading the UAV task directly to the computing node. Assuming that the bandwidth of each UAV transmission channel is , background noise power UAV transmission power , the channel gain varies with distance. When the channel gain .
[0094] Calculate the upload rate using the formula:
[0095] ;
[0096] Assuming the image data size , return data , then the total communication delay is:
[0097] ;
[0098] Set the execution rate of the drone mission , task CPU cycles , then the calculated delay is:
[0099] ;
[0100] The total delay is determined based on the communication delay and the computation delay:
[0101] ;
[0102] Next, the model was considered for generating offloading decisions corresponding to UAV tasks. In the training data, five task scenarios under different channel conditions and task priorities were considered. Pruning and quantization techniques were then used to train a target network model to adapt to dynamic task scenarios and reduce model complexity. If a change in the UAV task priority was detected—for example, an increase in the weight corresponding to a fire image captured by a certain UAV—an initial offloading decision model was created based on the target network model. The parameters of the initial offloading decision model were updated using the current scenario data to obtain a target offloading decision model to quickly adapt to the new priority task. In this way, by utilizing the target offloading decision model, dynamic optimization of task offloading and computation can be achieved within 2 seconds, effectively balancing task priority and resource allocation. This not only meets the needs of real-time tasks, but also reduces computational and communication delays and improves the efficiency of UAV computing resource utilization.
[0103] As can be seen from the above, in this embodiment, historical data samples corresponding to several historical task scenarios are first obtained, and a first target data set is constructed based on each of the historical data samples; the historical data samples include real-time performance indicators, wireless channel status and unloading decision labels of the target serverless platform; then, the deep neural network model is trained based on the preset meta-learning method and the first target data set using the minimum mean square error loss to obtain the corresponding initial network model; and the initial network model is compressed based on the preset pruning technology and the preset quantization technology to obtain the corresponding target network model; then, an initial unloading decision model corresponding to the target task scenario is created according to the target network model, and the initial unloading decision model is fine-tuned based on the second target data set corresponding to the target task scenario using the minimum mean square error loss to obtain the target unloading decision model; finally, an unloading decision corresponding to the target computing task in the target edge server is generated based on the target unloading decision model, and the target computing task is unloaded from the target edge server to the target computing node of the target serverless platform based on the unloading decision. As can be seen from the above, in this embodiment, a first target dataset is first generated based on historical data samples of historical task scenarios, and an initial network model is constructed based on the first target dataset. Then, the initial network model is compressed based on a preset pruning technique and a preset quantization technique to obtain a target network model. Then, an initial offloading decision model corresponding to the target task scenario is created based on a preset meta-learning method and the target network model. Then, the initial offloading decision model is fine-tuned to obtain a target offloading decision model, and the target offloading decision model is used to generate an offloading decision corresponding to the target computing task, so as to offload the target computing task based on the offloading decision. In this way, meta-learning enables the target network model to have high generalization ability after initial training. It can quickly adapt to new task scenarios through fine-tuning with a small amount of samples, thereby providing efficient and low-computational cost offloading decisions for the edge server. At the same time, this embodiment can flexibly select computing tasks to be processed locally on the edge server or offloaded to the serverless platform by real-time monitoring of the real-time performance indicators and channel status of the serverless platform, ensuring that efficient resource allocation and rapid task response can still be maintained in high-concurrency scenarios. In this way, this embodiment can minimize the task processing delay of the edge server without increasing the network burden, achieving optimal offloading and delay minimization of tasks in a serverless computing environment.
[0104] See also Figure 2 As shown, in order to ensure the generalization ability and adaptability of the target network model in different task scenarios, the embodiment of the present invention further discloses a task offloading method, which may include:
[0105] Step S21: Acquire historical data samples corresponding to several historical task scenarios, and construct a first target data set based on each of the historical data samples; the historical data samples include real-time performance indicators, wireless channel status, and offloading decision labels of the target serverless platform.
[0106] Step S22: Using the preset meta-learning method and the first target data set to minimize the mean square error loss, the deep neural network model is trained to obtain a corresponding initial network model; and the initial network model is compressed based on the preset pruning technology and the preset quantization technology to obtain a corresponding target network model.
[0107] Step S23: creating an initial offloading decision model corresponding to a target task scenario according to the target network model, and fine-tuning the initial offloading decision model based on a second target data set corresponding to the target task scenario by minimizing mean square error loss to obtain a target offloading decision model.
[0108] In this embodiment, when a new task scenario appears, the target network model can be quickly fine-tuned based on the new task scenario to achieve efficient unloading decisions. First, the updated task scenario is determined based on the historical task scenario and the target task scenario, and the target cosine similarity between the two task scenarios is determined based on the target real-time performance indicators corresponding to each task scenario in the updated task scenario; then, the target similarity matrix corresponding to the updated task scenario is determined based on the target cosine similarity, and the updated task scenario is divided according to a preset hierarchical clustering algorithm, a preset quantity condition and the target similarity matrix to obtain clusters corresponding to the updated task scenario; then, a target joint loss function is constructed according to a preset weighted mean square error and an L1 regularization term, and a target cluster is randomly extracted from the cluster to obtain a cluster based on the target joint loss function. The loss function determines the target joint loss value corresponding to the target cluster; then, based on the target joint loss value, the second target gradient corresponding to each parameter in the target network model is determined, and the weight of each task scenario in the target cluster is determined; finally, based on the preset gradient descent algorithm, the weight and the second target gradient, the parameters in the target network model are updated to obtain the updated target network model, and jump to the step of randomly extracting the target cluster from the cluster until the updated target network model meets the preset convergence condition, and the optimized target network model is obtained, so as to create the initial unloading decision model based on the optimized target network model. Specifically, two task scenarios are calculated based on the target real-time performance indicators corresponding to the updated task scenarios. The cosine similarity between:
[0109] ;
[0110] in, For mission scenarios The corresponding real-time performance indicators of the serverless platform, For mission scenarios The corresponding real-time performance indicators of the serverless platform are indexed by k.
[0111] Then, based on the cosine similarity, the target similarity matrix corresponding to the updated task scenario is determined. Based on the target similarity matrix, hierarchical clustering is performed to divide the task scenario into C clusters, and the cluster to which each task scenario belongs is obtained. During the optimization process, a target cluster is randomly selected in each training round. , and determine the target joint loss value of the target cluster based on the target joint loss function. The target joint loss function is as follows:
[0112] ;
[0113] in, is the L1 norm of the weights, which is used to control the sparsity of the model. The model parameters are The output of the model. is the unloading decision label corresponding to the k-th sample. For clusters Then, based on the target joint loss value of the target cluster, the gradient corresponding to each parameter in the target network model is calculated and the model parameters are updated:
[0114] ;
[0115] in, The learning rate determines the magnitude of the parameter change each time the parameter is updated according to the gradient. , exp is the exponential function, Real-time performance metrics for serverless platforms The variance of . is the target joint loss function The gradient with respect to the model parameters is obtained by For clusters The task scenarios in are indexed. is the weight of the task scenario, which can be adjusted according to the complexity of the task scenario. During the training process, the above steps are repeated to continue updating the target network model until the performance of the target network model converges.
[0116] Step S24: Generate an offloading decision corresponding to the target computing task in the target edge server based on the target offloading decision model, and offload the target computing task from the target edge server to the target computing node of the target serverless platform based on the offloading decision.
[0117] For more specific processing procedures of the above steps S21, S22 and S24, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0118] As can be seen from the above, in this embodiment, the updated task scenario is first determined based on the historical task scenario and the target task scenario, and then the target cosine similarity between the two task scenarios is determined, and the target similarity matrix is determined based on each target cosine similarity, and then the updated task scenario is divided based on the preset hierarchical clustering algorithm and the target similarity matrix to obtain each cluster, and the target cluster is randomly extracted from the cluster, and the target joint loss value corresponding to the target cluster is determined based on the target joint loss function, and the parameters in the target network model are updated based on the preset gradient descent algorithm, the target joint loss value and the weight of each task scenario, until the updated target network model meets the preset convergence condition, and the optimized target network model is obtained. In this way, the target network model can be continuously optimized based on the new task scenario in this application, thereby ensuring the generalization ability and adaptability of the target network model in different task scenarios.
[0119] Accordingly, see Figure 3 As shown, the embodiment of the present application further provides a task offloading device, which may include:
[0120] A first target data set construction module 11 is configured to obtain historical data samples corresponding to a plurality of historical task scenarios and construct a first target data set based on each of the historical data samples; the historical data samples include real-time performance indicators, wireless channel status, and offload decision labels of the target serverless platform;
[0121] A target network model determination module 12 is configured to train a deep neural network model based on a preset meta-learning method and the first target data set using a minimum mean square error loss to obtain a corresponding initial network model; and to compress the initial network model based on a preset pruning technique and a preset quantization technique to obtain a corresponding target network model;
[0122] a target offloading decision model determination module 13, configured to create an initial offloading decision model corresponding to a target task scenario according to the target network model, and fine-tune the initial offloading decision model based on a second target data set corresponding to the target task scenario by minimizing mean square error loss to obtain a target offloading decision model;
[0123] The target computing task unloading module 14 is used to generate an unloading decision corresponding to the target computing task in the target edge server based on the target unloading decision model, and unload the target computing task from the target edge server to the target computing node of the target serverless platform based on the unloading decision.
[0124] As can be seen from the above, in this application, historical data samples corresponding to several historical task scenarios are first obtained, and a first target data set is constructed based on each of the historical data samples; the historical data samples include real-time performance indicators, wireless channel status and unloading decision labels of the target serverless platform; then, the deep neural network model is trained based on the preset meta-learning method and the first target data set using the minimum mean square error loss to obtain the corresponding initial network model; and the initial network model is compressed based on the preset pruning technology and the preset quantization technology to obtain the corresponding target network model; then, an initial unloading decision model corresponding to the target task scenario is created according to the target network model, and the initial unloading decision model is fine-tuned based on the second target data set corresponding to the target task scenario using the minimum mean square error loss to obtain the target unloading decision model; finally, an unloading decision corresponding to the target computing task in the target edge server is generated based on the target unloading decision model, and the target computing task is unloaded from the target edge server to the target computing node of the target serverless platform based on the unloading decision. As can be seen from the above, in this application, a first target data set is first generated based on historical data samples of historical task scenarios, and an initial network model is constructed based on the first target data set. Then, the initial network model is compressed based on a preset pruning technology and a preset quantization technology to obtain a target network model. Then, an initial offloading decision model corresponding to the target task scenario is created based on a preset meta-learning method and the target network model. Then, the initial offloading decision model is fine-tuned to obtain a target offloading decision model, and the target offloading decision model is used to generate an offloading decision corresponding to the target computing task, so as to offload the target computing task based on the offloading decision. In this way, meta-learning enables the target network model to have high generalization ability after initial training, and can quickly adapt to new task scenarios through fine-tuning with a small amount of samples, thereby providing efficient and low-computing-cost offloading decisions for the edge server. At the same time, this application can flexibly select computing tasks to be processed locally on the edge server or offloaded to the serverless platform by real-time monitoring of the real-time performance indicators and channel status of the serverless platform, ensuring that efficient resource allocation and rapid task response can still be maintained in high-concurrency scenarios. In this way, this application can minimize the task processing delay of the edge server without increasing the network burden, and achieve optimal offloading and delay minimization of tasks in a serverless computing environment.
[0125] In some specific implementations, the task scenario includes several computing tasks and weights corresponding to the computing tasks; wherein the computing tasks are tasks performed by each of the target edge servers within a preset time period, and the weights are weights determined based on a preset discrete weight set.
[0126] In some specific implementations, the target network model determination module 12 may include:
[0127] a target output result determining unit, configured to randomly extract a target historical data sample from the first target data set, and determine a target output result corresponding to the target historical data sample based on the deep neural network model;
[0128] A first target gradient determining unit is configured to determine a target loss value between the target output result and the target unloading decision label corresponding to the target historical data sample based on a preset mean square error loss function, and determine a first target gradient based on a preset back propagation algorithm and the target loss value;
[0129] An initial network model determination unit is used to update the parameters of the deep neural network model based on a preset gradient descent algorithm and the first target gradient, and jump to the step of randomly extracting target historical data samples from the first target data set until the corresponding initial network model is obtained based on a preset meta-learning method and the updated deep neural network model by minimizing the mean square error loss or a preset number of iterations.
[0130] In some specific implementations, the target network model determination module 12 may include:
[0131] a target weight threshold determination unit, configured to determine the importance of each weight based on the weight of each parameter in the initial network model and the gradient corresponding to the weight, and to determine a target weight threshold based on a preset pruning ratio condition and the importance of each weight;
[0132] a target parameter determining unit, configured to determine the weight that is higher than the target weight threshold as a target weight, and determine a target parameter in the initial network model based on the target weight;
[0133] a model to be quantized determining unit, configured to prune the initial network model according to the target parameters and the preset pruning technique, and fine-tune the pruned initial network model based on the first target data set to obtain a model to be quantized;
[0134] The target network model determining unit is used to convert the weight of the model to be quantized into a target integer based on a preset data type condition, so as to compress the model to be quantized to obtain the corresponding target network model.
[0135] In some specific implementations, the target offloading decision model determination module 13 may include:
[0136] a target data sample determining unit, configured to create the initial offloading decision model corresponding to the target task scenario according to parameters corresponding to the target network model, and randomly extract target data samples from the second target data set;
[0137] The initial offloading decision model fine-tuning unit is used to fine-tune the initial offloading decision model based on the target data sample by minimizing the mean square error loss, and in the process of fine-tuning the initial offloading decision model, control the parameters of the target feature extraction layer corresponding to the initial offloading decision model to remain unchanged, and fine-tune the target parameter layer corresponding to the initial offloading decision model.
[0138] In some specific implementations, the task offloading device may further include:
[0139] a target cosine similarity determination module, configured to determine an updated task scenario based on the historical task scenario and the target task scenario, and determine a target cosine similarity between the two task scenarios based on the target real-time performance indicators corresponding to each task scenario in the updated task scenario;
[0140] A task scenario division module is used to determine a target similarity matrix corresponding to the updated task scenario based on the target cosine similarity, and divide the updated task scenario according to a preset hierarchical clustering algorithm, a preset quantity condition and the target similarity matrix to obtain clusters corresponding to the updated task scenario;
[0141] a target joint loss value determination module, configured to construct a target joint loss function according to a preset weighted mean square error and an L1 regularization term, and randomly extract a target cluster from the clusters to determine a target joint loss value corresponding to the target cluster based on the target joint loss function;
[0142] a second target gradient determination module, configured to determine a second target gradient corresponding to each parameter in the target network model based on the target joint loss value, and determine a weight of each task scenario in the target cluster;
[0143] A target network model optimization module is used to update the parameters in the target network model based on a preset gradient descent algorithm, the weight and the second target gradient to obtain an updated target network model, and jump to the step of randomly extracting a target cluster from the cluster until the updated target network model meets the preset convergence condition, thereby obtaining the optimized target network model, so as to create the initial unloading decision model based on the optimized target network model.
[0144] In some specific implementations, the task offloading device may further include:
[0145] a second target data size determination module, configured to determine a transmission channel bandwidth and a target transmit power between the target edge server and the target serverless platform, and determine a second target data size of a target calculation result corresponding to the target computing task;
[0146] a transmission delay determination module, configured to determine an uplink transmission delay based on a first target data size of the target computing task, the target transmit power, and the transmission channel bandwidth, and determine a downlink transmission delay based on the second target data size, the target transmit power, and the transmission channel bandwidth;
[0147] a target execution rate determination module, configured to determine the number of machine cycles required to complete the target computing task and determine a target execution rate corresponding to the target computing task;
[0148] a computing delay determining module, configured to determine a target cold start delay corresponding to the target computing task based on a preset micro-indicator function and a preset cold start delay, and to determine a computing delay corresponding to the target computing task based on the number of machine cycles, the target execution rate, and the target cold start delay;
[0149] An offloading decision evaluation module is used to determine the communication delay corresponding to the target computing task based on the uplink transmission delay and the downlink transmission delay, and to determine the target total delay based on the communication delay and the computing delay, so as to evaluate the offloading decision corresponding to the target computing task based on the target total delay.
[0150] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the task offloading method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0151] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0152] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0153] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of implementing the task offloading method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program capable of implementing other specific tasks.
[0154] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the task offloading method disclosed above is implemented. The specific steps of this method can be referred to the corresponding content disclosed in the aforementioned embodiments and will not be repeated here.
[0155] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0156] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0157] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0158] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0159] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A task offloading method, characterized in that: include: Acquire historical data samples corresponding to a plurality of historical task scenarios, and construct a first target data set based on each of the historical data samples; The historical data samples include real-time performance indicators, wireless channel status, and offloading decision labels of the target serverless platform; Using a preset meta-learning method and the first target data set to minimize mean square error loss, a deep neural network model is trained to obtain a corresponding initial network model; and the initial network model is compressed based on a preset pruning technique and a preset quantization technique to obtain a corresponding target network model; Creating an initial offloading decision model corresponding to a target task scenario according to the target network model, and fine-tuning the initial offloading decision model based on a second target data set corresponding to the target task scenario by minimizing mean square error loss to obtain a target offloading decision model; An offloading decision corresponding to a target computing task in a target edge server is generated based on the target offloading decision model, and the target computing task is offloaded from the target edge server to a target computing node of the target serverless platform based on the offloading decision.
2. The task offloading method according to claim 1, characterized in that: The task scenario includes several computing tasks and weights corresponding to the computing tasks; wherein the computing tasks are tasks performed by each of the target edge servers within a preset time period, and the weights are weights determined based on a preset discrete weight set.
3. The task offloading method according to claim 1, characterized in that: The method of minimizing the mean square error loss based on a preset meta-learning method and the first target data set to train a deep neural network model to obtain a corresponding initial network model includes: Randomly extracting a target historical data sample from the first target data set, and determining a target output result corresponding to the target historical data sample based on the deep neural network model; Determine a target loss value between the target output result and the target unloading decision label corresponding to the target historical data sample based on a preset mean square error loss function, and determine a first target gradient based on a preset back propagation algorithm and the target loss value; Based on the preset gradient descent algorithm and the first target gradient, the parameters of the deep neural network model are updated, and the process jumps to the step of randomly extracting target historical data samples from the first target data set until the corresponding initial network model is obtained based on the preset meta-learning method and the updated deep neural network model by minimizing the mean square error loss or the preset number of iterations.
4. The task offloading method according to claim 1, wherein: The compressing the initial network model based on the preset pruning technology and the preset quantization technology to obtain the corresponding target network model includes: Determining the importance of each weight based on the weight of each parameter in the initial network model and the gradient corresponding to the weight, and determining a target weight threshold based on a preset pruning ratio condition and the importance of each weight; Determining the weight that is higher than the target weight threshold as a target weight, and determining a target parameter in the initial network model based on the target weight; Pruning the initial network model according to the target parameters and the preset pruning technology, and fine-tuning the pruned initial network model based on the first target data set to obtain a model to be quantized; The weights of the model to be quantized are converted into target integers based on preset data type conditions, so as to compress the model to be quantized to obtain the corresponding target network model.
5. The task offloading method according to claim 1, characterized in that: The method of creating an initial offloading decision model corresponding to a target task scenario according to the target network model, and fine-tuning the initial offloading decision model based on a second target data set corresponding to the target task scenario by minimizing mean square error loss to obtain a target offloading decision model includes: Creating the initial offloading decision model corresponding to the target task scenario according to the parameters corresponding to the target network model, and randomly extracting target data samples from the second target data set; The initial offloading decision model is fine-tuned based on the target data sample by minimizing the mean square error loss. During the fine-tuning of the initial offloading decision model, the parameters of the target feature extraction layer corresponding to the initial offloading decision model are controlled to remain unchanged, and the target parameter layer corresponding to the initial offloading decision model is fine-tuned.
6. The task offloading method according to claim 1, characterized in that: Also includes: Determining an updated task scenario based on the historical task scenario and the target task scenario, and determining a target cosine similarity between the two task scenarios based on a target real-time performance indicator corresponding to each task scenario in the updated task scenario; Determining a target similarity matrix corresponding to the updated task scenario based on the target cosine similarity, and dividing the updated task scenario according to a preset hierarchical clustering algorithm, a preset quantity condition, and the target similarity matrix to obtain clusters corresponding to the updated task scenario; Constructing a target joint loss function according to a preset weighted mean square error and an L1 regularization term, and randomly extracting a target cluster from the clusters to determine a target joint loss value corresponding to the target cluster based on the target joint loss function; Determining a second target gradient corresponding to each parameter in the target network model based on the target joint loss value, and determining a weight of each task scenario in the target cluster; Based on the preset gradient descent algorithm, the weight and the second target gradient, the parameters in the target network model are updated to obtain the updated target network model, and the process jumps to the step of randomly extracting the target cluster from the cluster until the updated target network model meets the preset convergence condition, thereby obtaining the optimized target network model, so as to create the initial unloading decision model based on the optimized target network model.
7. The task offloading method according to any one of claims 1 to 6, characterized in that: Also includes: Determining a transmission channel bandwidth and a target transmit power between the target edge server and the target serverless platform, and determining a second target data size of a target computing result corresponding to the target computing task; Determine an uplink transmission delay based on a first target data size of the target computing task, the target transmit power, and the transmission channel bandwidth, and determine a downlink transmission delay based on the second target data size, the target transmit power, and the transmission channel bandwidth; Determining the number of machine cycles required to complete the target computing task and determining a target execution rate for the target computing task; Determining a target cold start delay corresponding to the target computing task based on a preset micro-indicator function and a preset cold start delay, and determining a computing delay corresponding to the target computing task based on the number of machine cycles, the target execution rate, and the target cold start delay; The communication delay corresponding to the target computing task is determined based on the uplink transmission delay and the downlink transmission delay, and the target total delay is determined based on the communication delay and the computing delay, so as to evaluate the offloading decision corresponding to the target computing task based on the target total delay.
8. A task offloading device, characterized in that: include: A first target data set construction module is configured to obtain historical data samples corresponding to a plurality of historical task scenarios and construct a first target data set based on each of the historical data samples; the historical data samples include real-time performance indicators, wireless channel status, and offload decision labels of the target serverless platform; A target network model determination module is used to train a deep neural network model to obtain a corresponding initial network model based on a preset meta-learning method and the first target data set by minimizing the mean square error loss; and compressing the initial network model based on a preset pruning technology and a preset quantization technology to obtain a corresponding target network model; a target offloading decision model determination module, configured to create an initial offloading decision model corresponding to a target task scenario according to the target network model, and fine-tune the initial offloading decision model based on a second target data set corresponding to the target task scenario by minimizing mean square error loss to obtain a target offloading decision model; The target computing task offloading module is used to generate an offloading decision corresponding to the target computing task in the target edge server based on the target offloading decision model, and offload the target computing task from the target edge server to the target computing node of the target serverless platform based on the offloading decision.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the task offloading method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that Used to store a computer program, which, when executed by a processor, implements the task offloading method according to any one of claims 1 to 7.