Task offloading and resource allocation method and device based on mobile edge computing
By adopting task offloading and resource allocation methods based on mobile edge computing in wireless domain networks, and using deep neural networks and convex optimization algorithms to optimize offload decisions, the data transmission delay and processing efficiency problems caused by human mobility and wireless channel in wireless domain networks are solved, and efficient data processing and communication are achieved.
Patent Information
- Application Number
- CN202210707409.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-06-21
AI Technical Summary
In wireless body domain networks, due to the human body mobility and surrounding unstable wireless channels, different task offload strategies will affect the data transmission delay and the data processing efficiency of the entire network.
A task offloading and resource allocation method based on mobile edge computing is proposed. By building a system communication model, energy acquisition model, and computing efficiency model, and using deep neural networks and convex optimization algorithms, offloading decisions and resource allocation are optimized to achieve optimal data processing and communication efficiency.
It realizes that different data processing needs are met in the wireless domain network, reduces data processing delays, and improves the computing efficiency and communication efficiency of the network.
Smart Images

Figure CN115314903B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communication technology, and in particular to a method and device for task offloading and resource allocation based on mobile edge computing. Background Art
[0002] In a wireless body area network, a variety of sensor nodes deployed on the surface of the human body or implanted in the body can monitor the vital signs of the human body in real time. Then the sensed data can be sent to the background server for analysis through wireless communication technology. The analysis results can assist medical staff in making rapid and accurate diagnosis and treatment, thus realizing a non-contact remote intelligent medical system. In recent years, with the rapid development of wireless communication technology, wireless body area network, as an important supporting technology for realizing intelligent medical care, has attracted widespread attention from all walks of life and has become a research hotspot. With the gradual improvement of the intelligent medical system, a huge amount of data will be generated every day to be processed and analyzed. However, the computing and processing capabilities of the wireless body area network itself are very limited, far from meeting the needs of intelligent medical care. In response to the problems of limited energy saving and limited data processing capabilities of micro-sensors in wireless body area networks, researchers have proposed a variety of solutions, among which energy harvesting technology and mobile edge computing can effectively solve these two problems respectively. In energy harvesting technology, sensor nodes can capture energy from the radio frequency signals transmitted by wireless access AP nodes in the surrounding environment for their own perception and calculation, and use backscatter communication to transmit the perception information to the AP node. In mobile edge computing, the computing and data processing capabilities of edge servers are much greater than those of sensor nodes. Therefore, sensor nodes can choose to process data locally or offload data to edge servers for fast processing. However, due to the influence of human mobility and unstable wireless channels around, different offloading strategies will affect the data transmission delay and the data processing efficiency of the entire network. Summary of the invention
[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0004] To this end, the first purpose of this application is to propose a task offloading and resource allocation method based on mobile edge computing, which solves the technical problem that the existing methods are affected by human mobility and unstable surrounding wireless channels, and different offloading strategies will affect the data transmission delay and the data processing efficiency of the entire network, so as to meet the processing requirements of different data, reduce data processing delay, and improve the computing efficiency of the network.
[0005] The second object of the present application is to provide a computer device.
[0006] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a task offloading and resource allocation method based on mobile edge computing. First, an energy harvesting wireless body area network system is constructed, wherein the energy harvesting wireless body area network system includes an edge server, a wireless access AP node, and a wireless body area network set, and the wireless body area network set is composed of micro sensor nodes. On this basis, the above-mentioned task offloading and resource allocation method based on mobile edge computing includes: constructing a system communication model; constructing an energy harvesting model of the sensor node according to the system communication model; constructing a first computing efficiency model of the task in the local processing mode and a second computing efficiency model in the edge processing mode according to the energy harvesting model; constructing a third computing efficiency model of the entire wireless body area network according to the first computing efficiency model and the second computing efficiency model; constructing a deep neural network and training it to obtain a trained deep neural network; inputting the link gain set between the sensor node and the wireless access AP node into the trained deep neural network, and outputting a candidate offloading decision set; converting the decision problem into a convex optimization problem according to the third computing efficiency model and the candidate offloading decision set; and performing convex optimization on the offloading decisions in the candidate offloading decision set to obtain the optimal offloading decision and resource allocation scheme.
[0007] The task offloading and resource allocation method based on mobile edge computing in the embodiment of the present application selects the optimal offloading decision and resource allocation method, so that all data tasks of the wireless body area network can be processed as quickly as possible, reducing the energy consumption and latency of the nodes, thereby improving the data processing capability and communication efficiency of the entire wireless body area network.
[0008] Optionally, in one embodiment of the present application, the edge server and the AP node are connected to each other via a wired link, and the AP node and the wireless body area network sensor node are connected via a wireless link. A communication process is divided into an energy collection phase and a data processing phase, and a system communication model is constructed, including:
[0009] In the energy collection phase, radio frequency signals are broadcast through AP nodes, and energy collection technology is used at sensor nodes to capture energy from radio frequency signals within a specified time;
[0010] In the data processing stage, the sensor node processes the data locally or offloads it according to the optimal offloading decision. If the data is offloaded, it is sent to the AP node according to the allocated offloading time and processed by the edge server connected to the AP node.
[0011] Optionally, in one embodiment of the present application, constructing an energy collection model for a sensor node includes:
[0012] Define a communication process duration as T, and the energy collection phase accounts for a proportion of b 0∈(0,1), then in a communication process, the energy collected by the i-th sensor node is:
[0013] E i =μPg i b 0 T
[0014] Among them, μ∈(0,1) represents the energy collection efficiency of the sensor node, P represents the transmission power of the AP node, and g i represents the link gain between sensor node i and AP node.
[0015] Optionally, in one embodiment of the present application, constructing a first computing efficiency model of a task in a local processing mode includes:
[0016] In the local processing mode, the total energy consumed by the sensor node to calculate the data cannot exceed the energy obtained in the energy collection phase, which is expressed as:
[0017] k i f i 3 t i ≤E i
[0018] Among them, E i represents the energy collected by the i-th sensor node, k i represents the computational energy efficiency coefficient of sensor node i, f i represents the CPU frequency of node i, 0≤t i ≤T represents the computation time of node i;
[0019] In the data processing stage, the node computing efficiency in the local processing mode is expressed as:
[0020]
[0021] Among them, C L,i represents the computational efficiency of node i, φ is the number of computational cycles required for the sensor node to process unit data, T is the duration of the communication process, and f i represents the CPU frequency of node i, 0≤t i ≤T represents the computation time of node i;
[0022] According to the node calculation efficiency, the maximum calculation efficiency of the node is calculated as:
[0023]
[0024] in, represents the maximum computational efficiency of node i at t i =T,f i =(E i / (k i T)) 1 / 3 When you get
[0025] Optionally, in one embodiment of the present application, constructing a second computing efficiency model of a task in an edge processing mode includes:
[0026] In the edge computing mode, time division multiplexing is used in the data processing stage, and the time length allocated to node i is defined as b. i ∈(0,1), then the processing time constraint of the sensor node in the edge processing mode is:
[0027]
[0028] Wireless communication technology is used to offload tasks to the edge server through sensor node i. According to Shannon's formula, the node i is obtained at b i The maximum amount of data transmitted within T time D i for:
[0029]
[0030] Where B represents the bandwidth of the wireless channel between the sensor node and the AP node, P i represents the transmission power of sensor node i, N 0 represents the noise power;
[0031] In the energy-harvesting wireless body area network, when the sensor node uses all the collected energy for task offloading, the maximum computing power is obtained, and the maximum computing efficiency of the node in the edge processing mode is further obtained, which is expressed as:
[0032]
[0033] in, Indicates the maximum computing efficiency of node i in edge processing mode. When the maximum computing power is P i =E i / b i T get
[0034] Optionally, in one embodiment of the present application, the third computing efficiency model of the entire wireless body area network is:
[0035]
[0036] in a i ∈{0,1} represents the offloading decision of node i, a i = 0 means that node i executes tasks locally, a i=1 means the node offloads the task to the edge server for execution.
[0037] Optionally, in one embodiment of the present application, a deep neural network is constructed and trained to obtain a trained deep neural network, including:
[0038] Initialize the deep neural network parameter set, and use the ReLU function and the sigmoid function as the hidden layer activation function and output layer activation function of the deep neural network respectively;
[0039] Use an initially empty memory with limited capacity;
[0040] The optimal offloading decision output by solving the convex optimization problem and the link gain input to the deep neural network are added to the end of the memory as a set of training samples;
[0041] After each training interval, a batch of training samples are randomly extracted from the memory to train the deep neural network;
[0042] After the set number of training times is completed, the trained deep neural network is obtained.
[0043] Among them, the loss function used to train the deep neural network is:
[0044]
[0045] Among them, S represents the randomly extracted training samples, |S| represents the size of S, represents a pair of training samples, Represents the transpose operation of a matrix.
[0046] Optionally, in one embodiment of the present application, a link gain set between a sensor node and a wireless access AP node is input into a trained deep neural network, and a candidate offloading decision set is output, including:
[0047] The link gain set between the sensor node and the AP node is input into the deep neural network, and a loose offloading decision set is obtained according to the current offloading strategy of the deep neural network.
[0048] The Order-Preserving Quantization method is used to split and process the loose unloading decision set to obtain the candidate unloading decision set.
[0049] Optionally, in one embodiment of the present application, the candidate offloading decision sets are respectively brought into the third computational efficiency model of the entire wireless body area network, the decision problem is converted into a convex optimization problem, and the Bisection-Lagrange algorithm is used for convex optimization solution to obtain the optimal offloading decision and resource allocation solution.
[0050] To achieve the above-mentioned purpose, the second aspect of the present invention proposes a computer device, comprising: a processor; a memory for storing instructions executable by the processor; when the instructions in the memory are executed by the processor, the above-mentioned task offloading and resource allocation method based on mobile edge computing can be executed.
[0051] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0053] Figure 1 A flowchart of a task offloading and resource allocation method based on mobile edge computing provided in Example 1 of the present application;
[0054] Figure 2 A schematic diagram of a wireless body area network model according to an embodiment of the present application;
[0055] Figure 3 A schematic diagram of the deep neural network training loss of an embodiment of the present application;
[0056] Figure 4 It is a simulation diagram of the ratio of the wireless body area network aggregate total computing efficiency to the optimal total computing efficiency according to an embodiment of the present application. DETAILED DESCRIPTION
[0057] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0058] The following describes the task offloading and resource allocation method and device based on mobile edge computing in an embodiment of the present application with reference to the accompanying drawings.
[0059] The present application first constructs an energy harvesting wireless body area network system, including a wireless body area network set and a mobile edge computing module. The mobile edge computing module includes an edge server MES, an AP node, and a wireless body area network set, and the wireless body area network set includes a number of sensor nodes. The AP node and the edge server MES are interconnected through a wired link, and the AP node and the wireless body area network set are interconnected through a wireless link. The mutual communication between the AP node and the edge server MES is conducive to the communication between the edge server MES and the wireless body area network, and is conducive to the unloading of tasks on the edge server MES. The mutual connection between the AP node and the wireless body area network set through a wireless link is conducive to the AP node sending a radio frequency signal to the wireless body area network set for the wireless body area network set to collect energy. The edge server MES of the mobile edge computing module is connected to the wireless body area network set through the AP node, thereby constructing a wireless body area network based on mobile edge computing. Data calculation through the edge server MES improves the computing power of the wireless body area network based on mobile edge computing. The wireless body area network set can only communicate with the edge server MES through the AP node.
[0060] This application is based on the constructed energy harvesting wireless body area network system to perform task offloading and resource allocation based on mobile edge computing.
[0061] Figure 1 A flowchart of a task offloading and resource allocation method based on mobile edge computing provided in Example 1 of the present application.
[0062] like Figure 1 As shown, the task offloading and resource allocation method based on mobile edge computing includes the following steps:
[0063] Step 101, constructing a system communication model;
[0064] Step 102, constructing an energy collection model of the sensor node according to the system communication model;
[0065] Step 103, constructing a first computing efficiency model of the task in the local processing mode and a second computing efficiency model of the task in the edge processing mode according to the energy collection model;
[0066] Step 104, constructing a third computing efficiency model of the entire wireless body area network according to the first computing efficiency model and the second computing efficiency model;
[0067] Step 105, constructing a deep neural network and training it to obtain a trained deep neural network;
[0068] Step 106, inputting the link gain set between the sensor node and the wireless access AP node into the trained deep neural network, and outputting a candidate offloading decision set;
[0069] Step 107, converting the decision problem into a convex optimization problem according to the third computing efficiency model and the candidate offloading decision set;
[0070] Step 108 , performing convex optimization on the offloading decisions in the candidate offloading decision set respectively to obtain the optimal offloading decision and resource allocation solution.
[0071] The task offloading and resource allocation method based on mobile edge computing in the embodiment of the present application selects the optimal offloading decision and resource allocation method, so that all data tasks of the wireless body area network can be processed as quickly as possible, reducing the energy consumption and latency of the nodes, thereby improving the data processing capability and communication efficiency of the entire wireless body area network.
[0072] Optionally, in one embodiment of the present application, the wireless body area network is composed of a plurality of micro sensor nodes. The edge server and AP nodes are connected to each other through wired links, and the AP nodes and wireless body area network sensor nodes are connected through wireless links.
[0073] A communication process is divided into two stages: the first stage is the energy collection stage; the second stage is the data processing stage.
[0074] Construct an energy harvesting wireless body area network communication model, including:
[0075] In the first stage, the AP broadcasts the RF signal, and the sensor node uses energy harvesting technology to capture energy from the RF signal within a specified time. In the second stage, the sensor node processes the data locally or offloads it according to the optimal offload decision. If offloading is required, the data is sent to the AP node according to the allocated offload time and processed by the edge server connected to the AP node.
[0076] Optionally, in one embodiment of the present application, constructing an energy collection model for a sensor node includes:
[0077] Define a communication process duration as T, and the energy collection phase accounts for a proportion of b 0 ∈(0,1). Then in a communication process, the energy collected by the i-th sensor node is:
[0078] E i =μPg i b 0 T (1)
[0079] Among them, μ∈(0,1) represents the energy collection efficiency of the sensor node, P represents the transmission power of the AP node, and g i Represents the link gain between sensor node i and AP node. Assume that the link gain of uplink and downlink is the same and remains unchanged during a communication process. The link gain of different communication processes is variable.
[0080] Optionally, in one embodiment of the present application, constructing a first computing efficiency model of a task in a local processing mode includes:
[0081] In the local computing mode, let k i represents the computational energy efficiency coefficient of sensor node i, f i represents the CPU frequency of node i, 0≤t i ≤T represents the computing time of node i, then the total energy consumed by the sensor node to calculate data cannot exceed the energy E obtained in the energy collection phase i ,thus
[0082] k i f i 3 t i ≤E i (2)
[0083] Let the number of computation cycles required for the sensor node to process unit data be φ. Then, in the data processing stage, in the local processing mode, the total number of bits processed by node i is f. i t i / φThe computational efficiency of node i is expressed as:
[0084]
[0085] In formula (3), the efficiency C is calculated L,i With the calculation time t i Monotonically increasing, it can be seen that when t i =T, the corresponding f i =(E i / (k i T)) 1 / 3 , t i , f i Substituting (1) into (6), we can get the maximum computational efficiency of node i:
[0086]
[0087] Optionally, in one embodiment of the present application, constructing a second computing efficiency model of a task in an edge processing mode includes:
[0088] In the edge computing mode, in order to avoid interference between unloaded data between different sensor nodes, time division multiplexing (TDM) is used in the data processing stage, and the time length allocated to node i is defined as b i ∈(0,1), then the processing time constraint of the sensor node in the edge processing mode is:
[0089]
[0090] Sensor node i offloads the task to the edge server using wireless communication technology. According to Shannon’s formula, we can get i The maximum amount of data transmitted within T time D i for:
[0091]
[0092] Where B represents the wireless channel bandwidth between the sensor node and the AP node, P i represents the transmission power of sensor node i, N 0 represents the noise power;
[0093] In energy-harvesting wireless body area networks, when the sensor node uses all the collected energy for task offloading, its maximum computing power is P i =E i / b i T. It can be obtained that in edge processing mode, the maximum computing efficiency of node i is:
[0094]
[0095] Optionally, in one embodiment of the present application, the third computing efficiency model of the entire wireless body area network is:
[0096] A wireless body area network contains N sensor nodes, and each sensor node can only choose to calculate the task locally or offload it to the edge server. According to the calculation analysis, the calculation efficiency of the entire wireless body area network is:
[0097]
[0098] in a i ∈{0,1} represents the offloading decision of node i, a i = 0 means that node i executes tasks locally, a i =1 means that the node offloads the task to the edge server for execution. At the same time, when a i = 0, During the task offloading process, the wireless link status between the sensor node and the AP node affects the selection of the node offloading decision. The offloading decision determines the computing time and offloading time of the sensor node in the data processing stage. The goal of this invention is to maximize the computing efficiency of the entire wireless body area network.
[0099] Optionally, in one embodiment of the present application, a deep neural network is constructed and trained to obtain a trained deep neural network, including:
[0100] First, initialize the deep neural network parameter set to θ (θ obeys the standard normal distribution), use the ReLU function as the activation function of the hidden layer, and the sigmoid function as the activation function of the output layer;
[0101] Use an initially empty memory with limited capacity;
[0102] The optimal unloading decision a is output by solving the convex optimization problem * The link gain g with the input to the deep neural network N As a set of training samples (g N ,a * ) is added to the end of the memory. When the memory is full, the newly generated data samples will replace the oldest training samples in the memory;
[0103] After each training interval, a batch of training samples are randomly extracted from the memory to train the deep neural network;
[0104] After the set number of training times is completed, the model can be used as a solution to obtain the optimal offloading decision and resource allocation, and the calculation speed is fast, which reduces the computing energy consumption. It also improves the computing efficiency of the entire wireless body area network, thereby improving the data processing capacity of the wireless body area network and reducing network latency.
[0105] Among them, the deep neural network parameter θ of this paper t The Adam algorithm is used for updating, and the training loss function is as follows:
[0106]
[0107] Among them, S represents the randomly extracted training samples, |S| represents the size of S, represents a pair of training samples, Represents the transpose operation of a matrix.
[0108] Optionally, in one embodiment of the present application, a link gain set between a sensor node and a wireless access AP node is input into a trained deep neural network, and a candidate offloading decision set is output, including:
[0109] The link gain set g between N sensor nodes and AP nodes N Input the deep neural network, according to the current unloading strategy π of the deep neural network θ , and obtain a relaxed set of unloading decisions
[0110] The Order-Preserving Quantization (OPQ) method is used to split the loose unloading decision set and obtain K N-dimensional binary candidate unloading decision sets, which are expressed as:
[0111]
[0112] Where K represents the number of candidate offloading decisions, a k =[a′ k,1 ,...,a′ k,i ,…,a′ k,N ],a′ k,i ∈{0,1},a′ k,i = 0 means that the task of node i is processed locally, a′ k,i =1 means that the task of node i is offloaded to the edge server for processing.
[0113] The Order-PreservingQuantization (OPQ) method is used to split and process the loose unloading decision set, including:
[0114] (1) Set the loose unloading decision set Compare each element in with 0.5 to obtain the first N-dimensional binary unloading decision set a 1 ,in:
[0115]
[0116] Among them, i=1,…N.
[0117] (2) Calculate the loose set of offloading decisions The absolute value of the difference between each element and 0.5, and according to the size of the absolute value, the element Sort from small to large (note: if the absolute values are the same, the element with the smaller ID value is given priority) to get the sequence
[0118] According to the following formula, the loose unloading decision set Each element in and In contrast, in particular, k = 2, ..., K, j = k-1. Therefore, N N-dimensional binary offloading decision sets can be obtained.
[0119]
[0120] Among them, i=1,…N.
[0121] At this point, according to formula (11) and formula (12), we can get N+1 N-dimensional binary unloading decision sets.
[0122] Optionally, in one embodiment of the present application, the candidate offloading decision sets are respectively brought into the third computational efficiency model of the entire wireless body area network, the decision problem is converted into a convex optimization problem, and the Bisection-Lagrange algorithm is used to perform the convex optimization solution to obtain the optimal offloading decision and resource allocation solution.
[0123] The above-mentioned convex optimization solution using the Bisection-Lagrange algorithm specifically includes:
[0124] The K groups of unloading decision sets obtained by splitting the loose unloading decision set using the Order-Preserving Quantization (OPQ) method are respectively brought into (8). When a i After being determined, the above calculation efficiency formula of the entire wireless body area network becomes a convex optimization problem. Specifically, when a in the calculation efficiency formula i After confirming, just continue to solve b 0 and b i That is, at the same time b 0 and b i It is also subject to constraint (5). So b can be solved by solving the convex optimization problem 0 and b i , here the Bisection-Lagrange (Bi-La) algorithm is used to obtain the optimal b=[b 1 ,…,b i ],
[0125] Step 1: First, introduce a non-negative Lagrangian multiplier associated with the constraint condition. The Lagrangian function can be expressed as:
[0126]
[0127] The corresponding dual function is:
[0128]
[0129] The dual problem is:
[0130]
[0131] Due to the determination of a i (8) is a convex problem, so the dual problem achieves the same goal as maximizing (8) through strong duality. Obviously, when the optimal value is obtained,
[0132] Step 2: First, find the pair of (13) The partial derivative of , and set it to 0, after a series of transformations, we can get the following optimal relation:
[0133]
[0134] where λ * W(x) represents the Lambert-W function, which is f(y)=ye y = the inverse function of x, that is, y = W(x). From (15), we can infer that λ * >0 is always true, if not true, then or This obviously does not conform to (5). * >0, there is When x∈(-1 / e,0), W(x)∈(-1,0). The denominator of (15) is always positive. At the same time, W(x) is a monotonically increasing function on x∈(-1 / e,0). It can be inferred that the link with a strong link gain (g i ) will be assigned a longer offloading time b i By transforming (16), we get:
[0135]
[0136] in represents the denominator of (16), It decreases monotonically with λ. When λ→0, When λ→∞, Will Substitution Get λ * and Relationship:
[0137]
[0138] Given that From the monotonicity of , we can infer that δ(λ) is a monotonically increasing function in the interval of λ.
[0139] Step 3: Next, find (13) for b 0 The partial derivative of and set it to 0, after a series of transformations, it can be inferred that there is an optimal λ *,satisfy:
[0140]
[0141] where G(λ) is a monotonically decreasing function on λ>0. When λ→0, G(λ)→∞, and when λ→∞, G(λ)→-∞. So there is a unique λ * >0 makes G(λ * )=0.
[0142] Step 4: Obtain the unique optimal λ through the Bi method * To make (19) true, first specify the search area of the Bi method in Represents a sufficiently large value. When searching for a value that satisfies G(λ * )=0 * When , we can directly obtain through formulas (17) and (18) and Finally, since the current target problem is a convex problem, the primal problem and the dual problem have the same optimal solution.
[0143] Step 5: After calculating the K unloading decision sets in this time period, the optimal C is obtained, denoted as C * , output the corresponding As the offloading decision and resource allocation scheme of the current communication process, a * represents the optimal offloading decision.
[0144] Embodiment 1 of the present application is described below:
[0145] This embodiment combines the attached Figure 2 The specific implementation process of the present invention "Wireless body area network task offloading method based on mobile cloud-edge computing" is elaborated in detail.
[0146] like Figure 2In the schematic diagram of the wireless body area network model shown, at the beginning of the time period, the computing device on the edge server MES executes the offloading decision and resource allocation algorithm, calculates the optimal offloading decision and resource allocation plan for this time period based on the link gain between each user node and the AP node, and then sends it to the node through a signal for execution. The AP node starts to send radio frequency signals to the sensor nodes in the wireless body area network set according to the duration specified in the plan for the nodes to collect energy into the node battery, and this energy is used for the computing tasks in this time period. The sensor nodes attached to the surface of the human body or implanted in the human body will perform local calculations on the collected data according to the plan or forward them to the edge server MES through the AP node for execution. Nodes in the edge computing mode need to wait until the wireless power transmission ends before they can start offloading tasks to the AP node because they are constrained by time division multiplexing (TDM), while nodes in the computing mode can calculate data at the beginning of the time period.
[0147] like Figure 3 As shown, the wireless body area network task offloading and resource allocation method based on mobile edge computing disclosed in this example has the following specific implementation steps:
[0148] Step 1: Build an energy harvesting wireless body area network system and communication model.
[0149] Step 1.1: Constructing the energy harvesting wireless body area network system model includes: an edge server, a wireless access AP node, and a wireless body area network collection. The wireless body area network is composed of several micro sensor nodes. The edge server and AP nodes are connected to each other through wired links, and the AP nodes and wireless body area network sensor nodes are connected through wireless links.
[0150] Step 1.2: Construct an energy-harvesting wireless body area network communication model. A communication process is divided into two stages: the first stage is the energy harvesting stage; the second stage is the data processing stage. In the first stage, the AP point broadcasts the RF signal, and the sensor node uses energy harvesting technology to capture energy from the RF signal within a specified time. In the second stage, the sensor node processes the data locally or offloads it according to the optimal offloading decision. If offloading is required, the data is sent to the AP node according to the allocated offloading time, and processed by the edge server connected to the AP node.
[0151] Step 2: Build an energy harvesting model for sensor nodes.
[0152] Define a communication process duration as T = 1, and the energy collection phase accounts for a proportion of b 0 ∈(0,1). Then in a communication process, the energy collected by the i-th sensor node is:
[0153] Ei =μPg i b 0 T (1)
[0154] Among them, μ = 0.7 represents the energy collection efficiency of the sensor node, P = 3W represents the transmission power of the AP node, and g i Represents the link gain between sensor node i and AP node. Assume that the link gain of uplink and downlink is the same and remains unchanged during a communication process. The link gain of different communication processes is variable.
[0155] Step 3: Construct a computing efficiency model for task local processing mode and edge processing mode.
[0156] Step 3.1: Construct a computational efficiency model of sensor nodes in local processing mode.
[0157] In the local computing mode, let k i =10 -26 represents the computational energy efficiency coefficient of sensor node i, f i represents the CPU frequency of node i, 0≤t i ≤T represents the computing time of node i, then the total energy consumed by the sensor node to calculate data cannot exceed the energy E obtained in the energy collection phase i ,thus
[0158] k i f i 3 t i ≤E i (2)
[0159] Let φ = 100 represent the number of computation cycles required by the sensor node to process a unit of data. Then, in the data processing phase, in the local processing mode, the total number of bits processed by node i is f i t i / φThe computational efficiency of node i is expressed as:
[0160]
[0161] In formula (3), the efficiency C is calculated L,i With the calculation time t i Monotonically increasing, it can be seen that when t i =T, the corresponding f i =(E i / (k i T)) 1 / 3 , t i , f i Substituting (1) into (6), we can get the maximum computational efficiency of node i:
[0162]
[0163] Step 3.2: Construct the computational efficiency model of sensor nodes in edge processing mode.
[0164] In the edge computing mode, in order to avoid interference between unloaded data between different sensor nodes, time division multiplexing (TDM) is used in the data processing stage, and the time length allocated to node i is defined as b i ∈(0,1), then the processing time constraint of the sensor node in the edge processing mode is:
[0165]
[0166] Sensor node i offloads the task to the edge server using wireless communication technology. According to Shannon’s formula, we can get i The maximum amount of data transmitted within T time D i for:
[0167]
[0168] Among them, B = 2MHz represents the wireless channel bandwidth between the sensor node and the AP node, P i represents the transmission power of sensor node i, N 0 =10 -10 W represents the noise power.
[0169] In energy-harvesting wireless body area networks, when the sensor node uses all the collected energy for task offloading, its maximum computing power is P i =E i / b i T. It can be obtained that in edge processing mode, the maximum computing efficiency of node i is:
[0170]
[0171] Step 4: Construct the computational efficiency model of the entire wireless body area network.
[0172] A wireless body area network contains N sensor nodes, and each sensor node can only choose to calculate the task locally or offload it to the edge server. According to the calculation analysis in step 4, the calculation efficiency of the entire wireless body area network is:
[0173]
[0174] in ai∈{0,1} represents the offloading decision of node i, a i = 0 means that node i executes tasks locally, a i=1 means that the node offloads the task to the edge server for execution. At the same time, when a i = 0, During the task offloading process, the wireless link status between the sensor node and the AP node affects the selection of the node offloading decision. The offloading decision determines the computing time and offloading time of the sensor node in the data processing stage. The goal of this invention is to maximize the computing efficiency of the entire wireless body area network.
[0175] Step 5: Build a deep neural network and obtain a candidate offloading decision set a based on it K .
[0176] Step 5.1: During the communication process, first initialize the deep neural network parameter set to θ (θ obeys the standard normal distribution), use the ReLU function as the activation function of the hidden layer, and the sigmoid function as the output layer activation function. The link gain set g between the N sensor nodes and the AP node is N Input the deep neural network, according to the current unloading strategy π of the deep neural network θ , and obtain a relaxed set of unloading decisions
[0177] Step 5.2: Split using Order-Preserving Quantization (OPQ) We get K N-dimensional binary unloading decision sets, expressed as:
[0178]
[0179] Where K represents the number of candidate offloading decisions, a k =[a′ k,1 ,...,a′ k,i ,...,a′ k,N ],a′ k,i ∈{0,1},a′ k,i = 0 means that the task of node i is processed locally, a′ k,i =1 means that the task of node i is offloaded to the edge server for processing.
[0180] (1) Set the loose unloading decision set Compare each element in with 0.5 to obtain the first N-dimensional binary unloading decision set a 1 ,in:
[0181]
[0182] Where i=1,…N.
[0183] (2) Calculate the loose set of offloading decisions The absolute value of the difference between each element and 0.5, and according to the size of the absolute value, the element Sort from small to large (note: if the absolute values are the same, the element with the smaller ID value is given priority) to get the sequence
[0184] According to formula (11), the loose unloading decision set Each element in and In contrast, in particular, k = 2, ..., K, j = k-1. Therefore, N N-dimensional binary offloading decision sets can be obtained.
[0185]
[0186] Where i=1,…N.
[0187] At this point, according to formula (10) and formula (11), N+1 N-dimensional binary unloading decision sets can be obtained.
[0188] Step 6: For a K The unloading decision in is solved by convex optimization to obtain the optimal unloading decision and resource allocation solution.
[0189] Step 6.1: Substitute the K groups of unloading decision sets obtained in step 5.2 into (8) respectively. When a i After being determined, (8) becomes a convex optimization problem. Specifically, when a in (8) i After confirming, just continue to solve b 0 and b. Where b=[b 1 ,…,b i ], At the same time 0 and b are subject to constraint (5). So b can be solved by solving the convex optimization problem 0 and b, where the Bisection-Lagrange (Bi-La) algorithm is used to obtain the optimal b 0 and b,
[0190] First, a non-negative Lagrangian multiplier associated with the constraint condition is introduced. The Lagrangian function can be expressed as:
[0191]
[0192] The corresponding dual function is:
[0193]
[0194] The dual problem is:
[0195]
[0196] Due to the determination of a i (8) is a convex problem, so the dual problem achieves the same goal as maximizing (8) through strong duality. Obviously, when the optimal value is obtained,
[0197] Step 6.2: First, find the pair of (13) The partial derivative of , and set it to 0, after a series of transformations, we can get the following optimal relation:
[0198]
[0199] where λ * W(x) represents the Lambert-W function, which is f(y)=ye y = the inverse function of x, that is, y = W(x). * >0 is always true, if not true, then or This obviously does not conform to (5). * >0, there is When x∈(-1 / e,0), W(x)∈(-1,0). The denominator of (15) is always positive. At the same time, W(x) is a monotonically increasing function on x∈(-1 / e,0). It can be inferred that the link with a strong link gain (g i ) will be assigned a longer offloading time b i By transforming (15), we get:
[0200]
[0201] in represents the denominator of (15), It decreases monotonically with λ. When λ→0, When λ→∞, Will Substitution Get λ * and Relationship:
[0202]
[0203] Given that From the monotonicity of , we can infer that δ(λ) is a monotonically increasing function in the interval of λ.
[0204] Step 6.3: Next, find (14) for b 0The partial derivative of and set it to 0, after a series of transformations, it can be inferred that there is an optimal λ * ,satisfy:
[0205]
[0206] where G(λ) is a monotonically decreasing function on λ>0. When λ→0, G(λ)→∞, and when λ→∞, G(λ)→-∞. So there is a unique λ * >0 makes G(λ * )=0.
[0207] Step 6.4: Obtain the unique optimal λ by Bi method * To make (18) true, first specify the search area of the Bi method in Represents a sufficiently large value. When searching for a value that satisfies G(λ * )=0 * When , we can directly get and Finally, since the current target problem is a convex problem, the primal problem and the dual problem have the same optimal solution.
[0208] Step 6.5: After calculating the K unloading decision sets in this time period, the optimal C is obtained, denoted as C * , output the corresponding As the offloading decision and resource allocation scheme of the current communication process, a * represents the optimal offloading decision.
[0209] Step 6.6: Use the solution obtained in step 6.5 to update the offloading strategy of the deep neural network. Specifically, this paper adopts a memory with limited capacity and initially empty. At the end of each communication, the solution a * and g N Combine into a pair of training samples (g N ,a * ) is added to the end of the memory. When the memory is full, the newly generated data sample will replace the oldest training sample in the memory. After each training interval, a batch of training samples will be randomly extracted from the memory to train the deep neural network. The deep neural network parameter θ in this paper is updated using the Adam algorithm, with a learning rate of 0.01, and the training loss function is as follows:
[0210]
[0211] Where S represents a randomly extracted training sample, |S|=128 represents the size of S, represents a pair of training samples, Represents the transpose operation of a matrix.
[0212] Step 7: After the set number of training times is completed, the model can be used as a solution to obtain the optimal offloading decision and resource allocation, and the calculation speed is fast, which reduces the computing energy consumption. It also improves the computing efficiency of the entire wireless body area network, thereby improving the data processing capacity of the wireless body area network and reducing network latency.
[0213] from Figure 4 It can be seen that when the number of users is 10 and the number of training times is 20,000, it can be observed that the training loss converges sharply to 0.04 after the 2,000th training, which means that the granularity of our method to achieve the optimal solution is very small.
[0214] Figure 5 is the computational efficiency ratio of the method proposed in this patent. It can be seen that Figure 3 The training loss is 0.98, and the ratio between the calculated solution and the optimal solution after the 2500th training reaches 0.98, which confirms the effectiveness of the proposed method.
[0215] In order to implement the above embodiments, the present invention further proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method described in the above embodiments is implemented.
[0216] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0217] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0218] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0219] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0220] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0221] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0222] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0223] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A task offloading and resource allocation method based on mobile edge computing, characterized in that: An energy harvesting wireless body area network system is constructed, wherein the energy harvesting wireless body area network system includes an edge server, a wireless access AP node, and a wireless body area network set, wherein the wireless body area network set is composed of micro sensor nodes, and the method includes the following steps: Build a system communication model; Constructing an energy collection model for sensor nodes according to the system communication model; According to the energy collection model, a first computing efficiency model of the task in the local processing mode and a second computing efficiency model of the task in the edge processing mode are respectively constructed; constructing a third computing efficiency model of the entire wireless body area network according to the first computing efficiency model and the second computing efficiency model; Construct a deep neural network and train it to obtain a trained deep neural network; Inputting a link gain set between the sensor node and the wireless access AP node into the trained deep neural network, and outputting a candidate offloading decision set; Converting the decision problem into a convex optimization problem according to the third computing efficiency model and the candidate offloading decision set; Performing convex optimization solutions on the offloading decisions in the candidate offloading decision set respectively to obtain the optimal offloading decision and resource allocation solution; The first computing efficiency model of the construction task in the local processing mode includes: In the local processing mode, the total energy consumed by the sensor node to calculate data cannot exceed the energy obtained in the energy collection phase, which is expressed as: Among them, E i represents the energy collected by the i-th sensor node, k i represents the computational energy efficiency coefficient of sensor node i, f i represents the CPU frequency of node i, 0≤t i ≤T represents the computation time of node i; In the data processing stage, the node computing efficiency in the local processing mode is expressed as: Among them, C L,i represents the computational efficiency of node i, φ is the number of computational cycles required for the sensor node to process unit data, T is the duration of the communication process, and f i represents the CPU frequency of node i, 0≤t i ≤T represents the computation time of node i; The maximum computing efficiency of the node calculated according to the node computing efficiency is: in, represents the maximum computational efficiency of node i at t i =T,f i =(E i / (k i T)) 1 / 3 When you get The second computing efficiency model of the construction task in edge processing mode includes: In the edge processing mode, time division multiplexing is used in the data processing stage, and the time length allocated to node i is defined as b. i ∈(0,1), then the processing time constraint of the sensor node in the edge processing mode is: Wireless communication technology is used to offload tasks to the edge server through sensor node i. According to Shannon's formula, the node i is obtained at b i The maximum amount of data transmitted within T time D i for: Where B represents the wireless channel bandwidth between the sensor node and the AP node, P i represents the transmission power of sensor node i, N0 represents the noise power; In the energy-harvesting wireless body area network, when the sensor node uses all the collected energy for task offloading, the maximum computing power is obtained, and the maximum computing efficiency of the node in the edge processing mode is further obtained, which is expressed as: in, Indicates the maximum computing efficiency of node i in edge processing mode. When the maximum computing power is P i =E i / b i T get The third computational efficiency model of the entire wireless body area network is: in a i ∈{0,1} represents the offloading decision of node i, a i = 0 means that node i executes tasks locally, a i =1 means the node offloads the task to the edge server for execution.
2. The method according to claim 1, characterized in that The edge server and the AP node are connected to each other via a wired link, and the AP node and the wireless body area network sensor node are connected via a wireless link. A communication process is divided into an energy collection phase and a data processing phase. The construction of the system communication model includes: In the energy collection stage, radio frequency signals are broadcasted through AP nodes, and energy collection technology is used at sensor nodes to capture energy from the radio frequency signals within a specified time; In the data processing stage, the sensor node processes the data locally or offloads the data according to the optimal offloading decision. If the data is offloaded, the data is sent to the AP node according to the allocated offloading time and processed by the edge server connected to the AP node.
3. The method according to claim 2, characterized in that The energy collection model of the sensor node is constructed, including: Define the duration of a communication process as T, and the proportion of the energy collection phase as b0∈(0,1). Then, in a communication process, the energy collected by the i-th sensor node is: IN i =μPg i b0T Among them, μ∈(0,1) represents the energy collection efficiency of the sensor node, P represents the transmission power of the AP node, and g i represents the link gain between sensor node i and AP node.
4. The method according to claim 1, characterized in that The step of constructing a deep neural network and training it to obtain a trained deep neural network includes: Initialize a deep neural network parameter set, and use a ReLU function and a sigmoid function as a hidden layer activation function and an output layer activation function of the deep neural network, respectively; Use an initially empty memory with limited capacity; adding the optimal offloading decision output by solving the convex optimization problem and the link gain input to the deep neural network as a set of training samples to the end of the memory; After each training interval, a batch of training samples are randomly extracted from the memory to train the deep neural network; After the set number of training times is completed, the trained deep neural network is obtained. Among them, the loss function used to train the deep neural network is: Among them, S represents the randomly extracted training samples, |S| represents the size of S, represents a pair of training samples, Represents the transpose operation of a matrix.
5. The method according to claim 1, characterized in that The step of inputting the link gain set between the sensor node and the wireless access AP node into the trained deep neural network and outputting a candidate offloading decision set comprises: The link gain set between the sensor node and the AP node is input into the deep neural network, and a loose offloading decision set is obtained according to the current offloading strategy of the deep neural network. The loose unloading decision set is split and processed using an Order-Preserving Quantization method to obtain a candidate unloading decision set.
6. The method according to claim 1, characterized in that The candidate offloading decision sets are respectively introduced into the third computational efficiency model of the entire wireless body area network, the decision problem is converted into a convex optimization problem, and the Bisection-Lagrange algorithm is used to perform the convex optimization solution to obtain the optimal offloading decision and resource allocation solution.
7. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Dynamic multi-user wireless communication scene edge optimization method based on reinforcement learning
CN114051205A
MEC resource allocation method based on two-dimensional dynamic matching
CN114286304A