A task offloading method, system and storage medium based on task similarity
Through a task offload method based on task similarity, devices with the same task are connected to the same edge server, solving the problems of unreasonable resource allocation and inefficient task processing in the prior art, and achieving optimization of task processing and efficient utilization of resources.
Patent Information
- Application Number
- CN202510264933.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-03-07
AI Technical Summary
The prior art does not fully consider the specific characteristics of the task and the real-time load conditions of the edge computing nodes when making task offload decisions, resulting in unreasonable resource allocation and inefficient task processing.
Using a task similarity-based task offload method, optimize task processing and resource allocation by initializing the preference list of devices and edge servers, matching devices with the same task and connecting them to the same edge server.
It realizes the optimization of task processing and efficient utilization of resources, reduces unnecessary computing redundancy, reduces overall energy consumption, and improves user experience.
Smart Images

Figure CN119789150B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer program loading, and particularly to a task offloading method, system, and storage medium based on task similarity. Background Art
[0002] With the gradual development of Internet technology, various terminal products and applications have emerged continuously, generating a huge scale of computing requirements.
[0003] Within the existing technical framework, when processing the tasks submitted by user terminals, the physical distance between the user terminal and the edge computing node is usually used as the main basis for decision-making. The specific process is as follows: when it is detected that the distance between the user terminal and a certain edge computing node falls within the preset threshold range, the system will select to offload the task to this edge computing node for processing. Although this method simplifies the task offloading decision-making process to a certain extent, it does not fully consider the specific characteristics of the tasks and the real-time load conditions of the edge computing nodes. Therefore, it may lead to unreasonable resource allocation and low task processing efficiency. Summary of the Invention
[0004] The present invention provides a task offloading method, system, and storage medium based on task similarity, which connects multiple devices with more identical tasks to the same edge server. In each task processing stage, only one device with the same task needs to be selected from the devices with the same task to offload the task to the edge server for calculation. After the remaining devices send the task input parameters, they can share the calculation results, saving the repeated energy cost in this process.
[0005] The technical solution of the present invention is as follows:
[0006] A task offloading method based on task similarity includes the following steps:
[0007] S1. Initialize the set of unmatched edge servers and the set of devices. Based on the task list of each device, use cross-comparison to obtain the same type of tasks, count the quantity, and generate the similarity score between the devices;
[0008] Based on the gain on the sub-channel from the device to the edge server, establish a preference function of the device for the edge server. Based on the similarity score, the remaining battery power of the device, and the gain on the sub-channel from the device to the edge server, establish a preference function of the edge server for the device;
[0009] Sort the numerical values of the preference functions of the device for all edge servers from large to small to establish a first preference list; each edge server establishes a second preference list according to the preference function of the edge server for the device; each device sends an offloading request to the first edge server in the first preference list, and the edge server counts the number of offloading requests received in the current time slot. If the number of offloading requests is not greater than the number of sub-channels of the edge server, the matching is successful;
[0010] S2. Form clusters for the devices with the same type of tasks after matching. Calculate the shortest distance between every two clusters based on the task types of the devices in the current time slot, set a distance threshold. When the shortest distance between two clusters is less than the distance threshold, merge the devices corresponding to the two clusters; traverse all the clusters until the shortest distance between every two clusters is greater than the distance threshold, then stop the merging and output the resulting clusters;
[0011] Select a device with the highest product of channel gain and remaining energy from the resulting clusters as the cluster head. The cluster head sends the task body code of the offloading task and the input parameters of the offloading task to the edge server, and allocates the number of sub-channels for the devices in the resulting clusters;
[0012] S3. Optimize the transmission power of the devices in all clusters on their sub-channels: Set the initial power of the devices in the cluster, establish an objective function according to the constraints of transmission power and delay, calculate the reciprocal of the transmission rate of the input parameters of the offloading tasks sent by the devices in the cluster to the edge server, and the energy consumption of the devices in the cluster sending their own task input parameters to the edge server, as the energy consumption function combination, and obtain the optimal transmission power of each device in the cluster.
[0013] S1 further includes that if the offloading request count is greater than the number of sub-channels of the edge server, select the same number of devices as the number of sub-channels from the front to the back in the second preference list to match with the edge server. The devices that fail to match update the first preference list, and then the edge server updates the second preference list, and repeat the above matching operation until all devices are matched.
[0014] The specific steps for obtaining the optimal transmission power allocated to each device in the cluster in S3 are as follows:
[0015] Solve the objective function, and the obtained solution is the transmission power of the devices in the cluster on the corresponding sub-channels. Substitute it back into the energy consumption function combination, update and iterate the energy consumption function combination until the second constraint condition is met, and output the optimal transmission power allocated to the devices in the cluster.
[0016] The second constraint condition described in S3 is specifically:
[0017] Or ,
[0018] Wherein, is the transmit power of the nth device on the kth subchannel, is the total number of devices, is the total number of subchannels, is the th device, is the th subchannel, is the l reciprocal of the task transmission rate of the nth device on subchannel k after the is the l +1th iteration, is the bandwidth of the subchannel, is the gain of the nth device on the th subchannel to the edge server m, is the Gaussian white noise power, is the co-tier interference received by the edge server m on the kth subchannel, is the l +1th iteration of the transmit power of the nth device on the kth subchannel, is the total task size, is the precision parameter used to control the iteration termination, is the number of iterations, is the maximum number of iterations.
[0019] The preference function of the edge server for the device described in S1 is specifically:
[0020] ,
[0021] where, is the preference function of the edge server m for the nth device, is the weight variable of the ratio of the edge server subchannel gain to the remaining power to the similarity score, is the gain of the nth device on the th subchannel to the edge server m, is the device 's remaining power, is the similarity score between device u and device .
[0022] As described in S2, subchannels are allocated to each cluster and the devices within the cluster. The number of subchannels allocated by the cluster head is:
[0023] ,
[0024] where, is the cluster head of the cluster The number of sub-channels allocated for the cluster The number of sub-channels allocated for the cluster The amount of task body code data that all devices within the cluster should send for the cluster head The amount of its own task input parameter data for the cluster The sum of the amounts of task input parameter data of all devices within the cluster for the cluster The number of devices i for the cluster the i th device
[0025] As described in S2, sub-channels are allocated for each cluster and the devices within the cluster. Among them, for the devices except the cluster head The number of sub-channels allocated is:
[0026] ,
[0027] wherein is the number of sub-channels allocated for the cluster is the amount of task input parameter data of the device except the cluster head within the cluster for the cluster The amount of task body code data that all devices within the cluster should send for the cluster The sum of the amounts of task input parameter data of all devices within the cluster
[0028] For the same type of tasks described in S1, the main codes of the offloading tasks of different devices in the current time slot are the same
[0029] A task offloading system based on task similarity, comprising:
[0030] Matching module: Initialize the set of unmatched edge servers and the set of devices. Based on the task lists of each device, use cross-comparison to obtain tasks of the same type, count the number, and generate a similarity score between devices. Based on the gain on the sub-channel from the device to the edge server, establish a preference function of the device for the edge server. Based on the similarity score, the remaining power of the device, and the gain on the sub-channel from the device to the edge server, establish a preference function of the edge server for the device. Sort the numerical values of the preference functions of the device for all edge servers from large to small to establish a first preference list. Each edge server establishes a second preference list according to the preference function of the edge server for the device. Each device sends an offloading request to the first edge server in the first preference list. The edge server counts the number of offloading requests received in the current time slot. If the number of offloading requests is not greater than the number of sub-channels of the edge server, the matching is successful.
[0031] Transmission module: Form clusters of devices with the same type of tasks after matching. Calculate the shortest distance between every two clusters based on the task types of the devices in the current time slot, set a distance threshold. When the shortest distance between two clusters is less than the distance threshold, merge the devices corresponding to the two clusters. Traverse all the clusters until the shortest distance between every two clusters is greater than the distance threshold, then stop merging and output the resulting clusters. Select a device with the highest product of channel gain and remaining energy from the resulting clusters as the cluster head. The cluster head sends the task body code of the offloading task and the input parameters of the offloading task to the edge server, and allocates the number of sub-channels for the devices within the resulting clusters.
[0032] Allocation module: Optimize the transmission power of the devices within all clusters on their sub-channels, set the initial power of the devices within the cluster, establish an objective function according to the constraints of transmission power and delay, calculate the reciprocal of the transmission rate of the input parameters of the offloading task sent by the devices within the cluster to the edge server, and the energy consumption of the devices within the cluster sending the input parameters of their own tasks to the edge server, as the energy consumption function combination, to obtain the optimal transmission power of each device within the cluster.
[0033] A task offloading storage medium based on task similarity, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the above method.
[0034] The beneficial effects of the present invention are:
[0035] By connecting multiple devices with a large number of identical tasks to the same edge server, the optimization of task processing and the efficient utilization of resources are achieved. Specifically, in each task processing stage, a representative cluster head device is selected, and its tasks are offloaded to the edge server for calculation. This innovation greatly reduces unnecessary computational redundancy because the remaining devices that only need to send task input parameters can immediately share this calculation result without having to perform the complete calculation process individually.
[0036] Moreover, the present invention also proposes an allocation strategy for the sub-channels required for communication between different devices. The core advantage of this strategy is that in the context of the increasing number of Internet of Things devices and the rapid growth of task requirements, the present invention not only improves the utilization rate of edge computing resources and reduces the overall energy consumption, but also has far-reaching significance for promoting the development of a green and sustainable Internet of Things ecosystem. In addition, by reducing the repeated execution of computing tasks, the present invention also accelerates the task processing speed and improves the user experience. Brief Description of the Drawings
[0037] In the drawings:
[0038] Figure 1 It is a comparison chart of the average energy consumption between the present invention and the comparative scheme;
[0039] Figure 2 It is a comparison chart of the average delay between the present invention and the comparative scheme. Detailed Embodiments
[0040] The technical solution of the present invention is as follows:
[0041] In the scenario of the present invention, the key objective is the cooperative offloading between devices, and local computing of devices does not obtain the benefits of cooperative offloading. Therefore, the present invention considers that all devices upload tasks to the edge server, and then the task offloading strategy of the devices will become the problem of which edge server to offload to.
[0042] While satisfying the following first constraint conditions, the above problems are solved, that is, each device can only select one edge server for computing offloading; each device is only assigned one sub-channel; both task offloading and sub-channel allocation are binary; there are power limitations on each sub-channel and each edge server; and there is a maximum delay requirement for the device to complete the task.
[0043] To solve the proposed problems, the problems are now decomposed into 3 sub-problems, namely the offloading decision sub-problem, the sub-channel allocation sub-problem, and the power allocation sub-problem. Corresponding solutions are proposed for each sub-problem. A matching-based computing offloading strategy is proposed to solve the offloading decision sub-problem; for the sub-channel allocation sub-problem, a cooperation-based sub-channel allocation strategy is proposed; and finally, power allocation based on concave-convex functions is proposed to optimize power allocation.
[0044] A task offloading method based on task similarity, comprising the following steps:
[0045] S1. Initialize the set of unmatched edge servers and the set of devices. Based on the task list of each device, use cross - comparison to obtain the same - type tasks, count the quantity, and generate the similarity score between devices;
[0046] Based on the gain on the sub - channel from the device to the edge server, establish a preference function of the device for the edge server. Based on the similarity score, the remaining battery power of the device, and the gain on the sub - channel from the device to the edge server, establish a preference function of the edge server for the device;
[0047] Sort the numerical values of the preference functions of the device for all edge servers from large to small to establish a first preference list; each edge server establishes a second preference list according to the preference function of the edge server for the device; each device sends an offloading request to the first edge server in the first preference list. The edge server counts the number of offloading requests received in the current time slot. If the number of offloading requests is not greater than the number of edge server sub - channels, the matching is successful.
[0048] If the offloading request count is greater than the number of edge server sub - channels, select the same number of devices as the number of sub - channels from the front to the back in the second preference list to match with the edge server. The devices that fail to match successfully update the first preference list, and then the edge server updates the second preference list, and repeat the above matching operation until all devices are matched.
[0049] The constraint conditions of the transmission power and delay are the first constraint conditions.
[0050] Among them, the same - type tasks mean that the main codes of the offloading tasks of different devices in the current time slot are the same.
[0051] Each edge server is connected to a base station and adopts orthogonal frequency - division multiple access technology. There are different types of devices within the coverage area of the edge server. Each device has its own task list within a period of time, continuously processes a series of tasks, but only processes the task of the current time slot in each time slot. The edge servers connected to the base station are wired with high - speed optical fibers, and the communication delay between them is not considered; the edge servers are powered by cables, and the energy consumption of processing tasks is not considered. Since the amount of the output result task is relatively small, the download delay is ignored.
[0052] In the present invention, a binary offloading scheme is adopted to better achieve cooperative offloading and save device energy. All devices offload their tasks to the edge servers for calculation, and each device only offloads the task to one edge server.
[0053] To enable more devices with the same reusable tasks to match the same edge server in each time slot, the concept of similarity score is introduced.
[0054] The similarity score is defined as follows: Assume that each device has a task list. Cross - comparison is used to find tasks with the same code type, and the number of tasks is counted to calculate the similarity score between them. Devices with more overlapping tasks are given a higher similarity score.
[0055] The similarity score is used to affect the preference for selecting the same base station and is incorporated when establishing the preference function of the base station for the device.
[0056] During the calculation of offloading, each device is willing to associate with the edge server with the best channel conditions to obtain a high offloading rate. Therefore, the preference function of the th device for the edge server is established as:
[0057] ,
[0058] where is the gain of the th device for the edge server m on the
[0059] th sub - channel.
[0060] Each device can calculate its preference for the edge server according to the above formula and generate a first preference list.
[0061] ,
[0062] where is the preference function of the edge server m for the th device, is the weight variable of the ratio of the edge server sub - channel gain to the remaining power and the similarity score, is the gain of the th device for the edge server m on the th sub - channel, is the remaining power of the device and
[0063] is the similarity score between device u and device
[0064] Each edge server can calculate its preference for the device according to the above formula and generate a second preference list.
[0065] The preference function of the edge server for devices can reflect that the base station has a higher preference for devices with good channel conditions for offloading tasks and low battery levels. It can preferentially process tasks for low-battery devices to save the energy consumption of low-battery devices. The addition of similarity scoring can match more devices with the same tasks to the same base station to achieve more energy consumption savings for devices.
[0066] S2. Form clusters for devices with the same type of tasks after matching. Calculate the shortest distance between every two clusters based on the current time-slot task types of the devices. Set a distance threshold. When the shortest distance between two clusters is less than the distance threshold, merge the devices corresponding to the two clusters; traverse all the clusters until the shortest distance between every two clusters is greater than the distance threshold, then stop merging and output the resulting clusters.
[0067] Select a device with the highest product of channel gain and remaining energy from the resulting clusters as the cluster head. The cluster head sends the task body code of the offloading task and the input parameters of the offloading task to the edge server, and the remaining devices in the resulting clusters send the input parameters of the offloading task to the edge server, and allocate the number of sub-channels for the devices in the resulting clusters.
[0068] To better achieve the purpose of cooperative offloading, use the agglomerative clustering algorithm in the hierarchical clustering algorithm to form clusters for devices with the same type of reusable tasks in the current time slot, and then select a device from the clusters as the cluster head. The cluster head sends the task body code and its own task input parameters to the edge server, and the remaining devices in the cluster send their own task input parameters to the edge server.
[0069] Define devices as data points and define the task similarity between devices as distance, ensuring that data points with close distances are grouped into the same cluster.
[0070] Allocate sub-channels according to the ratio of the number of devices in each cluster. The edge server has clusters, then the number of sub-channels allocated to the th cluster is :
[0071] ,
[0072] where is the number of sub-channels of the system, is the number of devices in cluster .
[0073] Adopt the merging rule of the shortest distance and use the current time-slot task types of the devices to calculate the distance between device u and n, being the similarity score between device u and device n. Set the shortest distance among all clusters to If is the shortest distance among the distances between these devices, then Meanwhile, a stop condition is set in the algorithm, that is, the distance threshold When < , the clusters where devices u and n are located are merged. When > , the merging stops. In each iteration, the distances between all devices are calculated, and the clusters where the two devices with the shortest distance are located are merged to obtain the resulting cluster, regardless of the number of devices in the cluster.
[0074] Then, for each resulting cluster where the number of devices is greater than 2, that is , the cluster head is selected. The device with the largest product of the channel gain and the remaining energy of the devices in the cluster is selected as the cluster head. The cluster head selected in this way is a device with a relatively high channel gain and remaining energy, which is beneficial to reducing the total energy consumption and delay and reducing the energy consumption of low-power devices.
[0075] The present invention allocates the number of sub-channels for the cluster head and the other devices in the resulting cluster according to the ratio of the total task size sent by the cluster head to the total task size sent by the other devices in the resulting cluster.
[0076] Allocate the number of sub-channels for the devices in the resulting cluster. The number of sub-channels allocated to the cluster head is:
[0077] ,
[0078] where is the number of sub-channels allocated to the cluster head of cluster , is the number of sub-channels allocated to cluster , is the total amount of task body code data to be sent by all devices in cluster , is the amount of task input parameter data of the cluster head itself; is the sum of the amounts of task input parameter data of all devices in cluster , is the number of devices in cluster , i is the th device in cluster i .
[0079] Allocate the number of sub-channels for the devices in the resulting cluster. The number of sub-channels allocated to the devices other than the cluster head is :
[0080] ,
[0081] Among them, is the number of sub-channels allocated to the cluster , is the amount of task input parameter data of the devices in the cluster except the cluster head, is the amount of task body code data that all devices in the cluster should send, is the sum of the amounts of task input parameter data of all devices in the cluster .
[0082] S3. Optimize the transmission power of the devices in all clusters on their sub-channels: Set the initial power of the devices in the cluster, establish an objective function according to the constraints of the transmission power and delay, calculate the reciprocal of the transmission rate of the input parameters of the offloading tasks sent by the devices in the cluster to the edge server, and the energy consumption of the devices in the cluster sending their own task input parameters to the edge server, as an energy consumption function combination, and obtain the optimal transmission power of each device in the cluster.
[0083] Establish an objective function according to the first constraint condition:
[0084] ,
[0085] Among them, is the transmission power of the nth device on the kth sub-channel, is the total number of devices, is the total number of sub-channels, is the bandwidth of the sub-channel, is the total task size, is the gain of the nth device on the th sub-channel to the MEC edge server m, is the Gaussian white noise power, is the co-channel interference received by the edge server m on the kth sub-channel.
[0086] The energy consumption function combination formula is:
[0087] ,
[0088] Among them, represents the reciprocal of the task transmission rate of the nth device, represents the energy consumption of the task sent by the nth device, is the transmission power of the nth device on the kth sub-channel, is the total task size, is the transmission rate of the task sent by the nth device.
[0089] Obtain the optimal transmission power allocated to the devices within the cluster. The specific steps are as follows:
[0090] Use the CCCP (Convex-ConCave Procedure) method to solve the objective function. The obtained solution is the transmission power of the devices within the cluster on the subchannel where they are located. Substitute it back into the energy consumption function combination and update the iterative energy consumption function combination until the second constraint condition is satisfied:
[0091] Or ,
[0092] where is the transmission power of the nth device on the kth subchannel, is the total number of devices, is the total number of subchannels, is the rd device, is the th subchannel, is the l reciprocal of the task transmission rate of the nth device on the subchannel k after the th l +1 iteration, is the energy consumption of the nth device transmitting tasks on the subchannel k after the th +1 iteration, is the bandwidth of the subchannel, is the co-channel interference received by the edge server m on the kth subchannel, is the l th total task size, is the precision parameter used to control the termination of the iteration, is the number of iterations, is the maximum number of iterations.
[0093] Output the optimal transmission power allocated to the devices within the cluster as:
[0094] ,
[0095] where is the optimal power of the nth device on the kth subchannel, is the total bandwidth allocated to the nth device, is the gradient of the second convex function with respect to power on the kth subchannel, The Lagrange multiplier in the Lagrange function constructed when optimizing power for the nth device is the co-channel interference received by the edge server m on the kth sub-channel the maximum transmit power of the nth device on the kth sub-channel
[0096] In the present invention, the transmit power is optimized separately for each device, rather than optimizing the power for all devices in a cluster and then distributing it
[0097] A task offloading system based on task similarity, comprising:
[0098] Matching module: Under the constraint conditions of transmit power and delay, initialize the set of unmatched edge servers and the set of devices. Based on the task list of each device, use cross-comparison to obtain the same type of tasks, count the number, and generate the similarity score between devices; Based on the gain on the sub-channel from the device to the edge server, establish the preference function of the device for the edge server. Based on the similarity score, the remaining power of the device, and the gain on the sub-channel from the device to the edge server, establish the preference function of the edge server for the device; Sort the numerical values of the preference functions of the device for all edge servers from large to small to establish the first preference list; Each edge server establishes a second preference list according to the preference function of the edge server for the device; Each device sends an offloading request to the first edge server in the first preference list. The edge server counts the number of offloading requests received in the current time slot. If the number of offloading requests is not greater than the number of sub-channels of the edge server, the matching is successful
[0099] Transmission module: Form clusters of devices with the same type of tasks after matching. Calculate the shortest distance between every two clusters based on the task types of the devices in the current time slot, set the distance threshold. When the shortest distance between two clusters is less than the distance threshold, merge the devices corresponding to the two clusters; Traverse all clusters until the shortest distance between every two clusters is greater than the distance threshold, then stop merging and output the resulting clusters; Select a device with the highest product of channel gain and remaining energy from the resulting clusters as the cluster head. The cluster head sends the task body code of the offloading task and the input parameters of the offloading task to the edge server, and the remaining devices in the resulting clusters send the input parameters of the offloading task to the edge server
[0100] Allocation module: Optimize the transmit power of devices in all clusters on their sub-channels, set the initial power of the devices in the cluster, establish the objective function according to the constraint conditions of transmit power and delay, calculate the reciprocal of the transmission rate of the input parameters of the offloading task sent by the devices in the cluster to the edge server, and the energy consumption of the devices in the cluster sending the input parameters of their own tasks to the edge server as the energy consumption function combination, and obtain the optimal transmit power of each device in the cluster
[0101] A task offloading storage medium based on task similarity, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0102] Compare the method of the present invention with the following three schemes:
[0103] Comparison scheme 1 (random matching): Randomly allocate sub-channels for offloading tasks, with the maximum communication power.
[0104] Comparison scheme 2 (no similarity matching): Randomly allocate sub-channels for offloading tasks and optimize power based on CCCP.
[0105] Comparison scheme 3 (similarity without clustering matching): Divide the similar tasks of the offloading tasks, add the similarity score to the matching process and match, randomly allocate sub-channels for the offloading tasks, and optimize power based on CCCP.
[0106] As Figure 1 、 Figure 2 shown, the energy consumption of the present invention is reduced by 28.53% - 52.57%; the delay is reduced by 39.86% - 66.28%; therefore, the present invention realizes the optimization of task processing and the efficient utilization of resources by connecting multiple devices with a large number of identical tasks to the same edge server.
[0107] Moreover, the present invention also proposes an allocation strategy for sub-channels required for communication between different devices. The core advantage of this strategy is that, in the context of the increasing number of Internet of Things devices and the rapid growth of task requirements, the present invention not only improves the utilization rate of edge computing resources, but also effectively extends the battery life of devices, reduces the overall energy consumption, and has far-reaching significance for promoting the development of a green and sustainable Internet of Things ecosystem. In addition, by reducing the repeated execution of computing tasks, the present invention also accelerates the task processing speed and improves the user experience.
Claims
1. A task offloading method based on task similarity, characterized in that: The steps include: S1. Initialize the unmatched edge server set and device set, and based on the task list of each device, use cross comparison to obtain the same type of tasks, count the number, and generate similarity scores between devices; Based on the gain of the device to the edge server subchannel, a preference function of the device to the edge server is established, and based on the similarity score, the remaining power of the device and the gain of the device to the edge server subchannel, a preference function of the edge server to the device is established; Sort the preference function values of the device for all edge servers from large to small to establish a first preference list; Each edge server establishes a second preference list according to the preference function of the edge server for the device; each device sends an offload request to the first edge server in the first preference list, and the edge server counts the number of offload requests received in the current time slot, and if the number of offload requests is not greater than the number of sub-channels of the edge server, the match is successful; S2, cluster the devices with the same type of tasks after matching, calculate the shortest distance between each two clusters based on the current time slot task type of the device, set a distance threshold, and when the shortest distance between two clusters is less than the distance threshold, merge the devices corresponding to the two clusters; traverse all clusters until the shortest distance between each two clusters is greater than the distance threshold, stop merging, and output the result cluster; A device with the highest product of channel gain and residual energy is selected from the result cluster as the cluster head. The cluster head sends the task body code of the offloading task and the input parameters of the offloading task to the edge server. The remaining devices in the result cluster send the input parameters of the offloading task to the edge server to allocate the number of sub-channels for the devices in the result cluster. S3. Optimize the transmission power of all devices in the cluster in their sub-channels: set the initial power of the devices in the cluster, establish the objective function according to the constraints of transmission power and delay, calculate the inverse of the sending rate of the input parameters of the offload task sent by the cluster devices to the edge server, and the energy consumption of the cluster devices sending their own task input parameters to the edge server, as a combination of energy consumption functions, to obtain the optimal transmission power of each device in the cluster.
2. The task offloading method based on task similarity according to claim 1, characterized in that: S1 also includes, if the offload request count is greater than the number of sub-channels of the edge server, selecting the same number of devices as the number of sub-channels from the front to the back in the second preference list to match the edge server, updating the first preference list for the devices that have not been successfully matched, and then the edge server updates the second preference list, and repeating the above matching operation until all devices are matched.
3. The task offloading method based on task similarity according to claim 1, characterized in that: S3 obtains the optimal transmission power allocated to each device in the cluster, and the specific steps are: Solve the objective function, and the solution obtained is the transmit power of the device in the cluster in the sub-channel. Substitute it back into the energy consumption function combination, update the iterative energy consumption function combination until the second constraint is met, and output the optimal transmit power allocated to the device in the cluster.
4. The method for task offloading based on task similarity according to claim 1, characterized in that: The preference function of the edge server for the device in S1 is specifically: , in, is the preference function of edge server m for the nth device, is the weight variable of the ratio of the edge server subchannel gain to the remaining power and the similarity score, For the nth device in The gain to edge server m on the subchannel is, For equipment The remaining power, For device u and device Similarity score.
5. The task offloading method based on task similarity according to claim 1 is characterized in that: S2 is the allocation of the number of sub-channels by the devices in the result cluster, where the number of sub-channels allocated by the cluster head is: , in, Cluster Cluster head The number of allocated subchannels, Cluster The number of subchannels allocated, Cluster The amount of task body code data that all devices should send, Cluster Head The amount of input parameter data of its own task; Cluster The sum of the task input parameter data of all devices in the Cluster The number of devices, i Cluster No. i devices.
6. The task offloading method based on task similarity according to claim 1, characterized in that: S2 is the result of allocating the number of sub-channels to the devices in the cluster, where the devices other than the cluster head The number of allocated subchannels for: , in, Cluster The number of subchannels allocated, Cluster Cluster head removal equipment The amount of task input parameter data, Cluster The amount of task body code data that all devices should send, Cluster The sum of the task input parameter data of all devices in the Cluster The number of devices, i Cluster No. i devices.
7. The method for task offloading based on task similarity according to claim 1, characterized in that: The same type of tasks described in S1 are tasks for unloading tasks in the current time slots of different devices with the same main body code.
8. A task offloading system based on task similarity, characterized in that: include: Matching module: Initialize the unmatched edge server set and device set, use cross comparison to obtain the same type of tasks based on the task list of each device, count the number, and generate similarity scores between devices; establish a preference function for the device to the edge server based on the gain on the device-to-edge server subchannel, and establish a preference function for the edge server to the device based on the similarity score, the remaining power of the device, and the gain on the device-to-edge server subchannel; Sort the preference function values of the device for all edge servers from large to small to establish a first preference list; Each edge server establishes a second preference list according to the preference function of the edge server for the device; each device sends an offload request to the first edge server in the first preference list, and the edge server counts the number of offload requests received in the current time slot, and if the number of offload requests is not greater than the number of sub-channels of the edge server, the match is successful; Transmission module: cluster the devices with the same type of tasks after matching, calculate the shortest distance between each two clusters based on the current time slot task type of the device, set the distance threshold, and merge the devices corresponding to the two clusters when the shortest distance between two clusters is less than the distance threshold; traverse all clusters until the shortest distance between each two clusters is greater than the distance threshold, stop merging, and output the result cluster; select a device with the highest product of channel gain and residual energy from the result cluster as the cluster head, and the cluster head sends the task body code of the unloading task and the input parameters of the unloading task to the edge server to allocate the number of sub-channels for the devices in the result cluster; Allocation module: optimizes the transmission power of all devices in the cluster in their sub-channels, sets the initial power of the devices in the cluster, establishes the objective function according to the constraints of transmission power and delay, calculates the inverse of the sending rate of the input parameters of the offload task sent by the cluster devices to the edge server, and the energy consumption of the cluster devices sending their own task input parameters to the edge server, and obtains the optimal transmission power of each device in the cluster as a combination of energy consumption functions.
9. A task offloading storage medium based on task similarity, having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Edge computing task processing method and device and computer equipment
CN113282409A
Green and energy-saving unloading method based on cooperation of multiple edge nodes under power internet of things
CN115412966A