Energy-Efficient and Security-Enhanced Task Offloading Method in D2D Integrated MEC Networks
By adopting energy-saving and security-enhanced task unloading methods in the D2D integrated MEC network, combined with system model and planning problems, the problems of energy efficiency, delay optimization and security improvement during multi-device task unloading are solved, and efficient and secure task unloading effects are achieved.
Patent Information
- Application Number
- CN202510481198.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-04-17
AI Technical Summary
The prior art is difficult to improve the security of task offloading based on energy efficiency and delay optimization when multiple IoT devices are simultaneously unloading tasks.
The energy-saving and security-enhanced task offloading method in the D2D integrated MEC network is adopted, and the system decision-making is optimized to achieve energy efficiency, delay optimization and security improvement by deploying system models, communication models, computational offloading models and security models, combined with mixed integer nonlinear planning problems.
It realizes that when multiple IoT devices are unloaded simultaneously, the system energy efficiency and security are improved, the complexity of traditional security protocols is avoided, and energy consumption and risks are reduced.
Smart Images

Figure CN120034841B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of edge computing, and particularly relates to an energy-saving and security-enhanced task offloading method in a D2D integrated MEC network. Background Art
[0002] With the rapid development of the Internet of Things (IoT), the demand for low latency and high-efficiency computing has increased significantly. Mobile Edge Computing (MEC) has become a key technology to improve the performance of IoT systems. In a cellular network, computing offloading through D2D communication between edge devices can effectively reduce task latency and improve energy efficiency.
[0003] The huge development of the Internet of Things (IoT) has made it one of the leading technologies in recent years. It has deeply influenced many industries, including automotive, health, energy, and consumer electronics. It has also made a significant contribution to global economic growth. However, IoT devices usually face challenges such as limited battery capacity and insufficient computing power. With the increase in data volume and the rapid growth of different types of devices, tasks that require a large amount of computing resources become increasingly complex. These tasks include augmented reality (AR), real-time video processing, etc., making it more important to meet computing latency and improve energy efficiency.
[0004] To address these challenges, researchers have proposed computing offloading, that is, migrating complex tasks to more capable network nodes. This approach has led to the development of computing methods such as cloud computing, mobile edge computing (MEC), and fog computing. These technologies effectively overcome the limitations of IoT devices by cross-layer distributing computing resources from the cloud to the network edge, meeting the requirements of low-latency and energy-saving data processing. Although cloud servers provide huge computing power, data transmission to the cloud often introduces significant latency, making it unsuitable for real-time or large-scale online tasks. MEC deploys cloud resources closer to users or devices (such as BS and edge servers) to effectively reduce transmission latency. However, the computing resources and bandwidth of MEC servers are limited. When multiple IoT devices perform task offloading simultaneously, network congestion and queuing latency become inevitable, and most existing research focuses on energy efficiency and latency optimization while ignoring security issues.
[0005] Therefore, how to improve the existing task offloading process so that when multiple IoT devices perform task offloading simultaneously, the security of task offloading can be enhanced on the basis of achieving energy efficiency and latency optimization is a technical problem that urgently needs to be solved at present. Summary of the Invention
[0006] The object of the present invention is to provide an energy-saving and security-enhanced task offloading method in a D2D integrated MEC network, which is used to improve the existing task offloading process, so that when multiple Internet of Things devices perform task offloading simultaneously, the security of task offloading can be enhanced on the basis of achieving energy efficiency and latency optimization.
[0007] To solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0008] An energy-saving and security-enhanced task offloading method in a D2D integrated MEC network includes the following steps:
[0009] S1: Deploy a system model: Deploy a wireless base station BS at the center. An MEC server is installed in the wireless base station BS. Within the coverage area of the MEC server, H edge devices are deployed V 1, ··· V h , ···, V H , and each edge device has a preset security level and computing power. There are K mobile users within the coverage of BS U 1, ··· U k , ···, U K , and each mobile user generates an indivisible compute-intensive task M k ;
[0010] S2: Deploy a communication model: Mobile users and edge devices establish connections with the wireless base station BS through cellular links. The wireless base station BS obtains the channel state information CSI and the real-time distances from the mobile users and edge devices through feedback d kh ;
[0011] S3: Create a computing offloading model: Based on the communication model, mobile users upload tasks to edge devices through D2D links or perform local processing; when uploading tasks to edge devices, the task completion time includes the task transmission time and the time spent on V h executing the task, and the required energy consumption is the transmission energy consumption when the user uploads the task and the standby energy consumption of the user when the task is executed on V h ; when the task is locally processed by the user, both the time and energy consumption are based on the user itself;
[0012] S4: Create a security model: When offloading tasks, each mobile user transmits tasks to edge devices through D2D links, and a specified security level is assigned to each edge device S h, the radio base station BS adjusts the security level of the edge device according to the behavior of the edge device and security events at each preset time interval S h , for each offloading decision from a mobile user to an edge device, a corresponding non - negative security risk value is defined to represent the magnitude of the risk value when the task is processed by the device, and the offloading decision is determined based on the security risk value;
[0013] S5: Create a system cost model: Normalize the energy consumption of each mobile user, normalize the risk of each decision, take the weighted sum of the normalized energy consumption and the normalized risk as the decision cost of the mobile user, and create a mixed - integer non - linear programming problem to find the offloading decision and the corresponding transmission power for each user;
[0014] S6: Optimize the system decision model: According to the constraint conditions, convert the mixed - integer non - linear programming problem into a linear programming problem, obtain a dynamic decision - making strategy based on the weighted risk - energy cost matrix, and process the dynamic decision - making strategy through a preset heuristic algorithm to meet the engineering requirements.
[0015] Preferably, in step S1, each mobile user generates an indivisible compute - intensive task M k The formula:
[0016] M k ={ N k , C k , D k , G k};
[0017] Among them, N k is the size of the task input data, in bits, C k is the total number of CPU cycles required to complete the task, D k is the maximum tolerable delay, in s as the unit, G k is the security requirement level of the task M k .
[0018] Preferably, in step S1, it also includes constructing a dynamic optimization problem based on the computing resources, task requirements, and security level of the system during the iterative process of multiple preset time intervals. The specific process is as follows:
[0019] S11: Define a binary offloading decision from a mobile user U k to an edge device V h , i.e., α kh , α kh ∈ {0, 1}. When α kh = 1, the mobile user offloads the computing task to the edge device through D2D communication V h for processing. When α kh = 0, the mobile user U k does not offload the task to the edge device V h , but offloads the task to another edge device or processes it locally;
[0020] S12: Represent the user itself as the ( H + 1)-th virtual device, α k(H+1) indicating that the mobile user executes the task locally. Based on the fact that each task must be assigned a location for execution, establish a constraint for each mobile user U k and define the offloading decision matrix : :
[0021] ;
[0022] S13: Based on the task processing quality, ensure that each edge device accepts at most one mobile user's task at the same time, and establish the corresponding constraint as:
[0023] .
[0024] Preferably, the specific process of deploying the communication model in step S2 is as follows:
[0025] S21: Based on the data transmission time, assume that the position of the mobile user remains unchanged during data transmission. When α kh = 1, define the offloading power of the mobile user U k to the edge device V h as p kh , and establish the offloading power of the mobile user U k to the edge device V hMinimum upload power Calculation formula:
[0026] ;
[0027] Wherein, p $P_0$ is the reference power, d $d_0$ is the reference distance, n $\alpha$ is the path loss exponent, which is adjusted according to different channel conditions, d kh $u$ is the mobile user U k to the edge device V h transmission distance;
[0028] S22: Based on the offloading power p kh cannot exceed the maximum upload power of the user p k max , and D2D is short-range communication, with a maximum transmission distance d max , establish the constraint condition of the offloading power p kh :
[0029] ;
[0030] Wherein, p k max = p 0· ( d max / d $d_0$) n , p $P_0$ is the reference power, d $d_0$ is the reference distance, d max $d_{max}$ is the maximum transmission distance, n $\alpha$ is the path loss exponent, α kh $u$ is from the mobile user U k to the edge device V h binary offloading decision, $u$ is the mobile user U k to the edge device V h minimum upload power, p k max $P_{max}$ is the maximum upload power of the user;
[0031] S23: Establish a mobile user U k to the edge device V h of the upload data transmission rate R kh formula:
[0032] ;
[0033] wherein, R kh is the upload data transmission rate of the mobile user U k to the edge device V h ; B kh is the mobile user U k offloading tasks to the edge device V h channel bandwidth, is the mobile user U k to the edge device V h channel gain, obtained through channel measurement, set to remain unchanged during offloading, N 0 represents the noise power spectral density.
[0034] Preferably, the specific process of creating a computational offloading model in step S3 is as follows:
[0035] S31: When α kh = 1, according to the communication model, establish the upload time U k for the mobile user V h to transmit task data to the edge device formula:
[0036] ;
[0037] wherein, N k is the size of the task input data, R kh is the upload data transmission rate of the mobile user U k to the edge device V h ;
[0038] S32: Establish the time for executing task data on the edge device V h The formula:
[0039] ;
[0040] Wherein, represents the CPU frequency of the edge device V h of the CPU frequency, C k is the total number of CPU cycles required to complete the task;
[0041] S33: Establish the formula for the total energy consumption of the computing task offloading process:
[0042] ;
[0043] Wherein, E kh is the total energy consumption of the task offloading process, is the energy consumption of data transmission, is the mobile user U k of the standby energy consumption, is the mobile user U k of the standby power;
[0044] S34: When α k(H+1) = 1, the mobile user U k uses its own CPU to process the task, that is, local processing, and establishes the formula for its task processing time T k(H+1) The formula:
[0045] ;
[0046] S35: Establish the formula for the energy consumption of local processing:
[0047] ;
[0048] Wherein, represents the mobile user U k of the CPU frequency, C k represents the total number of CPU cycles required to complete the task, represents the energy consumption per CPU cycle, in joules, which is a superlinear function of the CPU frequency, .
[0049] Preferably, the specific process of creating the security model in step S4 is as follows:
[0050] S41: Define each mobile userU k to the edge device V h non - negative security risk value of the offloading decision to establish a non - negative security risk value calculation formula:
[0051] ;
[0052] wherein, J take the maximum value of the upper limit of task security requirements and the upper limit of device security level, to ensure the consistency of the two measurement criteria and the rationality of risk calculation, G k is the task M k security requirement level, S h is the security level of the edge device;
[0053] S42: Establish a risk matrix:
[0054] ;
[0055] wherein, represents the security risk when executing M k locally, that is, the (H + 1) - th column in the risk matrix corresponds to local processing and the value is 0;
[0056] S43: Combine the offloading decision matrix to establish the total risk formula generated by all users:
[0057] .
[0058] Preferably, the specific process in step S5 is as follows:
[0059] S51: Based on each single preset time interval, establish the actual energy consumption formula generated after each mobile user U k makes a decision:
[0060] ;
[0061] wherein, , represents the energy consumption when the task is executed locally by the mobile user U k , is the inherent value based on the characteristics of the task and the user's own resources, and is the reference energy consumption for each user, reflecting the energy consumption gap between D2D offloading and local execution;
[0062] S52: For each mobile userU k Normalize the actual energy consumption generated after decision-making. The specific formula is:
[0063] ;
[0064] S53: The maximum value of e For each mobile user U k Normalize the actual risk generated after decision-making. The specific formula is:
[0065] ;
[0066] S54: Establish the total normalized environmental energy consumption formula:
[0067] ;
[0068] S55: Establish the total normalized environmental risk formula:
[0069] ;
[0070] S56: Establish a formal expression for the model optimization problem:
[0071]
[0072] where C 11 Indicates that when the task is offloaded to the specified edge device, the delay requirement is met, C 12 and C 13 Respectively constrain the mobile user offloading power p kh and the upload data transmission rate R kh variables, C 14 Determine α kh is a binary variable, C 15 Ensure that each task is executed locally or on an edge device, C 16 Ensure that the edge device accepts at most one user's task, Is the total system cost generated after decision-making in a preset time interval, where Is the weight coefficient, , α kh 、 p kh andR kh is a variable, and the others are constants.
[0073] Preferably, the specific process of the optimized system decision model in step S6 is as follows:
[0074] S61: According to the constraint C 12 , when α kh = 1, establish the upload data transmission rate that meets the delay requirement R kh conditional formula:
[0075] ;
[0076] Establish the formula for the minimum transmission rate that meets the delay requirement:
[0077] ;
[0078] Invert the minimum transmission rate , and the specific formula is:
[0079] ;
[0080] Express the minimum transmission power that meets the delay requirement as:
[0081] ;
[0082] Establish the constraint condition for the mobile user offloading power p kh :
[0083] ;
[0084] Based on simultaneously meeting the offloading demand and the delay demand, the mobile user offloading power p kh is not less than and , and the actual minimum transmission power is:
[0085] ;
[0086] S62: Replace C 12 and C 13 with the following constraints:
[0087] ;
[0088] S63: When At this time, the normalized energy consumption and normalized risk value generated by the mobile user U k are expressed as:
[0089] ;
[0090] ;
[0091] Among them, and are constants. Substitute with , and we get:
[0092] ;
[0093] S64: The algorithm makes reach the minimum value to obtain the minimum system cost. Taking the mobile user offloading power p kh as the independent variable, as the dependent variable, establish the function :
[0094] ;
[0095] The function is a monotonically increasing function of the user offloading power p kh . To achieve minimum energy consumption, the algorithm sets the transmission power to the minimum value that the user offloading power p kh can reach, that is , which means that the offloading power used in each offloading process is fixed, and the only remaining system variable is the decision variable;
[0096] S65: Divide the offloading decision into three cases, calculate the corresponding cost , that is, the weighted sum of energy consumption and risk. Finally, solve based on the cost .
[0097] Preferably, the three cases in step S65 are specifically as follows:
[0098] The first case: , the mobile user U k can choose to offload the task to the edge device V h . The cost U k for the mobile user V h to offload the task to the edge device is expressed as:
[0099] ;
[0100] The second type: , the task can only be offloaded to another edge device or local processing, is set to a positive number greater than a preset threshold, representing an unacceptable cost to ensure that the algorithm does not consider this process;
[0101] The third type: The task is executed locally by the mobile user. Since the local energy consumption is normalized to 1 and the risk is 0, the cost of this decision only includes the energy consumption and depends on the weight coefficient , that is ;
[0102] Matrix is used to represent the costs generated by all decisions and is expressed as follows:
[0103] ;
[0104] Re-model the original problem:
[0105] ;
[0106] Among them, C 21 Determine α kh is a binary variable, C 22 ensuring that each task is executed locally or on an edge device, C 23 ensuring that the edge device accepts at most one user's task.
[0107] Preferably, step S6 further includes the following specific process:
[0108] S66: When the task data involves K mobile users and H edge devices, use the cost matrix as the input of the algorithm, initialize the offloading decision matrix A of size K×(H + 1) K×(H+1) , set all elements to zero, use the input cost matrix , initialize the difference matrix of size K×(H + 1) , whose element represents the cost reduction for local processing for each D2D offloading decision, that is ;
[0109] S67: Select the largest element from the difference matrix , when the largest element is in the last column, corresponding to making a decision for local processing, set the offloading decision matrix Assign the decision variable at the corresponding position to , assign all elements in this row of the difference matrix to a very small value to ensure that the corresponding user will not be selected again, and update the difference matrix ;
[0110] When the maximum element is not in the last column, it corresponds to making a D2D offloading decision, and the offloading decision matrix Assign the decision variable at the corresponding position to , assign a specified value to all elements in the row and column where the corresponding element in the difference matrix is located, ensure that the corresponding user and edge device will not be selected again, and update the difference matrix , and repeat the execution until all decisions are made.
[0111] The beneficial effects of the present invention include:
[0112] The energy-saving and security-enhanced task offloading method in the D2D integrated MEC network provided by the present invention deploys a wireless base station in the center, and an MEC server is arranged inside the wireless base station. H edge devices and K mobile users are arranged within the range of the base station; a communication model is deployed: both mobile users and edge devices establish connections with the wireless base station BS through cellular links; based on the communication model, when offloading tasks, mobile users can upload tasks to edge devices through D2D links or process tasks locally; based on the decision-making cost, that is, the weighted value of offloading energy consumption and security risk, determine the offloading decision; model this problem as an optimization problem and convert it into an integer linear programming (ILP) problem that is easier to solve, and the best offloading decision can be obtained by solving this problem; based on this strategy, a low-complexity heuristic algorithm is designed to meet the engineering needs; a large number of experiments prove that the proposed strategy shows many advantages over the benchmark strategy, improving the system energy efficiency and security.
[0113] First, a risk assessment standard based on the security level of edge devices in the D2D integrated MEC network is set, and the energy consumption and security requirements of users are considered at the same time. The offloading problem in the D2D integrated MEC network is studied from both theoretical and engineering perspectives. By creating a dynamic security model based on the security level of edge devices and selecting edge computing servers with different security levels to meet the security requirements in the offloading decision, efficient risk management and resource allocation are achieved, avoiding the complexity of traditional security protocols, improving the security of the offloading process, and jointly optimizing the offloading decision and transmission power based on this security model.
[0114] Second, two strategies are proposed. One is the theoretical optimal solution based on solving the integer linear programming problem (ILP), and the other is a heuristic algorithm with a lower computational complexity suitable for practical engineering applications, which improves the security when tasks are processed by edge devices while achieving low task energy consumption and low latency.
[0115] Finally, although the original problem has been simplified to an integer linear programming problem, with the increase in the number of users K and the number of edge devices H, it may not meet the engineering requirements in scenarios with large scale and high real-time requirements. Therefore, by designing a heuristic algorithm with lower complexity, the problem of not meeting the engineering requirements is solved. Brief Description of the Drawings
[0116] Figure 1 It is a diagram showing the costs of two strategies of the present invention and the remaining benchmark strategies under different task scales.
[0117] Figure 2 It is a diagram showing the comparison of energy consumption of two strategies of the present invention and the remaining benchmark strategies under different task scales.
[0118] Figure 3 It is a diagram showing the comparison of risks of two strategies of the present invention and the remaining benchmark strategies under different task scales.
[0119] Figure 4 It is a diagram showing the costs of the comparison between 2D-WREC of the present invention and AES-BS at different scales.
[0120] Figure 5 It is a diagram showing the energy consumption and risk at 50 meters under two strategies of the present invention and the remaining benchmark strategies.
[0121] Figure 6 It is a diagram showing the energy consumption and risk at 350 meters under two strategies of the present invention and the remaining benchmark strategies.
[0122] Figure 7 It is a diagram showing the proportion of risk in the total cost of the optimal strategy of the present invention in environments with different energy consumption weights and security risks. Detailed Description of the Invention
[0123] The following further elaborates on the present invention in conjunction with the attached Figures 1 to 7 drawings:
[0124] Embodiment 1
[0125] An energy-saving and security-enhanced task offloading method in a D2D integrated MEC network includes the following steps:
[0126] S1: Deploy the system model: Deploy a wireless base station BS at the center. An MEC server is installed in the wireless base station BS. Within the coverage area of the MEC server, H edge devices are arranged V 1, ··· V h , ···, V H, each edge device has a preset security level and computing power, and there are K mobile users within the coverage of the BS U 1, ··· U k , ···, U K , each mobile user generates an indivisible compute-intensive task M k ;
[0127] S2: Deploy the communication model: Mobile users and edge devices establish connections with the wireless base station BS through cellular links. The wireless base station BS obtains the channel state information CSI and the real-time distances of the mobile users and edge devices through feedback d kh ;
[0128] S3: Create a compute offloading model: Based on the communication model, mobile users upload tasks to edge devices through D2D links or perform local processing; when uploading tasks to edge devices, the task completion time includes the task transmission time and the time spent executing the task on V h The required energy consumption is the transmission energy consumption when the user uploads the task and the standby energy consumption of the user when the task is executed on V h When the task is processed locally by the user, both the time and energy consumption are based on the user itself;
[0129] S4: Create a security model: When offloading tasks, each mobile user transmits tasks to edge devices through D2D links, and assigns a specified security level to each edge device S h , and the wireless base station BS adjusts the security level of the edge device according to the behavior of the edge device and security events at each preset time interval S h , for each offloading decision from the mobile user to the edge device, define a corresponding non-negative security risk value to represent the risk value size of the task when processed by the device, and determine the offloading decision based on the security risk value;
[0130] S5: Create a system cost model: Normalize the energy consumption of each mobile user, normalize the risk of each decision, take the weighted sum of the normalized energy consumption and the normalized risk as the decision cost of the mobile user, and create a mixed-integer non-linear programming problem to find the offloading decision and the corresponding transmission power of each user;
[0131] S6: Optimize the system decision model: According to the constraint conditions, convert the mixed-integer non-linear programming problem into a linear programming problem, obtain a dynamic decision-making strategy based on the weighted risk-energy cost matrix, and process the dynamic decision-making strategy through a preset heuristic algorithm to meet the engineering requirements.
[0132] The energy-saving and security-enhanced task offloading process in the D2D integrated MEC network provided by the present invention is different from the prior art that mainly relies on encryption schemes or transmission protocols to enhance security. The security requirements in the offloading decision are achieved by selecting edge computing servers with different security levels. To achieve efficient risk management and resource allocation, a security model based on the security level of edge devices is proposed. This model avoids the complexity of traditional security protocols and improves the security of the offloading process. Based on this security model, the joint optimization of whether to offload, target device selection, and transmission power is carried out. A risk assessment criterion based on the security level is proposed, achieving the joint optimization of energy consumption and security. To solve this problem, it is first modeled as a mixed-integer non-linear programming (MINLP) problem; by optimizing the constraint conditions, it is transformed into an integer linear programming (ILP) problem to obtain the theoretical optimal solution. Considering the requirements of actual engineering applications, a heuristic algorithm with a relatively low computational complexity suitable for actual engineering applications is designed. The above task offloading strategy can be widely applied to the MEC-assisted D2D Internet of Things scenario to improve the energy efficiency and security of the system. The effectiveness of the proposed strategy is verified through a large number of simulation experiments, and the reference of weight setting in environments with different security levels is given. Simulation experiments are carried out under different scenario scales to verify the effectiveness and universality of the strategy.
[0133] Embodiment 2
[0134] Based on Embodiment 1, each mobile user generates an indivisible computationally intensive task in step S1 M k The formula of:
[0135] M k ={ N k , C k , D k , G k};
[0136] Wherein, N k is the size of the task input data, in bits, C kThe total number of CPU cycles required to complete the task, D k is the maximum tolerable latency, in s units of G k is the security requirement level of the task M k .
[0137] Deploy a wireless base station BS at the center. An MEC server is installed in the wireless base station BS. Within the coverage area of the MEC server, H edge devices are deployed V 1, ··· V h , ···, V H , each edge device has a preset security level and computing power. There are K mobile users within the coverage area of each edge device U 1, ··· U k , ···, U K , and each mobile user generates an indivisible compute-intensive task M k .
[0138] For example, highly sensitive tasks involving financial data and identity information in industrial Internet of Things have higher security levels. In contrast, ordinary monitoring data or sensor data have lower security requirements. The system involved in the present invention is a continuous dynamic environment. The time line is discretized into multiple preset time intervals. The generation and decision-making of tasks occur within a very short preset time interval. The system needs to decide whether to process the task locally by the user or offload the task to a nearby edge device through a D2D link for processing. The working environment of the system is continuous, covering multiple preset time intervals. New tasks are generated and old tasks are completed. The status of each user and edge device also changes as the preset time interval progresses. The offloading decision of the task is independent within each preset time interval, but is continuously made between different time intervals. Therefore, during the iteration process of multiple preset time intervals, factors such as the computing resources, task requirements, and security levels of the system will change at any time. The system will continuously make decisions based on the current state, constituting a complex dynamic optimization problem.
[0139] In this embodiment, in step S1, it further includes constructing a dynamic optimization problem based on the computing resources, task requirements, and security levels of the system during the iteration process of multiple preset time intervals. The specific process is as follows:
[0140] S11: Define a mapping from mobile users U k to edge devices Vh Binary offloading decision α kh , α kh ∈ {0, 1}, when α kh = 1, the mobile user offloads the computing task to the edge device through D2D communication V h for processing. When α kh = 0, the mobile user U k does not offload the task to the edge device V h , but offloads the task to another edge device or processes it locally;
[0141] S12: Represent the user itself as the ( H + 1)-th virtual device, α k(H+1) indicating that the mobile user executes the task locally. Based on the fact that each task must be assigned a location for execution, establish a constraint for each mobile user U k and define the offloading decision matrix A : K×(H+1) :
[0142] ;
[0143] S13: Based on the task processing quality, let each edge device accept at most one mobile user's task at the same time, and establish the corresponding constraint as:
[0144] .
[0145] Since the user itself is represented as the (H + 1)-th virtual device, the (H + 1)-th column of the offloading decision matrix A K×(H+1) does not correspond to a certain edge device, but represents the local computing resources of each user. In other words, each element in the (H + 1)-th column α k(H+1) represents whether the mobile user U k chooses to execute locally. Since local execution is independent for each user, inequality is allowed.
[0146] Embodiment 3
[0147] Based on Embodiment 1 or Embodiment 2, the specific process of deploying the communication model in step S2 is as follows:
[0148] S21: Set the position of the mobile user to remain unchanged during data transmission based on the data transmission time. When α kh = 1, define the offloading power of the mobile user U k to the edge device V h as p kh , and establish the calculation formula for the minimum upload power U k of the mobile user V h to the edge device :
[0149] ;
[0150] Among them, p 0 is the reference power, d 0 is the reference distance, n is the path loss exponent, which is adjusted according to different channel conditions, d kh is the transmission distance of the mobile user U k to the edge device V h ;
[0151] S22: Based on the fact that the offloading power p kh cannot exceed the maximum upload power of the user p k max , and D2D is short-range communication with a maximum transmission distance d max , establish the constraint condition for the offloading power p kh :
[0152] ;
[0153] Among them, p k max = p 0· ( d max / d 0) n , p 0 is the reference power, d 0 is the reference distance, d max is the maximum transmission distance, n is the path loss exponent, α khFor the binary offloading decision from a mobile user U k to an edge device V h ; for the minimum upload power from a mobile user to an edge device U k ; for the maximum upload power of the user V h ; p k max S23: Establish the formula for the upload data transmission rate from a mobile user
[0154] to an edge device U k : V h ; where R kh is the upload data transmission rate from a mobile user
[0155] ;
[0156] is the channel bandwidth when the mobile user R kh offloads the task to the edge device U k ; is the channel gain from a mobile user V h to an edge device B kh obtained through channel measurement and set to be constant during offloading U k ; 0 represents the noise power spectral density V h ; Example 4 U k Based on Example 1 or Example 2 or Example 3, a computing offloading model is established. In this study, since the amount of data in the result obtained after task calculation is much smaller than that before calculation, the time and energy consumption during downlink transmission of data are ignored V h ; The specific process of creating the computing offloading model in step S3 is as follows N :
[0157] S31: When
[0158] = 1, according to the communication model, establish the calculation of the mobile user
[0159] ;
[0160] ; α kh = 1, according to the communication model, establish the calculation of the mobile userU k Transfer the task data to the edge device V h Upload time Formula:
[0161] ;
[0162] Wherein, N k is the size of the task input data, R kh is the mobile user U k to the edge device V h Upload data transfer rate;
[0163] S32: Establish the formula for calculating the time to execute the task data on the edge device V h Time to execute the task data Formula:
[0164] ;
[0165] Wherein, represents the CPU frequency of the edge device V h CPU frequency, C k is the total number of CPU cycles required to complete the task;
[0166] S33: Establish the formula for calculating the total energy consumption of the task offloading process:
[0167] ;
[0168] Wherein, E kh is the total energy consumption of the task offloading process, is the data transfer energy consumption, is the mobile user U k Standby energy consumption, is the mobile user U k Standby power;
[0169] S34: When α k(H+1) = 1, the mobile user U k uses its own CPU to process the task, i.e., local processing, and establish the formula for its task processing time T k(H+1) Formula:
[0170] ;
[0171] S35: Establish the energy consumption formula for local processing:
[0172] ;
[0173] Wherein, represents the CPU frequency of the mobile user U k ; C k represents the total number of CPU cycles required to complete the task, represents the energy consumption per CPU cycle, in joules, which is a superlinear function of the CPU frequency, .
[0174] It should be noted that when a network failure occurs or the number of edge computing servers is insufficient, all tasks processed locally should still meet the delay tolerance requirements. Therefore, we assume that the condition always holds.
[0175] In this embodiment, when offloading tasks, the mobile user U k can transmit task data to the edge device through the D2D link. However, the edge device may face various attacks, which will affect its ability to execute tasks and even bring security risks. Therefore, a security scheme based on the device security level is adopted to improve the security of tasks when processed by the edge device.
[0176] Each edge device has a corresponding security level according to its own security characteristics S h , wherein . Processing tasks on devices with a high security level will have higher security. In addition, the BS adjusts the security level of the device according to factors such as the behavior of the device and security events at each preset time interval. Although the security level of the device remains unchanged during each decision-making, the security level changes between different preset time intervals, ensuring the accuracy and timeliness of the security assessment. Therefore, the system is dynamic.
[0177] The specific process of creating the security model in step S4 is as follows:
[0178] S41: Define the non-negative security risk value U k for the offloading decision of each mobile user V h to the edge device , and establish the calculation formula for the non-negative security risk value :
[0179] ;
[0180] Among them, J Take the maximum value between the upper limit of task safety requirements and the upper limit of device security level to ensure the consistency of the two measurement criteria and the rationality of risk calculation. G k For the task M k The safety requirement level of S h is the safety level of the edge device;
[0181] S42: Establish a risk matrix:
[0182] ;
[0183] Among them, represents the safety risk when executing M k locally, that is, the (H + 1)th column in the risk matrix corresponds to local processing and the value is 0;
[0184] S43: Combine the offloading decision matrix to establish the total risk formula generated by all users:
[0185] .
[0186] Example 5
[0187] Based on Example 1 or Example 2 or Example 3 or Example 4, the specific process in step S5 is as follows:
[0188] S51: Based on each single preset time interval, establish the actual energy consumption formula generated after the decision of each mobile user U k :
[0189] ;
[0190] Among them, , represents the energy consumption when the task is executed locally by the mobile user U k , is the baseline energy consumption for each user based on the characteristics of the task and the inherent value of the user's own resources, reflecting the energy consumption gap between D2D offloading and local execution;
[0191] S52: Normalize the actual energy consumption generated after the decision of each mobile user U k : The specific formula is:
[0192] ;
[0193] S53: The maximum value of e , for each mobile user U k Normalize the actual risk generated after the decision, and the specific formula is:
[0194] ;
[0195] S54: Establish the total normalized environmental energy consumption formula:
[0196] ;
[0197] S55: Establish the total normalized environmental risk formula:
[0198] ;
[0199] S56: Establish the formal expression of the model optimization problem:
[0200]
[0201] where C 11 means that when the task is offloaded to the specified edge device, the delay requirement is met, C 12 and C 13 respectively constrain the mobile user offloading power p kh and the upload data transmission rate R kh variables, C 14 determine α kh is a binary variable, C 15 ensure that each task is executed locally or on an edge device, C 16 ensure that the edge device accepts at most one user's task, is the total system cost generated after the decision in a preset time interval, where is the weight coefficient, , α kh , p kh and R khis a variable, and the others are constants. This problem is modeled as a Mixed-Integer Nonlinear Programming (MINLP) problem. Therefore, the model can not only handle the specific situation within each preset time interval but also adapt to the changes of the system in different preset time intervals through iterative updates, thus reflecting the dynamic characteristics of the model. The goal is to minimize the total system cost brought by the offloading decision, including the energy consumption and risk generated by the decision, under the constraint of meeting the delay requirement.
[0202] In this embodiment, the specific process of the optimization system decision model in step S6 is as follows:
[0203] S61: According to the constraint C 12 , when α kh = 1, establish the upload data transmission rate R kh condition formula that meets the delay requirement:
[0204] ;
[0205] Establish the formula for the minimum transmission rate that meets the delay requirement:
[0206] ;
[0207] Invert the minimum transmission rate , and the specific formula is:
[0208] ;
[0209] Express the minimum transmission power that meets the delay requirement as:
[0210] ;
[0211] Establish the constraint condition for the mobile user offloading power p kh :
[0212] ;
[0213] Based on simultaneously meeting the offloading demand and the delay demand, the mobile user offloading power p kh is not less than and , and the actual minimum transmission power is:
[0214] ;
[0215] S62: Substitute C12 and C 13 Replace with the following constraints:
[0216] ;
[0217] S63: When , the normalized energy consumption and normalized risk value generated by the mobile user U k are expressed as:
[0218] ;
[0219] ;
[0220] Among them, and are constants. Replace with , and get:
[0221] ;
[0222] S64: The algorithm minimizes the value of to obtain the minimum system cost. Taking the mobile user offloading power p kh as the independent variable and as the dependent variable, establish the function :
[0223] ;
[0224] The function is a monotonically increasing function of the user offloading power p kh . To achieve energy consumption minimization, the algorithm sets the transmission power to the minimum value that the user offloading power p kh can reach, that is , that is, the offloading power used in each offloading process is fixed, and the only remaining system variable is the decision variable;
[0225] S65: Divide the offloading decision into three cases, calculate the corresponding cost for each case, that is, the weighted sum of energy consumption and risk, and finally solve based on the cost .
[0226] The three cases in step S65 are specifically as follows:
[0227] The first: , the mobile user U k can choose to offload the task to the edge deviceV h , a mobile user U k offloads a task to an edge device V h The cost is expressed as:
[0228] ;
[0229] The second case: , the task can only be offloaded to another edge device or processed locally, is set to a positive number greater than a preset threshold, representing an unacceptable cost to ensure that the algorithm does not consider this process;
[0230] The third case: The task is executed locally by the mobile user. Since the local energy consumption is normalized to 1 and the risk is 0, the cost of this decision only includes the energy consumption and depends on the weight coefficient , that is ;
[0231] matrix is used to represent the costs generated by all decisions and is expressed as follows:
[0232] ;
[0233] Re-model the original problem:
[0234] .
[0235] Among them, C 21 Determine α kh is a binary variable, C 22 ensuring that each task is executed locally or on an edge device, C 23 ensuring that the edge device accepts tasks from at most one user.
[0236] In this problem, only is a binary decision variable, while all other parameters are constants. Using the branch and bound method, the theoretical optimal solution of the ILP problem can be obtained, and thus the offloading decision matrix can be obtained. Specifically, once the offloading decision matrix is determined, the value of each decision variable can be determined: If = 1, it means that the mobile user will offload the task to the edge device with the minimum transmission power ; if , it means that the mobile user executes the task locally. This policy can minimize the offloading cost of the system and reduce energy consumption and risks at the same time, which is called the dynamic decision-making policy based on the weighted risk-energy cost matrix.
[0237] Embodiment 6
[0238] Based on Embodiment 1 or Embodiment 2 or Embodiment 3 or Embodiment 4 or Embodiment 5, although the original problem has been simplified to an ILP problem, with the increase in the number of users K and the number of edge devices H, in scenarios with large scale and high real-time requirements, it may not meet the engineering requirements. Therefore, a heuristic algorithm with lower complexity is designed to solve this problem more efficiently.
[0239] Step S6 also includes the following specific processes:
[0240] S66: When the task data involves K mobile users and H edge devices, take the cost matrix as the input of the algorithm, initialize the offloading decision matrix A with size K×(H + 1) K×(H+1) , set all elements to zero, use the input cost matrix , initialize the difference matrix with size K×(H + 1) , and its element represents the cost reduction for local processing for each D2D offloading decision, that is ;
[0241] S67: Select the largest element from the difference matrix. When the largest element is in the last column, corresponding to making a local processing decision, assign the decision variable at the corresponding position of the offloading decision matrix to , assign all elements in this row of the difference matrix to a very small value to ensure that the corresponding user will not be selected again, and update the difference matrix ;
[0242] When the largest element is not in the last column, it corresponds to making a D2D offloading decision. Assign the decision variable at the corresponding position of the offloading decision matrix to , assign a specified value to all elements in the row and column where the corresponding element in the difference matrix is located to ensure that the corresponding user and edge device will not be selected again, and update the difference matrix , and repeat the execution until all decisions are made.
[0243] After obtaining the offloading decision matrix A K×(H+1) , the decision variables Value. In other words, the algorithm makes an approximately optimal offloading decision for the current preset time interval to minimize the cost brought by offloading. This heuristic algorithm is named the dynamic decision-making strategy based on the difference matrix.
[0244] Complexity analysis of SMSS-DM: First step, initialization and complexity . Second step, selecting the maximum element from the matrix requires checking all elements, so the time complexity is . In the first case, the time complexity of accessing and updating all (H + 1) elements in a row is O ( H + 1). In the second case, the time complexity of accessing and updating all elements in a row and a column is O ( H + 1). Iterate K times to complete all decisions. The main complexity of the iteration depends on selecting the maximum element from the matrix , that is, . Therefore, the overall time complexity is .
[0245] Extensive simulations were carried out and evaluated by comparing with several benchmark strategies. The ILP problem was simulated on the Python-based emulator Gurobi. A processor with an Intel(R) Core(TM) i7-10870H CPU 5.0 GHz and 16 GB RAM capacity was used. It is assumed that in a 5G scenario, a base station is deployed at the cell center with a coverage radius of 100m. K users and 40 edge devices are randomly distributed in the cell environment. The CPU frequency of each user is randomly assigned from GHz, and the CPU frequency of each device is randomly assigned from GHz to simulate their heterogeneous computing capabilities. The data volume of each task is set to {1, 2, 3, 4, 5} Mb, and 200 M CPU cycles are required for each Mb of data processing. The tolerable latency is randomly generated as seconds. The security requirements of the tasks and the security levels of the edge devices start from {0, 1, 2, ···, 5}, and the larger the range, the higher the granularity. Among them, the security levels of the edge devices follow a normal distribution with a mean of 4 and a variance of 2. The remaining simulation parameters are set as shown in Table 1. In the simulation, the 3GPP path loss model is used, and the path loss between any user and the edge device is calculated by the following formula:
[0246] ;
[0247] where, dkh For U k to V h the distance, 3.5 is the 5G communication frequency (GHz), and the channel gain can be obtained through calculation.
[0248] Table 1 Simulation Parameters
[0249]
[0250] The proposed scheme is compared with four benchmark strategies to evaluate different metrics and analyzed according to system requirements. The specific benchmark strategies are as follows:
[0251] 1. Local processing: The tasks of all users are processed locally without offloading tasks.
[0252] 2. Distance-based offloading strategy: Users preferentially offload tasks to the physically nearest edge device. This strategy assumes that the device closest to the user provides the minimum transmission delay and energy consumption, but does not consider the security of the device.
[0253] 3. Offloading strategy without security measures: The offloading decision is only based on the energy consumption of the current environment, which is equivalent to setting the energy consumption weight factor in 2D-WREC to 1 without considering security.
[0254] 4. Polling algorithm: By polling the cost matrix, each user selects an available device with the minimum cost value to process tasks, as a reference for comparison with the SMSS-DM algorithm.
[0255] With the number of edge devices fixed at 40 and the weight set to 0.5 (no preference), the number of users K is increased from 10 to 50, and six schemes are compared and simulated. By replacing the random number seed (from 1 to 50) for 50 rounds of simulation, the average value is taken to obtain the final result. Refer to Figure 1 , the 2D-WREC of the present invention always shows a lower cost than other strategies. When the number of users is 50, the cost of 2D-WREC is reduced by 39.93%, 30.26%, 12.67%, and 12.16% compared with local processing, distance-based, without security measures, and polling algorithms respectively. The SMSS-DM algorithm shows good performance at different K values and is superior to the polling algorithm. Although local processing can be risk-free, its cost is always at a high level due to excessive energy consumption.
[0256] Comparing only the cost values of different strategies is not comprehensive enough, as it can only reflect the overall situation of energy consumption and risk. To separately observe the energy consumption in the offloading cost, Figure 2Shows the comparison of the normalized energy consumption of the system under different strategies. The case of no security measure corresponds to the extreme situation of 2D-WREC with a weight of 1, that is, only considering how to obtain the minimum energy consumption of the system, which can be used as the upper bound of energy consumption optimization. This strategy always maintains a relatively low energy consumption level, verifying the effectiveness of this method in optimizing energy consumption. The energy consumption based on distance is lower because a shorter offloading distance usually corresponds to lower energy consumption. The energy consumption of the heuristic algorithm SMSS-DM is slightly higher than that of the polling algorithm because, under the current weight, the heuristic algorithm SMSS-DM performs better in optimizing risk.
[0257] The risk generated by the offloading decision is a key indicator for evaluating the effectiveness of the offloading strategy. To separately observe the optimization of risk in the offloading cost, Figure 3 Illustrates the comparison of several strategies in terms of system risk. Local processing has no data transmission and the risk is zero. The distance-based offloading strategy has an advantage in terms of energy consumption, but due to not considering the security of the offloading decision, it generates a relatively high risk value. Compared with 2D-WREC without weight preference, the offloading strategy without security measures generates almost twice the risk. When the energy consumption weight of 2D-WREC is further reduced, the difference in risk between the two will become more obvious, which is verified in the subsequent simulation results, further proving the effectiveness of the offloading strategy of the present invention in terms of security. The heuristic algorithm SMSS-DM has a lower risk because it is only a fitting of 2D-WREC, aiming to minimize the cost brought by the offloading decision, and risk is only part of the offloading cost. When the heuristic algorithm SMSS-DM performs better than 2D-WREC in terms of risk, it will perform worse than 2D-WREC in terms of energy consumption.
[0258] The experimental results show that the performance of the heuristic algorithm SMSS-DM is better than that of the polling algorithm. The heuristic algorithm SMSS-DM can save a large amount of time compared with directly solving the ILP problem. As the task scales K and H increase, the percentage of computing time (speedup ratio) will change. Although the acceleration effect of the heuristic algorithm SMSS-DM fluctuates on the scale of K = H = 50, it shows an obvious time optimization effect on all scales. When the problem scale is large, that is, K = H = 1000, the computing time can be saved by about 85%. This result indicates that the heuristic algorithm SMSS-DM brings higher efficiency and is particularly suitable for large-scale computing tasks.
[0259] As Figure 4As shown, when the number of edge devices is small, the offloading cost of AES-BS is smaller. This is because the relatively high CPU frequency of the BS provides a faster processing speed, which results in less standby time and standby energy consumption. At the same time, random AES encryption can also reduce the risk of offloading decisions. However, as the number of users increases, the computing resources of the base station become strained, and many tasks have to be processed locally by users, leading to a rapid increase in the system cost. With the increase in the number of edge devices, D2D offloading gradually shows obvious advantages, as it can provide more computing resources to support task offloading. At the same time, different from MEC which has only one fixed offloading path, D2D offloading provides multiple alternative paths, effectively splitting the CPU resources of the base station into multiple edge device resources, improving the flexibility and resource utilization rate of the system.
[0260] In terms of security, although AES encryption effectively improves the security of MEC offloading, it also brings additional energy consumption overhead. In contrast, the 2D-WREC strategy can make full use of edge device resources, and the improvement in security is achieved by selecting edge devices with a higher security level for offloading, without increasing additional encryption energy consumption.
[0261] 2D-WREC controls the attention to energy consumption and risk metrics by adjusting the energy consumption weight. Observe the changes in system energy consumption and risk under the three weights of 0.25, 0.5, and 0.75. As Figure 5 shown, when the energy consumption weight increases, the system energy consumption gradually decreases while the risk increases, verifying the effectiveness of the weight setting. No matter how the weights are adjusted, the 2D-WREC algorithm can always obtain the minimum cost value, that is, the weighted sum of energy consumption and risk, in the same environment.
[0262] Set the system radius to 200 m and adjust the maximum D2D transmission distance to 350 m. Figure 6 Similar results are shown, further proving that the strategy of the present invention has good generalization ability.
[0263] Although the impact of weight changes on energy consumption and risk has been intuitively demonstrated, in practical applications, it is still a challenge to determine a suitable weight to balance energy consumption and risk. For this reason, the present invention simulates scenarios under different risk levels by adjusting the average security level of edge devices. The role of the system in reducing security risks is reflected by observing the proportion of the normalized risk in the total offloading cost of the system. See Figure 7In a high-security-risk environment, that is, the security levels of edge devices are generally low. If the energy consumption weight is set to 1, thus not paying attention to the offloading risk, the risk value can reach up to 4% of the offloading cost. If the energy consumption weight is reduced so that the system pays more attention to reducing the offloading risk, the offloading risk can be as low as 21% of the REC of the offloading cost. In contrast, in a low-risk environment, even if the energy consumption weight is high, the proportion of the risk value in the offloading cost still remains at a very low level.
[0264] In summary, for the energy-saving and security-enhanced task offloading method in the D2D integrated MEC network provided by the present invention, a wireless base station is deployed in the center, an MEC server is installed in the wireless base station, and H edge devices are arranged. There are K mobile users within the coverage range of each edge device; a communication model is deployed: the mobile users establish connections with the wireless base station BS through cellular links between the mobile users and the edge devices; based on the communication model, the mobile users upload tasks to the edge devices through D2D links; when offloading tasks, each mobile user transmits tasks to the edge devices through D2D links, and an offloading decision is determined based on the security risk value; constraint conditions for the optimization problem are created, and the optimization problem is converted into an ILP problem that is easier to solve to create an upload rate and a minimum transmission rate that meet the delay requirements, and a dynamic decision-making strategy based on the weighted risk-energy cost matrix is obtained; the best offloading strategy is obtained, improving the energy efficiency and security of the system.
[0265] By presenting a security assessment method in the D2D integrated MEC network, the offloading problem in the D2D integrated MEC network is studied from both theoretical and engineering perspectives based on the energy consumption and security requirements of users. Two strategies are proposed. One is the theoretical optimal solution based on solving the integer linear programming problem, and the other is a heuristic algorithm with a lower computational complexity suitable for practical engineering applications. While achieving low task energy consumption and low latency, the security of task processing on edge devices is improved. By creating a dynamic security model based on the security level of edge devices and realizing the security requirements in the offloading decision by selecting edge computing servers with different security levels, efficient risk management and resource allocation are achieved, avoiding the complexity of traditional security protocols and improving the security of the offloading process. Based on this security model, the joint optimization of whether to offload, the target server for offloading, and the transmission power is carried out. To simplify the complex constraint conditions in the original problem, based on the characteristics of the problem, it is transformed into an ILP problem that is easier to solve, effectively reducing the system computational complexity. Although the original problem has been simplified to an ILP problem, with the increase in the number of users K and the number of edge devices H, in scenarios with large scale and high real-time requirements, it may not meet the engineering requirements. Therefore, by designing a heuristic algorithm with a lower complexity, the problem that may not meet the engineering requirements is solved more efficiently.
Claims
1. Energy-saving and security-enhanced task offloading method in D2D integrated MEC network, characterized in that: The following steps are involved: S1: Deployment system model: Deploy wireless base stations BS in the center, set up MEC servers in the wireless base stations BS, and deploy H edge devices in the coverage area of the MEC servers V 1,··· V h ,···, V H , each edge device has a preset security level and computing power, and there are K mobile users within the coverage area of BS U 1,··· U k ,···, U K , each mobile user generates an indivisible computationally intensive task M k ; S2: Deployment communication model: Mobile users and edge devices establish a connection with the wireless base station BS through a cellular link. The wireless base station BS obtains the channel state information CSI and the real-time distance between the mobile user and the edge device through feedback. d kh ; S3: Create a computation offloading model: Based on the communication model, mobile users upload tasks to edge devices or process them locally through D2D links; when tasks are uploaded to edge devices V h The task completion time includes the task transmission time and V h The time it takes to execute a task on the network, and the energy consumption required is the transmission energy consumption when the user uploads the task and the energy consumption of the task on the network. V h The user's standby energy consumption during execution; When the task is processed locally by the user, the time and energy consumption are based on the user himself; S4: Create a security model: When offloading tasks, each mobile user transmits the task to the edge device through the D2D link, and assigns a specified security level to each edge device. S h The wireless base station BS adjusts the security level of the edge device at each preset time interval according to the behavior and security events of the edge device. S h , for each offloading decision from a mobile user to an edge device, define the corresponding non-negative security risk value To indicate the risk value of the task when it is processed by the device, the offloading decision is determined based on the safety risk value; S5: Create a system cost model: normalize the energy consumption of each mobile user, normalize the risk of each decision, take the weighted sum of the normalized energy consumption and the normalized risk as the decision cost of the mobile user, and create a mixed integer nonlinear programming problem to find the offloading decision and corresponding transmission power of each user; S6: Optimize the system decision model: According to the constraints, convert the mixed integer nonlinear programming problem into a linear programming problem to obtain a dynamic decision strategy based on the weighted risk-energy cost matrix, and process the dynamic decision strategy through a preset heuristic algorithm to meet engineering requirements.
2. The energy-saving and security-enhanced task offloading method in a D2D integrated MEC network according to claim 1, characterized in that: In step S1, each mobile user generates an indivisible computationally intensive task M k The formula is: M k ={ N k , C k , D k , G k}; in, N k The size of the task input data, in bits. C k The total number of CPU cycles required to complete the task, D k is the maximum tolerable delay, s As a unit, G k For the task M k level of security requirements.
3. The energy-saving and security-enhanced task offloading method in a D2D integrated MEC network according to claim 2, characterized in that: Step S1 also includes constructing a dynamic optimization problem based on the system's computing resources, task requirements, and security level during the iteration process at multiple preset time intervals. The specific process is as follows: S11: Define a mobile user U k To edge devices V h The binary unloading decision α kh , α kh ∈{0,1}, when α kh =1, mobile users offload computing tasks to edge devices through D2D communication V h To process, when α kh =0, mobile user U k Do not offload tasks to edge devices V h , but instead offload the task to another edge device or process it locally; S12: The user itself is represented as ( H +1) virtual device, α k(H+1) Indicates that mobile users perform tasks locally. Each task must be assigned a location for execution. U k Establishing constraints , define the uninstallation decision matrix A K×(H+1) : ; S13: Based on the task processing quality, each edge device is required to accept at most one task from a mobile user at the same time, and the corresponding constraints are established as follows: 。 4. The energy-saving and security-enhanced task offloading method in a D2D integrated MEC network according to claim 3, characterized in that: The specific process of deploying the communication model in step S2 is as follows: S21: Based on the data transmission time setting, the position of the mobile user remains unchanged during the data transmission process. α kh =1, defines mobile users U k To edge devices V h The unloading power is p kh , establish mobile user U k To edge devices V h Minimum upload power The calculation formula is: ; in, p 0 is the reference power, d 0 is the reference distance, n is the path loss index, which is adjusted according to different channel conditions. d kh For mobile users U k To edge devices V h Transmission distance; S22: Based on unloading power p kh Cannot exceed the user's maximum upload power p k max , and D2D is a short-range communication with a maximum transmission distance d max , establish unloading power p kh Constraints: ; in, p k max = p 0· ( d max / d 0) n , p 0 is the reference power, d 0 is the reference distance, d max is the maximum transmission distance, n is the path loss exponent, α kh For mobile users U k To edge devices V h The binary unloading decision For mobile users U k To edge devices V h The minimum upload power, p k max The maximum upload power of the user; S23: Create a mobile user U k To edge devices V h Upload data transfer rate R kh The formula is: ; in, R kh For mobile users U k To edge devices V h Upload data transfer rate, B kh Is a mobile user U k Offloading tasks to edge devices V h The channel bandwidth, For mobile users U k To edge devices V h The channel gain is obtained through channel measurement and set remain unchanged during uninstallation, N 0 represents the noise power spectral density.
5. The energy-saving and security-enhanced task offloading method in a D2D integrated MEC network according to claim 4, characterized in that: The specific process of creating the calculation offloading model in step S3 is as follows: S31: When α kh =1, according to the communication model, establish the calculation of mobile users U k Transmitting task data to edge devices V h Upload time The formula is: ; in, N k The size of the input data for the task, R kh For mobile users U k To edge devices V h Upload data transfer rate; S32: Building Computing on Edge Devices V h The time when the task data is executed The formula is: ; in, Representing edge devices V h CPU frequency, C k The total number of CPU cycles required to complete the task; S33: Establish the total energy consumption formula of the computing task offloading process: ; in, E kh is the total energy consumption of the task offloading process, is the energy consumption for data transmission, For mobile users U k Standby power consumption, For mobile users U k Standby power; S34: When α k(H+1) =1, mobile user U k Use your own CPU to process tasks, that is, local processing, and establish its task processing time T k(H+1) The formula is: ; S35: Establish the energy consumption formula for local processing: ; in, Represents mobile users U k CPU frequency, C k Indicates the total number of CPU cycles required to complete the task. represents the energy consumption per CPU cycle in joules, which is a superlinear function of the CPU frequency. .
6. The energy-saving and security-enhanced task offloading method in a D2D integrated MEC network according to claim 5, characterized in that: The specific process of creating a security model in step S4 is as follows: S41: Define each mobile user U k To edge devices V h Non-negative safety risk value of the offloading decision , establish a non-negative safety risk value The calculation formula is: ; in, J The maximum value of the upper limit of the task safety requirement and the upper limit of the equipment safety level is taken to ensure the consistency of the two metrics and the rationality of the risk calculation. G k For the task M k The security requirement level S h The security level of the edge device; S42: Establish a risk matrix: ; in, Indicates local execution M k The safety risk at this time, that is, the (H+1) column in the risk matrix corresponds to local processing and the value is 0; S43: Combined with the uninstall decision matrix, the total risk formula generated by all users is established: 。 7. The energy-saving and security-enhanced task offloading method in a D2D integrated MEC network according to claim 6, characterized in that: The specific process in step S5 is as follows: S51: Establishing a time interval for each mobile user U k The actual energy consumption formula after decision making is: ; in, , Indicates that the task is performed by a mobile user U k Energy consumption when executing locally, It is the baseline energy consumption for each user based on the characteristics of the task and the inherent value of the user's own resources, reflecting the energy consumption gap between D2D offloading and local execution; S52: For each mobile user U k The actual energy consumption generated after the decision is normalized, and the specific formula is: ; S53: The maximum value of e , for each mobile user U k The actual risk generated after the decision is normalized, and the specific formula is: ; S54: Establish the total normalized environmental energy consumption formula: ; S55: Establish the overall normalized environmental risk formula: ; S56: Establish a formal expression for the model optimization problem: in, C 11 Indicates that when the task is offloaded to the specified edge device, the latency requirement is met. C 12 and C 13 Unload power to mobile users separately p kh and upload data transfer rates R kh The variables are constrained. C 14 Sure α kh is a binary variable, C 15 Ensure that each task is executed locally or on an edge device, C 16 Ensure that the edge device accepts tasks from at most one user. is the total system cost after making a decision in a preset time interval, where is the weight coefficient, , α kh , p kh and R kh are variables, the others are constants.
8. The energy-saving and security-enhanced task offloading method in a D2D integrated MEC network according to claim 7, characterized in that: The specific process of the optimization system decision model in step S6 is as follows: S61: According to the constraints C 12 ,when α kh =1, establish an upload data transmission rate that meets the latency requirements R kh Conditional formula: ; Establish the minimum transmission rate that meets the latency requirements The formula is: ; Minimum transmission rate Perform the inverse solution, the specific formula is: ; The minimum transmission power that will meet the delay requirement It is expressed as: ; Establish mobile user offload power p kh Constraints: ; Based on meeting both the offloading demand and the delay demand, the mobile user offloading power p kh Not less than and , get the actual minimum transmission power for: ; S62: C 12 and C 13 Replace it with the following constraints: ; S63: When When the mobile user U k The resulting normalized energy consumption and normalized risk value are expressed as: ; ; in, and is a constant, Replace with ,get: ; S64: Algorithm The value of is minimized to obtain the minimum system cost, so that mobile users can unload power p kh is the independent variable, As the dependent variable, establish the function : ; function Is the user unloading power p kh A monotonically increasing function, in order to minimize energy consumption, the algorithm sets the transmission power to the user unloading power p kh The minimum achievable value is , that is, the unloading power used in each unloading process is fixed, and the only remaining system variable is the decision variable; S65: Divide the unloading decision into three cases and calculate the corresponding cost for each case , which is the weighted sum of energy consumption and risk, and finally based on the cost To solve.
9. The energy-saving and security-enhanced task offloading method in a D2D integrated MEC network according to claim 8, characterized in that: The three situations in step S65 are as follows: The first one: , mobile users U k Option to offload tasks to edge devices V h , mobile users U k Offloading tasks to edge devices V h The cost It is expressed as: ; Second type: ,The task can only be offloaded to another edge device or processed locally, is set to a positive number greater than a preset threshold, indicating an unacceptable cost, to ensure that the algorithm does not consider the process; The third type: The task is executed locally on the mobile user. Since the local energy consumption is normalized to 1 and the risk is 0, the cost of this decision only includes energy consumption, which depends on the weight coefficient ,Right now ; matrix It is used to represent the cost of all decision generation, which is expressed as follows: ; Remodel the original problem: ; in, C 21 Sure α kh is a binary variable, C 22 Ensure that each task is executed locally or on an edge device, C 23 Ensure that edge devices only accept tasks from one user at most.
10. The energy-saving and security-enhanced task offloading method in a D2D integrated MEC network according to claim 9, characterized in that: Step S6 also includes the following specific process: S66: When the task data involves K mobile users and H edge devices, the cost matrix As the input of the algorithm, initialize the offloading decision matrix A of size K×(H+1) K×(H+1) , set all elements to zero, and use the input cost matrix , initialize the difference matrix of size K×(H+1) , whose elements represents the cost reduction of each D2D offloading decision for local processing, that is, ; S67: Select the largest element from the difference matrix , when the largest element is in the last column, it corresponds to making a local processing decision, which will unload the decision matrix The decision variable at the corresponding position is assigned , assign all elements of this row of the difference matrix to a very small value to ensure that the corresponding user will not be selected again, and update the difference matrix ; When the maximum element is not in the last column, it corresponds to making a D2D offloading decision, and the offloading decision matrix The decision variable at the corresponding position is assigned , assign a specified value to all elements in the row and column of the corresponding element in the difference matrix to ensure that the corresponding user and edge device will not be selected again, and update the difference matrix , and repeat until all decisions are made.