MULTI-TASK JOINT COMPUTING UNLOADING AND RESOURCE ALLOCATION METHOD BASED ON D2D COMMUNICATION
20230239903 · 2023-07-27
Assignee
Inventors
Cpc classification
H04W72/40
ELECTRICITY
International classification
H04W72/40
ELECTRICITY
Abstract
The present disclosure discloses a multi-task joint computing unloading and resource allocation method based on D2D (Device-to-Device) communication. For solving the problems that computing resources of a local terminal cannot complete all computing tasks on time when there are multiple computing tasks with delay requirements on a local terminal, the method introduces a computing unloading mechanism to reduce the delay and the overhead of the local terminal itself. The method is based on a D2D communication technology. In the scenario where mobile terminals are densely distributed, the local terminal can unload the computing tasks at the same time to several surrounding idle terminals for processing. According to the method, a total overhead objective function is established in consideration of the task delay, energy consumption, and unloading fee.
Claims
1. A multi-task joint computing unloading and resource allocation method based on D2D communication, wherein the specific steps of constructing decision samples in step S2 are as follows: S21, computing tasks on a local terminal are represented by a set Γ={T.sub.1, T.sub.2, . . . T.sub.M}, wherein the total number of the computing tasks is represented by M; the attributes of the computing tasks are represented by a set {C.sub.m, D.sub.m, L.sub.m}, wherein C.sub.m represents the total number of CPU cycles required to process the computing tasks, D.sub.m represents the data volume of the computing tasks, L.sub.m represents the maximum delay allowed by the computing tasks, wherein m∈{1,2, . . . , M}, and M represents the total number of computing tasks; S22, idle terminals are sorted and numbered in descending order according to channel gains thereof, the channel gains of the idle terminals satisfy the requirement of g.sub.1≥ . . . ≥g.sub.n≥ . . . ≥g.sub.N, wherein g.sub.n represents the channel gain of one of the idle terminals, n∈{1,2, . . . , N), N represents the total number of idle terminals, and the idle terminals are presented by a set Λ=(1,2, . . . , N}; S23, respectively for one computing task T.sub.m among the computing tasks on the local terminal, wherein m∈{1,2, . . . , M}, and M represents the total number of computing tasks, the execution mode of the computing task T.sub.m is constructed as follows: {x.sub.m,0, x.sub.m,1, . . . x.sub.m,n, . . . x.sub.m,N} where x.sub.m,n represents the execution mode of the computing task T.sub.m, wherein n∈{1,2, . . . , N}, N represents the total number of idle terminals, x.sub.m,0=1 represents that the computing task T.sub.m is processed at the local terminal, x.sub.m,0=0 represents that the computing task T.sub.m is not processed at the local terminal, x.sub.m,n=1 represents that computing task T.sub.m is unloaded to the idle terminal for processing, x.sub.m,n=0 represents that the computing task T.sub.m is not processed on the idle terminal n, and the execution mode of each computing task in computing task sets on the local terminal satisfies Σ.sub.n=0.sup.Nx.sub.m,n=1; and S24, respectively for the computing tasks on the local terminal, the decision samples are constructed based on the execution mode of the computing tasks on the local terminal, each of the decision samples is represented by a matrix A with M rows and N+1 columns, and the matrix A is as follows:
2. The multi-task joint computing unloading and resource allocation method based on D2D communication according to claim 1, wherein the specific steps of determining the total overhead objective function and constraint conditions of the local terminal in step 3 are as follows: S31, respectively for each decision sample, the number of computing tasks on the local terminal and the idle terminals is represented by a set {K.sub.0, K.sub.1, . . . , K.sub.N}, and the computing tasks on the local terminal are arranged in descending order according to the maximum allowable delay L.sub.m, and are represented by a set S.sub.0={S.sub.0,1, S.sub.0,2, . . . , S.sub.0,K.sub.
3. The multi-task joint computing unloading and resource allocation method based on D2D communication according to claim 2, wherein the specific steps of determining the optimal transmission delay function corresponding to the decision samples in step S4 are as follows: S41, respectively for each decision sample, the upper limit t.sub.tran.sup.up of transmission delay between the local terminal and the idle terminals is calculated as follows:
4. The multi-task joint computing unloading and resource allocation method based on D2D communication according to claim 3, wherein the specific steps of selecting the decision samples that minimize the total overhead of the local terminal with the goal of minimizing the total overhead of the local terminal through a preset number of iterations and completing the allocation of the computing tasks on the local terminal in step S5 are as follows: S51, different decision samples are used to participate in the iterations, the computing tasks on the local terminal are allocated according to the decision samples, the maximum number of iterations is preset, whether the preset maximum number of iterations is reached is determined, and if the preset maximum number of iterations is reached, the decision samples in each iteration that minimize the total overhead of the local terminal in each iteration are selected to allocate the computing tasks on the local terminal are allocated; if the preset maximum number of iterations is not reached, step S52 is performed; S52, cross-operation is performed in the decision samples: two decision samples are randomly selected from the decision samples, and are marked as A.sub.1 and A.sub.2, the decision samples reflect the execution decision of each task, N+1 columns of vectors in the decision samples are regarded as chromosomes, each chromosome contains M elements which correspondingly represent the execution condition of M tasks on the local terminal or the idle terminals, the decision samples A.sub.1 and A.sub.2 are respectively marked as a parent individual 1 and a parent individual 2, the positions of the chromosome and the position of a crossing node on the chromosome are randomly selected, and the expression is as follows: (θ.sub.1, θ.sub.2) where θ.sub.1 represents the position of the chromosome in the parent individual to which the chromosome belongs, and θ.sub.2 represents the position of the crossing node in the chromosome; based on this position, a cross interchange is performed, first θ.sub.2 elements on first θ.sub.1−1 columns and a θ.sub.1-th column of the parent individual 1 and last M-θ.sub.2 elements on last N+1−θ.sub.1 columns and a θ.sub.1-th column of the parent individual 2 are combined to generate a new individual 1, last M−θ.sub.2 elements on last N+1 −θ.sub.1 columns and a θ.sub.1−th column of the parent individual 1 and first θ.sub.2 elements on first θ.sub.1−1 columns and a θ.sub.1−th column of the parent individual 2 are combined to generate a new individual 2, and the two new individuals are generated and are respectively marked as an offspring individual 1 and an offspring individual 2; after each cross-operation is completed, whether each offspring individual satisfies Σ.sub.n=0.sup.Nx.sub.m,n=1 is checked, if Σ.sub.n=0.sup.Nx.sub.m,n=0, it means that the computing tasks are missing, for the missing computing tasks, the idle terminals or the local terminal which can execute the missing computing tasks are randomly selected, if Σ.sub.n=0.sup.Nx.sub.m,n>1, it means that the computing tasks are repeated, the idle terminals or the local terminal which can execute the repeated computing tasks are randomly selected; S53, the mutation claim operation is implemented in the decision samples: based on the decision samples in the completed iterations, the decision samples that minimize the total overhead of the local terminal do not participate in the mutation operation, for other decision samples, the mutation operation is performed with a preset probability n, for the matrix corresponding to the decision sample, the position of the chromosome and the position of a mutation element on the chromosome are randomly selected, and the expression is as follows: (θ.sub.3, θ.sub.4) where θ.sub.3 represents the position of the chromosome in the individual to which the chromosome belongs, and θ.sub.4 represents the position of the mutant element on the chromosome; x.sub.(θ.sub.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0066]
[0067]
DETAILED DESCRIPTION OF THE EMBODIMENTS
[0068] The present disclosure will be further described with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical scheme of the present disclosure more clearly, and cannot be used to limit the scope of protection of the present disclosure.
[0069] Referring to
[0070] S1. Idle terminals in a preset range are detected by taking the local terminal as the center, and the computing power f.sub.n, energy consumption pricing φ.sub.n, maximum allowable energy consumption E.sub.max.sup.n, and channel state g.sub.n of the idle terminals are obtained, where n∈{1,2, . . . , N}, and N represents the total number of idle terminals.
[0071] S2. Based on the execution mode of the computing tasks on the local terminal, decision samples are constructed.
[0072] S3. Respectively for the decision samples, based on the processing delay function t.sub.m of the computing tasks, where m∈{1,2, . . . , M}, M represents the total number of computing tasks, the total computing energy consumption function E.sub.loc for the local terminal processing the computing tasks assigned by the decision tasks, the transmission energy consumption function E.sub.n.sup.tran for the idle terminals involved in the decision samples respectively receiving the computing tasks assigned by the decision samples, where n∈{1,2, . . . , N}, N represents the total number of idle terminals, and the fee charging function for the idle terminals respectively receiving the computing tasks of the local terminal, the total overhead objective function and constraint conditions of the local terminal corresponding to the decision samples are determined.
[0073] S4. Respectively for the decision samples, the upper limit of the transmission delay between the local terminal corresponding to the decision samples and the idle terminals and the lower limit of the delay between the local terminal and the idle terminals are calculated, and the optimal transmission delay function corresponding to the decision samples is determined under constraint conditions; and
[0074] respectively for the decision samples, the total overhead of the local terminal corresponding to the decision samples is calculated based on the total overhead objective function and constraint conditions of the local terminal corresponding to the decision samples and the optimal transmission delay function corresponding to the decision samples under the constraint conditions.
[0075] S5. The decision samples that minimize the total overhead of the local terminal are selected with the goal of minimizing the total overhead of the local terminal through a preset number of iterations, and the allocation of the computing tasks on the local terminal is completed based on the decision samples.
[0076] According to the multi-task joint computing unloading and resource allocation method based on D2D (Device-to-Device) communication disclosed by the embodiment of the present disclosure, the specific steps of constructing decision samples in step S2 are as follows:
[0077] S21. computing tasks on a local terminal are represented by a set Γ={T.sub.1, T.sub.2, . . . T.sub.M}, wherein the total number of the computing tasks is represented by M, the attributes of the computing tasks are represented by a set {C.sub.m, D.sub.m, L.sub.m}, wherein C.sub.m represents the total number of CPU cycles required to process the computing tasks, D.sub.m represents the data volume of the computing tasks, L.sub.m represents the maximum delay allowed by the computing tasks, wherein m∈{1,2, . . . , M}, and M represents the total number of computing tasks;
[0078] S22. idle terminals are sorted and numbered in descending order according to channel gains thereof, the channel gains of the idle terminals satisfy the requirement of g.sub.1≥ . . . ≥g.sub.n≥ . . . ≥g.sub.N, wherein g.sub.n represents the channel gain of one of the idle terminals, n∈{1,2, . . . , N}, N represents the total number of idle terminals, and the idle terminals are presented by a set Λ={1,2, . . . , N};
[0079] S23. respectively for one computing task T.sub.m among the computing tasks on the local terminal, wherein m∈{1,2, . . . , M}, and M represents the total number of computing tasks, the execution mode of the computing task T.sub.m is constructed as follows:
[0080] {x.sub.m,0, x.sub.m,1, . . . x.sub.m,n, . . . x.sub.m,N},
[0081] where x.sub.m,n represents the execution mode of the computing task T.sub.m, wherein n∈{1,2, . . . , N}, N represents the total number of idle terminals, x.sub.m,0=1 represents that the computing task T.sub.m is processed at the local terminal, x.sub.m,0=0 represents that the computing task T.sub.m is not processed at the local terminal, x.sub.m,n=1 represents that computing task T.sub.m is unloaded to the idle terminal n for processing, x.sub.m,n=0 represents that the computing task T.sub.m is not processed on the idle terminal n, and the execution mode of each computing task in computing task sets on the local terminal satisfies Σ.sub.n=0.sup.Nx.sub.m,n=1, that is, each computing task can only be processed on an idle terminal or the local terminal; and
[0082] S24. respectively for the computing tasks on the local terminal, the decision samples are constructed based on the execution mode of the computing tasks on the local terminal, each of the decision samples is represented by a matrix A with M rows and N+1 columns, and the matrix A is as follows:
[0083] wherein the first column in the matrix A represents the execution condition of the computing tasks on the local terminal, and the second column to the (N+1)-th column represent the execution condition of the computing tasks unloaded to the idle terminals, and when the decision sample of one computing task is constructed, whether the idle terminals satisfy energy consumption limit is determined.
[0084] According to the multi-task joint computing unloading and resource allocation method based on D2D (Device-to-Device) communication disclosed by the embodiment of the present disclosure, the specific steps of determining the total overhead objective function and constraint conditions of the local terminal in step 3 are as follows:
[0085] S31. respectively for each decision sample, the number of computing tasks on the local terminal and the idle terminals is represented by a set {K.sub.0, K.sub.1, . . . , K.sub.N}, the computing tasks are processed on the idle terminals or the local terminal in a serial mode, and the computing tasks on the local terminal are arranged in descending order according to the maximum allowable delay L.sub.m, and are represented by a set S.sub.0={S.sub.0,1, S.sub.0,2, . . . , S.sub.0,K.sub.
[0086] S32, the total computing energy consumption function E.sub.loc for the local terminal processing the computing tasks assigned by the decision tasks is calculated, and the transmission energy consumption function E.sub.n.sup.tran for the idle terminals involved in the decision samples respectively receiving the computing tasks assigned by the decision samples are as follows:
E.sub.loc=Σ.sub.m=1.sup.Mx.sub.m,0μC.sub.m,
E.sub.n.sup.tran=t.sub.tran.Math.P.sup.tot,
[0087] where μ represents the energy consumed in each CPU cycle, t.sub.tran represents the transmission time for the local terminal to unload the computing tasks to the idle terminals, and P.sup.tot represents the minimum total transmission power of the local terminal;
[0088] wherein the decision x is executed based on the computing tasks corresponding to the decision samples, and the relationship between the transmission time t.sub.tran for the local terminal to unload the computing tasks to the idle terminals and the minimum total transmission power P.sup.tot of the local terminal is as follows:
[0089] where g.sub.n represents the n-th idle terminal, g.sub.n-1 represents the (n−1)-th idle terminal, g.sub.N represents the N-th idle terminal, and g.sub.n-1≥g.sub.n≥g.sub.N, W represents the bandwidth of a transmission channel, n.sub.0 represents the power spectral density of white noise, and k represents the serial number of the idle terminal;
[0090] S33. one computing task T.sub.m among the computing tasks on the local terminal is unloaded to the idle terminal n, and the expression of the processing delay t.sub.m of the computing task T.sub.m is as follows:
[0091] where f.sub.loc represents the computing power of the local terminal, f.sub.n represents the computing power of the idle terminals, that is, the number of CPU cycles per second that the local terminal or the idle terminals can handle, S.sub.n(m) represents the position of the computing task T.sub.m in the set S.sub.n, S.sub.0(m) represents the position of the computing task T.sub.m in the set S.sub.0 and i represents the serial number of the computing task in the set S.sub.0 or the S.sub.n;
[0092] S34. while the local terminal unloads the computing tasks to the idle terminals, the local terminal needs to pay a fee to the idle terminals as a commission, a fee-charging function Mon.sub.n for the idle terminals respectively receiving the computing tasks of the local terminal is calculated as follows:
Mon.sub.n=φ.sub.n log.sub.2(1+Σ.sub.i=S.sub.
[0093] where φ.sub.n represents the pricing of unit energy consumption of the idle terminal n, and is related to the maximum allowable energy consumption E.sub.max.sup.n of the idle terminal n, the computing power f.sub.n of the idle terminal n, and the value emphasizing factor η.sub.n of the idle terminal n for energy, and the specific relationship is as follows:
[0094] S34. based on the processing delay t.sub.m of the computing task T.sub.m, the total computing energy consumption function E.sub.loc for the local terminal processing the computing tasks assigned by the decision tasks, the transmission energy consumption function E.sub.n.sup.tran for the idle terminals involved in the decision samples respectively receiving the computing tasks assigned by the decision samples, and the fee-charging function Mon.sub.n for the idle terminals respectively receiving the computing tasks of the local terminal, the total overhead objective function of the local terminal corresponding to the decision samples is determined as follows:
[0095] constraint conditions are as follows:
[0096] (1) t.sub.m≤L.sub.m ∀m∈{1, 2, . . . , M}
[0097] (2) Σ.sub.m=S.sub.
[0098] (3) P.sup.tot≤P.sub.max
[0099] (4) α+β+γ=1
[0100] (5) α, β, γ∈(0, 1), t.sub.tran>0, x.sub.m,n∈{0,1}
[0101] where P.sub.max represents the maximum transmission power of the local terminal, E.sub.max.sup.n represents the maximum allowable energy consumption of the idle terminal n, α, β and γ respectively represent the weight coefficients of the local terminal for the processing delay, the energy consumption, and the fee charging corresponding to the idle terminals respectively receiving the computing tasks of the local terminal, the three aspects respectively reflect the local terminal's emphasis on the processing delay, the energy consumption and unloading fee, the formula (1) guarantees that all computing tasks must be completed within the maximum time limit of the computing tasks, the formula (2) limits the maximum energy of the idle terminals, which can be used for computing, the formula (3) is the limit for the transmission power of the local terminal, the formula (4) specifies the relationship among the processing delay coefficient, the energy consumption coefficient, and the unloading fee coefficient, and the formula (5) limits the range of values of α, β, γ.
[0102] According to the multi-task joint computing unloading and resource allocation method based on D2D (Device-to-Device) communication disclosed by the embodiment of the present disclosure, the specific steps of determining the optimal transmission delay function corresponding to the decision samples in step S4 are as follows:
[0103] S41. respectively for each decision sample, the upper limit t.sub.tran.sup.up of transmission delay between the local terminal and the idle terminals is calculated as follows:
[0104] where Δ.sub.n represents the upper limit of the transmission delay between the local terminal and the idle terminal n and is specifically shown in the following formula:
[0105] where t′.sub.m represents the delay of the computing task T.sub.m on the local terminal or the idle terminals, and is specifically shown in the following formula:
[0106] S42. based on the maximum transmission power P.sub.max of the local terminal, the lower limit t.sub.tran.sup.low of transmission delay between the local terminal and the idle terminals is calculated according to the following formula:
[0107] S43. based on the maximum transmission power P.sub.max of the local terminal, the transmission delay t′.sub.tran which minimizes the total overhead of the local terminal corresponding to the decision samples is calculated according to the following formula:
[0108] S44. based on the upper limit t.sub.tran.sup.up of the transmission delay and the lower limit t.sub.tran.sup.low of the transmission delay between the local terminal and the idle terminals, the optimal transmission delay function t*.sub.tran is determined:
[0109] if t.sub.tran.sup.up≥t.sub.tran.sup.low, it means that there is t.sub.tran which can make loaded computing tasks be completed within the constraint time, then it will be discussed as follows:
[0110] (1) if t.sub.tran.sup.up≥t.sub.tran.sup.low and t.sub.tran.sup.low≤t′.sub.tran, t*.sub.tran=min{t′.sub.tran, t*.sub.tran};
[0111] (2) if t.sub.tran.sup.up≥t.sub.tran.sup.low and t.sub.tran.sup.low>t′.sub.tran, t*.sub.tran=t.sub.tran.sup.low;
[0112] if t.sub.tran.sup.up<t.sub.tran.sup.low, it means that at present, there are some of loaded computing tasks which cannot be completed on time, then it will be discussed as follows:
it means that all the unloaded computing tasks cannot be completed within the delay limit, then t′.sub.tran=max{t.sub.tran.sup.low, t′.sub.tran};
it means that part of the computing tasks can be completed within the delay constraint, and for the computing tasks that can be completed on time, according to the step S41, the upper limit of the transmission delay between the local terminal and the idle terminals is recalculated and is recorded as t.sub.tran.sup.up*;
[0113] (1) if t.sub.tran.sup.up*<t′.sub.tran, t*.sub.tran=t.sub.tran.sup.up*;
[0114] (2) if t.sub.tran.sup.up*≥t′.sub.tran, t*.sub.tran=max{t.sub.tran.sup.low, t′.sub.tran};
[0115] S45, the processing delay t*.sub.m of the computing task T.sub.m based on the optimal transmission delay function t*.sub.tran is obtained by bringing the optimal transmission delay function t*.sub.tran into the processing delay t*.sub.m expression of the computing task T.sub.m, and based on the total overhead objective function of the local terminal corresponding to the decision samples, the total overhead of the local terminal corresponding to the decision samples is obtained as follows:
[0116] where σ represents a preset penalty value, if there are computing tasks that cannot be completed on time, the preset penalty value σ is added based on the total overhead objective function of the local terminal corresponding to the decision samples.
[0117] According to the multi-task joint computing unloading and resource allocation method based on D2D (Device-to-Device) communication disclosed by the embodiment of the present disclosure, the specific steps of selecting the decision samples that minimize the total overhead of the local terminal with the goal of minimizing the total overhead of the local terminal through a preset number of iterations and completing the allocation of the computing tasks on the local terminal in step S5 are as follows:
[0118] S51. different decision samples are used to participate in the iterations, the computing tasks on the local terminal are allocated according to the decision samples, the maximum number of iterations is preset, whether the preset maximum number of iterations is reached is determined, and if the preset maximum number of iterations is reached, the decision samples in each iteration that minimize the total overhead of the local terminal are selected to allocate the computing tasks on the local terminal are allocated;
[0119] if the preset maximum number of iterations is not reached, step S52 is performed;
[0120] S52. cross-operation is performed in the decision samples: two decision samples are randomly selected from the decision samples and are marked as A.sub.1 and A.sub.2, the decision samples reflect the execution decision of each task, N+1 columns of vectors in the decision samples are regarded as chromosomes, each chromosome contains M elements which correspondingly represent the execution condition of M tasks on the local terminal or the idle terminals, the decision samples A.sub.1 and A.sub.2 are respectively marked as a parent individual 1 and a parent individual 2, the positions of the chromosome and the position of a crossing node on the chromosome are randomly selected, and the expression is as follows:
[0121] (θ.sub.1, θ.sub.2)
[0122] where θ.sub.1 represents the position of the chromosome in the parent individual to which the chromosome belongs, and θ.sub.2 represents the position of the crossing node in the chromosome; based on this position, a cross interchange is performed, first θ.sub.2 elements on first θ.sub.1−1 columns and a θ.sub.1−th column of the parent individual 1 and last M−θ.sub.2 elements on last N+1−81 columns and a θ.sub.1−th column of the parent individual 2 are combined to generate a new individual 1, last M−θ.sub.2 elements on last N+1−θ.sub.1 columns and a θ.sub.1−th column of the parent individual 1 and first θ.sub.2 elements on first θ.sub.1− 1 columns and a θ.sub.1−th column of the parent individual 2 are combined to generate a new individual 2, and the two new individuals are generated and are respectively marked as an offspring individual 1 and an offspring individual 2;
[0123] after each cross-operation is completed, whether each offspring individual satisfies Σ.sub.n=0.sup.Nx.sub.m,n=1 is checked, if Σ.sub.n=0.sup.Nx.sub.m,n=0, it means that the computing tasks are missing, for the missing computing tasks, the idle terminals or the local terminal which can execute the missing computing tasks are randomly selected, if Σ.sub.n=0.sup.Nx.sub.m,n>1, it means that the computing tasks are repeated, the idle terminals or the local terminal which can execute the repeated computing tasks are randomly selected;
[0124] S53, the mutation operation is implemented in the decision samples: based on the decision samples in the completed iterations, the decision samples that minimize the total overhead of the local terminal do not participate in the mutation operation, for other decision samples, the mutation operation is performed with a preset probability {circumflex over (m)}, for the matrix corresponding to the decision sample, the position of the chromosome and the position of a mutation element on the chromosome are randomly selected, and the expression is as follows:
[0125] (θ.sub.3, θ.sub.4)
[0126] where θ.sub.3 represents the position of the chromosome in the individual to which the chromosome belongs, and θ.sub.4 represents the position of the mutant element on the chromosome;
[0127] x.sub.(θ.sub.
[0128] S54. for the decision samples, and other decision samples obtained through cross-operation and mutation operation, the total overhead of the local terminal corresponding to the decision samples is calculated, and the optimal original population number of samples are selected to build a sample group to participate in iterations until the preset maximum number of iterations is reached.
[0129] The embodiments of the present disclosure are described above in detail with reference to the accompanying drawings, but the present disclosure is not limited to the above embodiments, and various changes can be made without departing from the purposes of the present disclosure and within the scope of knowledge of those ordinary skill in the art.