Multi-task joint computing offloading and resource allocation method based on D2D communication
By using D2D communication technology on the mobile terminal device, the calculation task is uninstalled to the surrounding idle terminal processing, solving the problem of insufficient mobile terminal computing power, reduced task delay and energy consumption, and improved the user experience.
Patent Information
- Application Number
- CN202210101461.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-01-27
AI Technical Summary
The limited computing power of mobile terminal devices is difficult to meet complex tasks with large computing volume and delay sensitivity, especially in virtual reality, face recognition and environmental interaction applications.
Adopt multi -tasking combined calculation and uninstallation and resource allocation methods based on D2D communication. By uninstalling multiple computing tasks on the local terminal to multiple idle terminals around, to achieve decentralized calculation tasks Energy consumption.
Effectively reduce user expenses, including delayed task and local terminal energy consumption, improves the user experience, and make full use of the collaboration between mobile users to slow down the pressure of cellular networks.
Smart Images

Figure CN114449490B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a multi-task joint computing offloading and resource allocation method based on D2D communication. Background Art
[0002] The rapid development of mobile networks and smart devices has provided a large number of service applications for people's daily lives, but at the same time these applications have also generated a large number of computationally intensive tasks. Especially with the emergence of virtual reality, face recognition, and environmental interaction applications, the limited computing power of mobile terminal devices is difficult to meet complex tasks that are computationally intensive and latency-sensitive. Mobile Edge Computing (MEC) is considered to be an effective technology to meet this challenge. MEC provides cloud computing capabilities in the radio access network (RAN). MEC connects users directly to the nearest edge computing server, which allows their needs to be met at any time and any place. By offloading tasks to edge computing servers connected to base stations, users can get a better application experience. MEC servers have high computing power and can complete tasks and return results to users in a short time.
[0003] In practice, mobile terminals are densely distributed, and each device has a certain computing power. Users with low computing power can offload their tasks to idle devices around them through device-to-device (D2D) communication. Compared with the MEC offloading solution, D2D technology can further improve the user experience and make full use of the collaboration between mobile users. In crowded scenes, D2D technology can effectively reduce the pressure on cellular networks. In scenarios where user terminals have multi-task computing requirements, reasonable task offloading decisions and resource allocation solutions can effectively reduce user overhead. Summary of the invention
[0004] The purpose of the present invention is to provide a multi-task joint computing offloading and resource allocation method based on D2D communication. The local terminal simultaneously offloads multiple computing tasks generated by itself to multiple idle terminals around it. By applying this method, the task delay and local terminal energy consumption overhead can be reduced.
[0005] To achieve the above functions, the present invention designs a multi-task joint computing offloading and resource allocation method based on D2D communication, and performs the following steps according to a preset period to offload the computing tasks on the local terminal to each idle terminal with idle computing resources around the local terminal, thereby realizing the allocation of local terminal computing tasks with minimized total local terminal overhead;
[0006] S1. Taking the local terminal as the center, detect the idle terminals within the preset range and obtain the computing power f of each idle terminaln , Energy Consumption Pricing Maximum acceptable energy consumption Channel state g n , where n∈{1,2,…,N}, N is the total number of idle terminals;
[0007] S2. constructing various decision samples based on the execution mode of each computing task on the local terminal;
[0008] S3. For each decision sample, based on the processing delay function t of each computing task m , where m∈{1,2,…,M}, M is the total number of computing tasks, and the total computing energy consumption function E of each computing task assigned to the local terminal for processing decision samples is loc , the transmission energy consumption function of each idle terminal involved in the decision sample receiving the computing task assigned by the decision sample Where n∈{1,2,…,N}, N is the total number of idle terminals, and each idle terminal receives the corresponding charging fee function of each computing task of the local terminal, and determines the total cost objective function of the local terminal corresponding to the decision sample and the constraint conditions;
[0009] S4. For each decision sample, calculate the upper limit of the transmission delay between the local terminal and each idle terminal and the lower limit of the delay between the local terminal and each idle terminal corresponding to each decision sample, and determine the optimal transmission delay function corresponding to the decision sample under the constraint condition;
[0010] For each decision sample, based on the total overhead objective function of the local terminal corresponding to the decision sample, the constraint conditions, and the optimal transmission delay function corresponding to the decision sample under the constraint conditions, the total overhead of the local terminal corresponding to the decision sample is calculated;
[0011] S5. With the goal of minimizing the total cost of the local terminal, a decision sample that minimizes the total cost of the local terminal is selected through a preset number of iterations, and the allocation of various computing tasks on the local terminal is completed based on the decision sample.
[0012] As a preferred technical solution of the present invention: the specific steps of constructing the decision sample in step S2 are as follows:
[0013] S21. Each computing task on the local terminal is represented by a set Γ = {T1, T2, ... T M}, where the total number of computing tasks is M, and the attributes of each computing task are represented by the set {C m , D m , L m} means that C m The total number of CPU cycles required to process the computational task, D mis the data volume of the computing task, L m is the maximum delay allowed by the computing task, where m∈{1,2,…,M}, and M is the total number of computing tasks;
[0014] S22. Sort and number the idle terminals according to their channel gains from large to small, and the channel gain of each idle terminal satisfies g1≥…≥g n ≥…≥g N , where g n is the channel gain of one of the idle terminals, n∈{1,2,…,N}, N is the total number of idle terminals, and each idle terminal is represented by the set Λ={1,2,…,N};
[0015] S23. For each computing task T in each computing task on the local terminal m , where m∈{1,2,…,M}, M is the total number of computing tasks, construct computing tasks T m The execution method is as follows:
[0016] {x m,0 ,x m,1 ,…x m,n ,…x m,N}
[0017] Where x m,n Represents the computational task T m , where n∈{1, 2, ..., N}, N is the total number of idle terminals, x m,0 =1 indicates computing task T m Processing in the local terminal, x m,0 =0 means computing task T m Do not process in the local terminal, x m,n =1 indicates computing task T m Offload to idle terminal n for processing, x m,n =0 means computing task T m No processing is performed on the idle terminal n, and the execution mode of each computing task in each computing task set on the local terminal satisfies
[0018] S24. For each computing task on the local terminal, a decision sample is constructed based on the execution mode of each computing task on the local terminal. Each decision sample is represented by a matrix A with M rows and N+1 columns. The matrix A is as follows:
[0019]
[0020] The first column in the matrix A represents the execution status of each computing task on the local terminal, and the second column to the N+1th column represent the execution status of each computing task offloaded to each idle terminal.
[0021] As a preferred technical solution of the present invention: the specific steps of determining the local terminal total overhead objective function and constraint conditions in step S3 are as follows:
[0022] S31. For each decision sample, the number of computing tasks on the local terminal and each idle terminal is represented by the set {K0, K1, ..., K N} means that for each computing task on the local terminal, it is set according to the maximum acceptable delay L m Arrange from largest to smallest and use sets For each computing task on the idle terminal n, it is set according to the maximum acceptable delay L m Arrange from largest to smallest and use sets express;
[0023] S32. Calculate the total computing energy consumption function E of each computing task assigned to the local terminal for processing the decision sample. ioc , the transmission energy consumption function of each idle terminal involved in the decision sample receiving the computing task assigned by the decision sample As follows:
[0024]
[0025]
[0026] Where μ is the energy consumed for each CPU cycle, t tran is the transmission time of offloading computing tasks from the local terminal to the idle terminal, P tot is the minimum total transmit power of the local terminal;
[0027] Among them, based on the computing task execution decision x corresponding to the decision sample, the transmission time t of the local terminal to offload the computing task to the idle terminal is tran , the minimum total transmission power P of the local terminal tot The relationship is as follows:
[0028]
[0029] In the formula, g n is the nth idle terminal, g n-1 is the n-1th idle terminal, g N is the Nth idle terminal, and g n-1 ≥g n ≥g N, W is the transmission channel bandwidth, n0 is the white noise power spectrum density, and k represents the idle terminal number;
[0030] S33. For one computing task T among the computing tasks on the local terminal m , offload it to the idle terminal n, and calculate the task T m The processing delay t m The expression of is as follows:
[0031]
[0032] In the formula, f loc is the computing power of the local terminal, f n is the computing power of the idle terminal, S n (m) is the computation task T m In the set S n The position in, S0(m) is the computing task T m The position in set S0, i represents the computing task in set S0 or set S n The number in;
[0033] S34. Calculate the fee function Mon corresponding to each idle terminal receiving each computing task of the local terminal n As follows:
[0034]
[0035] In the formula, The pricing of n units of energy consumption for idle terminals;
[0036] S34. Based on the calculation task T m The processing delay t m , the total computing energy consumption function E of each computing task assigned to the local terminal for processing decision samples loc , the transmission energy consumption function of each idle terminal involved in the decision sample receiving the computing task assigned by the decision sample Each idle terminal receives the fee collection function Mon corresponding to each computing task of the local terminal n , determine the total cost objective function of the local terminal corresponding to the decision sample as follows:
[0037]
[0038] The constraints are:
[0039] (1)
[0040] (2)
[0041] (3)P tot≤P max
[0042] (4) α+β+γ=1
[0043] (5)α,β,γ∈(0,1),t tran >0,x m,n ∈{0, 1}
[0044] Among them, P max is the maximum transmit power of the local terminal, is the maximum acceptable energy consumption of idle terminal n, α, β, and γ are the weight coefficients of the local terminal for processing delay, energy consumption, and the fee charged by each idle terminal for each computing task received by the local terminal.
[0045] As a preferred technical solution of the present invention: the specific steps of determining the optimal transmission delay function corresponding to the decision sample in step S4 are as follows:
[0046] S41. For each decision sample, calculate the upper limit of the transmission delay between the local terminal and each idle terminal As follows:
[0047]
[0048] In the formula, Δ n is the upper limit of the transmission delay between the local terminal and the idle terminal n, which is as follows:
[0049]
[0050] Where t′ m For the computation task T m The delay at the local terminal or idle terminal is as follows:
[0051]
[0052] S42. Based on the maximum transmission power P of the local terminal max , calculate the lower limit of the transmission delay between the local terminal and each idle terminal according to the following formula As follows:
[0053]
[0054] S43. Based on the maximum transmit power P of the local terminal max , calculate the transmission delay t′ that minimizes the total local terminal overhead corresponding to the decision sample according to the following formula: tran :
[0055]
[0056] S44. Based on the upper limit of the transmission delay between the local terminal and each idle terminal Transmission delay lower limit Determine the optimal transmission delay function
[0057] (1) If and but
[0058] (2) If and but
[0059] (3) If and but
[0060] (4) If and Then, according to step S41, the upper limit of the transmission delay between the local terminal and each idle terminal is recalculated and recorded as
[0061] (1) If but
[0062] (2) If but
[0063] S45. By applying the optimal transmission delay function Bring it into the calculation task T m The processing delay t m In the expression, the optimal transmission delay function is obtained The computational task T m Processing delay Based on the total cost objective function of the local terminal corresponding to the decision sample, the total cost of the local terminal corresponding to the decision sample is obtained as follows:
[0064]
[0065] In the formula, σ is the preset penalty value.
[0066] As a preferred technical solution of the present invention: in step S5, the goal is to minimize the total cost of the local terminal, and through a preset number of iterations, the decision sample that minimizes the total cost of the local terminal is selected, and the specific steps of completing the allocation of each computing task on the local terminal are:
[0067] S51. Different decision samples are used to participate in the iteration, and the computing tasks on the local terminal are allocated according to each decision sample, and the maximum number of iterations is preset to determine whether the preset maximum number of iterations is reached. If the preset maximum number of iterations is reached, the decision sample that minimizes the total cost of the local terminal in each iteration is selected to allocate the computing tasks on the local terminal;
[0068] If the preset maximum number of iterations is not reached, proceed to step S52;
[0069] S52. Implement crossover operation in each decision sample: randomly select two decision samples from each decision sample, denoted as A1 and A2. The decision samples reflect the execution decision of each task. The N+1 column vectors in the decision samples are regarded as chromosomes. Each chromosome contains M elements corresponding to the execution status of M tasks on the local terminal or each idle terminal. The decision samples A1 and A2 are denoted as parent individual 1 and parent individual 2 respectively. The position of the chromosome and the position of the crossover node on the chromosome are randomly selected. The expression is as follows:
[0070] (θ1, θ2)
[0071] In the formula, θ1 is the position of the chromosome in the parent individual to which it belongs, and θ2 is the position of the crossover node in the chromosome. Based on this position, crossover is performed, and the first θ1-1 column and the first θ2 elements on the θ1th column of parent individual 1 are combined with the last N+1-θ1 column and the last M-θ2 elements on the θ1th column of parent individual 2 to generate a new individual 1, and the last N+1-θ1 column and the last M-θ2 elements on the θ1th column of parent individual 1 are combined with the first θ1-1 column and the first θ2 elements on the θ1th column of parent individual 2 to generate a new individual 2, generating two new individuals, which are recorded as offspring individual 1 and offspring individual 2 respectively;
[0072] After each crossover operation is completed, for each offspring individual, check whether it meets like Indicates that the computing task is missing, then an idle terminal or local terminal that can execute the missing computing task is randomly selected. If the computing task is repeated, an idle terminal or a local terminal is randomly selected to execute the computing task;
[0073] S53. Implement mutation operation in each decision sample: Based on the decision samples in each completed iteration, the decision sample with the smallest total cost of the local terminal does not participate in the mutation operation, and for other decision samples, the predetermined probability is used. Perform the mutation operation. For the matrix corresponding to the decision sample, randomly select the position of the chromosome and the position of the mutation element on the chromosome. The expression is as follows:
[0074] (θ3,θ4)
[0075] In the formula, θ3 is the position of the chromosome in the individual to which it belongs, and θ4 is the position of the variant element on the chromosome;
[0076] by Represents the value of the element on the chromosome. If Then change its value to 0, and randomly select an idle terminal or local terminal to execute the corresponding computing task. Then its value is modified to 1, and the corresponding computing task is removed from the idle terminal or local terminal that originally executed the computing task;
[0077] S54. For each decision sample, as well as each decision sample obtained after crossover operation and mutation operation, the total local terminal overhead corresponding to each decision sample is calculated respectively, and the sample with the best original population quantity is selected to construct a sample group to participate in the iteration until the preset maximum number of iterations is reached.
[0078] Beneficial effects: Compared with the prior art, the advantages of the present invention include:
[0079] 1. The present invention aims to maximize the number of completed computing tasks. By distributing and unloading computing tasks to different idle terminals, the computing task delay is minimized, ensuring to the greatest extent that each computing task can be completed within the maximum delay allowed by the computing task.
[0080] 2. The present invention jointly considers local terminal overhead in terms of computing task latency, energy consumption, and offloading costs, and performs joint optimization in this regard. Users can adjust the definition of their own overhead according to the importance they attach to different resources.
[0081] 3. Different from the traditional computing task offloading method, this method makes full use of the computing resources of the surrounding idle terminals. It can offload multiple computing tasks to one terminal device at the same time, or it can offload multiple computing tasks to multiple terminal devices at the same time, which is highly flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 is a schematic diagram of a flow chart provided according to an embodiment of the present invention;
[0083] Figure 2 Schematic diagram of a system model provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0084] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0085] Reference Figure 1 , Figure 2 The multi-task joint computing offloading and resource allocation method based on D2D communication provided in the embodiment of the present invention performs the following steps according to a preset period to offload the computing tasks on the local terminal to each idle terminal with idle computing resources around the local terminal, so as to achieve the allocation of the computing tasks of the local terminal with the minimum total overhead of the local terminal, wherein the maximum distance of the local terminal D2D communication is 50m;
[0086] S1. Taking the local terminal as the center, detect the idle terminals within the preset range and obtain the computing power f of each idle terminal n , Energy Consumption Pricing Maximum acceptable energy consumption Channel state g n , where n∈{1, 2, ..., N}, N is the total number of idle terminals;
[0087] S2. constructing various decision samples based on the execution mode of each computing task on the local terminal;
[0088] S3. For each decision sample, based on the processing delay function t of each computing task m , where m∈{1, 2, ..., M}, M is the total number of computing tasks, and the total computing energy consumption function E of each computing task assigned to the local terminal for processing decision samples is loc , the transmission energy consumption function of each idle terminal involved in the decision sample receiving the computing task assigned by the decision sample Where n∈{1, 2, ..., N}, N is the total number of idle terminals, and each idle terminal receives a charge function corresponding to each computing task of the local terminal, and determines the total cost objective function of the local terminal corresponding to the decision sample and the constraint conditions;
[0089] S4. For each decision sample, calculate the upper limit of the transmission delay between the local terminal and each idle terminal and the lower limit of the delay between the local terminal and each idle terminal corresponding to each decision sample, and determine the optimal transmission delay function corresponding to the decision sample under the constraint condition;
[0090] For each decision sample, based on the total overhead objective function of the local terminal corresponding to the decision sample, the constraint conditions, and the optimal transmission delay function corresponding to the decision sample under the constraint conditions, the total overhead of the local terminal corresponding to the decision sample is calculated;
[0091] S5. With the goal of minimizing the total cost of the local terminal, a decision sample that minimizes the total cost of the local terminal is selected through a preset number of iterations, and the allocation of various computing tasks on the local terminal is completed based on the decision sample.
[0092] The multi-task joint computing offloading and resource allocation method based on D2D communication provided by the embodiment of the present invention, the specific steps of constructing the decision sample in step S2 are as follows:
[0093] S21. Each computing task on the local terminal is represented by a set Γ = {T1, T2, ... T M}, where the total number of computing tasks is M, and the attributes of each computing task are represented by the set {C m , D m , L m} means that C m The total number of CPU cycles required to process the computational task, D m is the data volume of the computing task, L m is the maximum delay allowed by the computing task, where m∈{1, 2, ..., M}, and M is the total number of computing tasks;
[0094] S22. Sort and number the idle terminals according to their channel gains from large to small, and the channel gain of each idle terminal satisfies g1≥…≥g n ≥…≥g N , where g n is the channel gain of one of the idle terminals, n∈{1, 2, ..., N}, N is the total number of idle terminals, and each idle terminal is represented by a set Λ={1, 2, ..., N};
[0095] S23. For each computing task T in each computing task on the local terminal m , where m∈{1, 2, ..., M}, M is the total number of computing tasks, construct computing tasks T m The execution method is as follows:
[0096] {x m,0 , x m,1 ,...x m,n ,...x m,N}
[0097] Where x m,n Represents the computational task T m , where n∈{1, 2, ...,}, N is the total number of idle terminals, x m,0 =1 indicates computing task T m Processing in the local terminal, x m,0 =0 means computing task T m Do not process in the local terminal, x m,n =1 indicates computing task T m Offload to idle terminal n for processing, x m,n =0 means computing task T mNo processing is performed on the idle terminal n, and the execution mode of each computing task in each computing task set on the local terminal satisfies That is, each computing task can only be processed on an idle terminal or a local terminal;
[0098] S24. For each computing task on the local terminal, a decision sample is constructed based on the execution mode of each computing task on the local terminal. Each decision sample is represented by a matrix A with M rows and N+1 columns. The matrix A is as follows:
[0099]
[0100] Among them, the first column in matrix A represents the execution status of each computing task on the local terminal, and the second to N+1 columns represent the execution status of each computing task offloaded to each idle terminal. When constructing each decision sample of a computing task, it is necessary to judge whether each idle terminal meets the energy consumption limit.
[0101] The multi-task joint computing offloading and resource allocation method based on D2D communication provided by the embodiment of the present invention, the specific steps of determining the local terminal total overhead objective function and the constraint conditions in step S3 are as follows:
[0102] S31. For each decision sample, the number of computing tasks on the local terminal and each idle terminal is represented by the set {K0, K1, ..., K N} indicates that the computing tasks are processed in serial mode on each idle terminal or local terminal. For each computing task on the local terminal, it is processed according to the maximum acceptable delay L m Arrange from largest to smallest and use sets Represents; for each computing task on the idle terminal n, arrange them from large to small according to the maximum acceptable delay Lm, and use the set express;
[0103] S32. Calculate the total computing energy consumption function E of each computing task assigned to the local terminal for processing the decision sample. loc , the transmission energy consumption function of each idle terminal involved in the decision sample receiving the computing task assigned by the decision sample As follows:
[0104]
[0105]
[0106] Where μ is the energy consumed for each CPU cycle, t tran is the transmission time of offloading computing tasks from the local terminal to the idle terminal, P totis the minimum total transmit power of the local terminal;
[0107] Among them, based on the computing task execution decision x corresponding to the decision sample, the transmission time t of the local terminal to offload the computing task to the idle terminal is tran , the minimum total transmission power P of the local terminal tot The relationship is as follows:
[0108]
[0109] In the formula, g n is the nth idle terminal, g n-1 is the n-1th idle terminal, g N is the Nth idle terminal, and g n-1 ≥g n ≥g N , W is the transmission channel bandwidth, n0 is the white noise power spectrum density, and k represents the idle terminal number;
[0110] S33. For one computing task T among the computing tasks on the local terminal m , offload it to the idle terminal n, and calculate the task T m The processing delay t m The expression of is as follows:
[0111]
[0112] In the formula, f loc is the computing power of the local terminal, f n is the computing power of the idle terminal, that is, the number of CPU cycles that the local terminal or the idle terminal can process per second, S n (m) is the computation task T m In the set S n The position in, S0(m) is the computing task T m The position in set S0, i represents the computing task in set S0 or set S n The number in;
[0113] S34. When the local terminal offloads the computing task to each idle terminal, it needs to pay a fee to the idle terminal as a commission. The charging function Mon corresponding to each computing task received by each idle terminal is calculated. n As follows:
[0114]
[0115] In the formula, is the price per unit energy consumption of idle terminal n, which is equal to the maximum acceptable energy consumption of idle terminal n. The computing power f of idle terminal nn , and the energy value factor η of idle terminal n n The specific relationship is as follows:
[0116]
[0117] S34. Based on the calculation task T m The processing delay t m , the total computing energy consumption function E of each computing task assigned to the local terminal for processing decision samples loc , the transmission energy consumption function of each idle terminal involved in the decision sample receiving the computing task assigned by the decision sample Each idle terminal receives the fee collection function Mon corresponding to each computing task of the local terminal n , determine the total cost objective function of the local terminal corresponding to the decision sample as follows:
[0118]
[0119] The constraints are:
[0120] (1)
[0121] (2)
[0122] (3)P tot ≤P max
[0123] (4) α+β+γ=1
[0124] (5)α,β,γ∈(0,1),t tran >0,x m,n ∈{0, 1}
[0125] Among them, P max is the maximum transmit power of the local terminal, is the maximum energy consumption that idle terminal n can accept, α, β, and γ are the weight coefficients of the local terminal for processing delay, energy consumption, and the fees corresponding to each computing task received by each idle terminal. The three reflect the importance of the local terminal to processing delay, energy consumption, and offloading fees. Formula (1) ensures that all computing tasks must be completed within the maximum time limit of the computing task itself; Formula (2) limits the maximum energy that idle terminals can use for computing; Formula (3) is the limit of the local terminal's transmission power; Formula (4) stipulates the relationship between the processing delay coefficient, energy consumption coefficient, and offloading fee coefficient; Formula (5) limits the value range of α, β, and γ.
[0126] In the multi-task joint computing offloading and resource allocation method based on D2D communication provided in an embodiment of the present invention, the specific steps of determining the optimal transmission delay function corresponding to the decision sample in step S4 are as follows:
[0127] S41. For each decision sample, calculate the upper limit of the transmission delay between the local terminal and each idle terminal As follows:
[0128]
[0129] In the formula, Δ n is the upper limit of the transmission delay between the local terminal and the idle terminal n, which is as follows:
[0130]
[0131] Where t′ m For the computation task T m The delay at the local terminal or idle terminal is as follows:
[0132]
[0133] S42. Based on the maximum transmission power P of the local terminal max , calculate the lower limit of the transmission delay between the local terminal and each idle terminal according to the following formula As follows:
[0134]
[0135] S43. Based on the maximum transmit power P of the local terminal max , calculate the transmission delay t′ that minimizes the total local terminal overhead corresponding to the decision sample according to the following formula: tran :
[0136]
[0137] S44. Based on the upper limit of the transmission delay between the local terminal and each idle terminal Transmission delay lower limit Determine the optimal transmission delay function
[0138] if It means that there is a ttran that makes all the unloaded computing tasks complete within the constraint time, and the following cases are discussed:
[0139] (1) If and but
[0140] (2) If and but
[0141] if This means that some of the offloaded computing tasks cannot be completed on time. The following situations are discussed:
[0142] (3) If and This means that all the offloaded computing tasks cannot be completed within the delay limit.
[0143] (4) If and This indicates that some computing tasks can be completed within the delay limit. For computing tasks that can be completed on time, the upper limit of the transmission delay between the local terminal and each idle terminal is recalculated according to step S41 and recorded as
[0144] (1) If but
[0145] (2) If but
[0146] S45. By applying the optimal transmission delay function Bring it into the calculation task T m The processing delay t m In the expression, the optimal transmission delay function is obtained The computational task T m Processing delay Based on the total cost objective function of the local terminal corresponding to the decision sample, the total cost of the local terminal corresponding to the decision sample is obtained as follows:
[0147]
[0148] Wherein, σ is a preset penalty value. If a computing task cannot be completed on time, a preset penalty value σ is added to the total cost objective function of the decision sample based on the local terminal.
[0149] The multi-task joint computing offloading and resource allocation method based on D2D communication provided by the embodiment of the present invention, in step S5, the goal is to minimize the total overhead of the local terminal, through a preset number of iterations, select the decision sample that minimizes the total overhead of the local terminal, and complete the specific steps of allocating each computing task on the local terminal:
[0150] S51. Different decision samples are used to participate in the iteration, and the computing tasks on the local terminal are allocated according to each decision sample, and the maximum number of iterations is preset to determine whether the preset maximum number of iterations is reached. If the preset maximum number of iterations is reached, the decision sample that minimizes the total cost of the local terminal in each iteration is selected to allocate the computing tasks on the local terminal;
[0151] If the preset maximum number of iterations is not reached, proceed to step S52;
[0152] S52. Implement crossover operation in each decision sample: randomly select two decision samples from each decision sample, denoted as A1 and A2. The decision samples reflect the execution decision of each task. The N+1 column vectors in the decision samples are regarded as chromosomes. Each chromosome contains M elements corresponding to the execution status of M tasks on the local terminal or each idle terminal. The decision samples A1 and A2 are denoted as parent individual 1 and parent individual 2 respectively. The position of the chromosome and the position of the crossover node on the chromosome are randomly selected. The expression is as follows:
[0153] (θ1, θ2)
[0154] In the formula, θ1 is the position of the chromosome in the parent individual to which it belongs, and θ2 is the position of the crossover node in the chromosome. Based on this position, crossover is performed, and the first θ1-1 column and the first θ2 elements on the θ1th column of parent individual 1 are combined with the last N+1-θ1 column and the last M-θ2 elements on the θ1th column of parent individual 2 to generate a new individual 1, and the last N+1-θ1 column and the last M-θ2 elements on the θ1th column of parent individual 1 are combined with the first θ1-1 column and the first θ2 elements on the θ1th column of parent individual 2 to generate a new individual 2, generating two new individuals, which are recorded as offspring individual 1 and offspring individual 2 respectively;
[0155] After each crossover operation is completed, for each offspring individual, check whether it meets like Indicates that the computing task is missing, then an idle terminal or local terminal that can execute the missing computing task is randomly selected. If the computing task is repeated, an idle terminal or a local terminal is randomly selected to execute the computing task;
[0156] S53. Implement mutation operation in each decision sample: Based on the decision samples in each completed iteration, the decision sample with the smallest total cost of the local terminal does not participate in the mutation operation, and for other decision samples, the predetermined probability is used. Perform the mutation operation. For the matrix corresponding to the decision sample, randomly select the position of the chromosome and the position of the mutation element on the chromosome. The expression is as follows:
[0157] (θ3,θ4)
[0158] In the formula, θ3 is the position of the chromosome in the individual to which it belongs, and θ4 is the position of the variant element on the chromosome;
[0159] by Represents the value of the element on the chromosome. If Then change its value to 0, and randomly select an idle terminal or local terminal to execute the corresponding computing task. Then its value is modified to 1, and the corresponding computing task is removed from the idle terminal or local terminal that originally executed the computing task;
[0160] S54. For each decision sample, as well as each decision sample obtained after crossover operation and mutation operation, the total local terminal overhead corresponding to each decision sample is calculated respectively, and the sample with the best original population quantity is selected to construct a sample group to participate in the iteration until the preset maximum number of iterations is reached.
[0161] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A multi-task joint computing offloading and resource allocation method based on D2D communication, characterized in that: Perform the following steps according to a preset period to offload the computing tasks on the local terminal to idle terminals with idle computing resources around the local terminal, so as to achieve the allocation of computing tasks on the local terminal with the minimum total overhead of the local terminal; S1. Taking the local terminal as the center, detect the idle terminals within the preset range and obtain the computing power f of each idle terminal n , Energy Consumption Pricing Maximum acceptable energy consumption Channel state g n , where n∈{1,2,…,N}, N is the total number of idle terminals; S2. constructing various decision samples based on the execution mode of each computing task on the local terminal; S3. For each decision sample, based on the processing delay function t of each computing task m , where m∈{1,2,…,M}, M is the total number of computing tasks, and the total computing energy consumption function E of each computing task assigned to the local terminal for processing decision samples is loc , the transmission energy consumption function of each idle terminal involved in the decision sample receiving the computing task assigned by the decision sample Where n∈{1,2,…,N}, N is the total number of idle terminals, and each idle terminal receives the corresponding charging fee function of each computing task of the local terminal, and determines the total cost objective function of the local terminal corresponding to the decision sample and the constraint conditions; The specific steps of determining the local terminal total overhead objective function and constraint conditions in step S3 are as follows: S31. For each decision sample, the number of computing tasks on the local terminal and each idle terminal is represented by the set {K0, K1, ..., K N } means that for each computing task on the local terminal, it is set according to the maximum acceptable delay L m Arrange from largest to smallest and use sets For each computing task on the idle terminal n, it is set according to the maximum acceptable delay L m Arrange from largest to smallest and use sets express; S32. Calculate the total computing energy consumption function E of each computing task assigned to the local terminal for processing the decision sample. loc , the transmission energy consumption function of each idle terminal involved in the decision sample receiving the computing task assigned by the decision sample As follows: Where μ is the energy consumed for each CPU cycle, t tran is the transmission time of offloading computing tasks from the local terminal to the idle terminal, P tot is the minimum total transmit power of the local terminal; Among them, based on the computing task execution decision x corresponding to the decision sample, the transmission time t of the local terminal to offload the computing task to the idle terminal is tran , the minimum total transmission power P of the local terminal tot The relationship is as follows: In the formula, g n is the nth idle terminal, g n-1 is the n-1th idle terminal, g N is the Nth idle terminal, and g n-1 ≥g n ≥g N , W is the transmission channel bandwidth, n0 is the white noise power spectrum density, and k represents the idle terminal number; S33. For one computing task T among the computing tasks on the local terminal m , offload it to the idle terminal n, and calculate the task T m The processing delay t m The expression of is as follows: In the formula, f loc is the computing power of the local terminal, f n is the computing power of the idle terminal, S n (m) is the computation task T m In the set S n The position in, S0(m) is the computing task T m The position in set S0, i represents the computing task in set S0 or set S n The number in; S34. Calculate the fee function Mon corresponding to each idle terminal receiving each computing task of the local terminal n As follows: In the formula, The pricing of n units of energy consumption for idle terminals; S34. Based on the calculation task T m The processing delay t m , the total computing energy consumption function E of each computing task assigned to the local terminal for processing decision samples loc , the transmission energy consumption function of each idle terminal involved in the decision sample receiving the computing task assigned by the decision sample Each idle terminal receives the fee collection function Mon corresponding to each computing task of the local terminal n , determine the total cost objective function of the local terminal corresponding to the decision sample as follows: The constraints are: (1) (2) (3) P tot ≤P max (4) α+β+γ=1 (5) α, β, γ∈(0, 1), t tran >0,x m,n ∈{0,1} Among them, P max is the maximum transmit power of the local terminal, is the maximum energy consumption acceptable to idle terminal n, α, β, and γ are the weight coefficients of the local terminal for processing delay, energy consumption, and the fees charged by each idle terminal for each computing task received by the local terminal; S4. For each decision sample, calculate the upper limit of the transmission delay between the local terminal and each idle terminal and the lower limit of the delay between the local terminal and each idle terminal corresponding to each decision sample, and determine the optimal transmission delay function corresponding to the decision sample under the constraint condition; For each decision sample, based on the total overhead objective function of the local terminal corresponding to the decision sample, the constraint conditions, and the optimal transmission delay function corresponding to the decision sample under the constraint conditions, the total overhead of the local terminal corresponding to the decision sample is calculated; The specific steps of determining the optimal transmission delay function corresponding to the decision sample in step S4 are as follows: S41. For each decision sample, calculate the upper limit of the transmission delay between the local terminal and each idle terminal As follows: In the formula, Δ n is the upper limit of the transmission delay between the local terminal and the idle terminal n, which is as follows: Where, t ′ m For the computation task T m The delay at the local terminal or idle terminal is as follows: S42. Based on the maximum transmission power P of the local terminal max , calculate the lower limit of the transmission delay between the local terminal and each idle terminal according to the following formula As follows: S43. Based on the maximum transmit power P of the local terminal max , calculate the transmission delay t that minimizes the total local terminal overhead corresponding to the decision sample according to the following formula: t ′ ran : S44. Based on the upper limit of the transmission delay between the local terminal and each idle terminal Transmission delay lower limit Determine the optimal transmission delay function (1) If and but (2) If and but (3) If and but (4) If and Then, according to step S41, the upper limit of the transmission delay between the local terminal and each idle terminal is recalculated and recorded as (1) If but (2) If but S45. By applying the optimal transmission delay function Bring it into the calculation task T m The processing delay t m In the expression, the optimal transmission delay function is obtained The computational task T m Processing delay Based on the total cost objective function of the local terminal corresponding to the decision sample, the total cost of the local terminal corresponding to the decision sample is obtained as follows: In the formula, σ is the preset penalty value; S5. With the goal of minimizing the total cost of the local terminal, a decision sample that minimizes the total cost of the local terminal is selected through a preset number of iterations, and the allocation of each computing task on the local terminal is completed based on the decision sample; The specific steps of step S5 are: S51. Different decision samples are used to participate in the iteration, and the computing tasks on the local terminal are allocated according to each decision sample, and the maximum number of iterations is preset to determine whether the preset maximum number of iterations is reached. If the preset maximum number of iterations is reached, the decision sample that minimizes the total cost of the local terminal in each iteration is selected to allocate the computing tasks on the local terminal; If the preset maximum number of iterations is not reached, proceed to step S52; S52. Implement crossover operation in each decision sample: randomly select two decision samples from each decision sample, denoted as A1 and A2. The decision samples reflect the execution decision of each task. The N+1 column vectors in the decision samples are regarded as chromosomes. Each chromosome contains M elements corresponding to the execution status of M tasks on the local terminal or each idle terminal. The decision samples A1 and A2 are denoted as parent individual 1 and parent individual 2 respectively. The position of the chromosome and the position of the crossover node on the chromosome are randomly selected. The expression is as follows: (θ1, θ2) In the formula, θ1 is the position of the chromosome in the parent individual to which it belongs, and θ2 is the position of the crossover node in the chromosome; crossover is performed based on this position, and the first θ1-1 column and the first θ2 elements on the θ1th column of parent individual 1 are combined with the last N+1-θ1 column and the last M-θ2 elements on the θ1th column of parent individual 2 to generate a new individual 1, and the last N+1-θ1 column and the last M-θ2 elements on the θ1th column of parent individual 1 are combined with the first θ1-1 column and the first θ2 elements on the θ1th column of parent individual 2 to generate a new individual 2, generating two new individuals, which are recorded as offspring individual 1 and offspring individual 2 respectively; After each crossover operation is completed, for each offspring individual, check whether it meets like Indicates that the computing task is missing, then an idle terminal or local terminal that can execute the missing computing task is randomly selected. If the computing task is repeated, an idle terminal or a local terminal is randomly selected to execute the computing task; S53. Implement mutation operation in each decision sample: Based on the decision samples in each completed iteration, the decision sample with the smallest total cost of the local terminal does not participate in the mutation operation, and for other decision samples, the predetermined probability is used. Perform the mutation operation. For the matrix corresponding to the decision sample, randomly select the position of the chromosome and the position of the mutation element on the chromosome. The expression is as follows: (θ3,θ4) In the formula, θ3 is the position of the chromosome in the individual to which it belongs, and θ4 is the position of the variant element on the chromosome; by Represents the value of the element on the chromosome. If Then change its value to 0, and randomly select an idle terminal or local terminal to execute the corresponding computing task. Then its value is modified to 1, and the corresponding computing task is removed from the idle terminal or local terminal that originally executed the computing task; S54. For each decision sample, as well as each decision sample obtained after crossover operation and mutation operation, the total local terminal overhead corresponding to each decision sample is calculated respectively, and the sample with the best original population quantity is selected to construct a sample group to participate in the iteration until the preset maximum number of iterations is reached.
2. The multi-task joint computing offloading and resource allocation method based on D2D communication according to claim 1, characterized in that: The specific steps of constructing the decision sample in step S2 are as follows: S21. Each computing task on the local terminal is represented by a set Γ = {T1, T2, ... T M }, where the total number of computing tasks is M, and the attributes of each computing task are represented by the set {C m , D m , L m } means that C m The total number of CPU cycles required to process the computational task, D m is the data volume of the computing task, L m is the maximum delay allowed by the computing task, where m∈{1,2,…,M}, and M is the total number of computing tasks; S22. Sort and number the idle terminals according to their channel gains from large to small, and the channel gain of each idle terminal satisfies g1≥…≥g n ≥…≥g N , where g n is the channel gain of one of the idle terminals, n∈{1,2,…,N}, N is the total number of idle terminals, and each idle terminal is represented by the set Λ={1,2,…,N}; S23. For each computing task T in each computing task on the local terminal m , where m∈{1,2,…,M}, M is the total number of computing tasks, construct computing tasks T m The execution method is as follows: {x m,0 ,x m,1 ,…x m,n ,…x m,N } Where x m,n Represents the computational task T m , where n∈{1,2,…,N}, N is the total number of idle terminals, x m,0 =1 indicates computing task T m Processing in the local terminal, x m,0 =0 means computing task T m Do not process in the local terminal, x m,n =1 indicates computing task T m Offload to idle terminal n for processing, x m,n =0 means computing task T m No processing is performed on the idle terminal n, and the execution mode of each computing task in each computing task set on the local terminal satisfies S24. For each computing task on the local terminal, a decision sample is constructed based on the execution mode of each computing task on the local terminal. Each decision sample is represented by a matrix A with M rows and N+1 columns. The matrix A is as follows: The first column in the matrix A represents the execution status of each computing task on the local terminal, and the second column to the N+1th column represent the execution status of each computing task offloaded to each idle terminal.
Citation Information
Patent Citations
MEC task unloading and resource allocation method based on deep reinforcement learning
CN113612843A