## 3 System Model  
### Problem Description  
The face recognition program can express its submodules in DAG and has many calculations. Using the task offloading on MEC as an example, task offloading may be more easily understood. Modules such as stitching, detection, and feature merging work together to perform a single face recognition task. These modules are in charge of their own services, which run independently as application subtasks based on business processes. Some subtasks are uploaded to the edge server for processing through the mobile device's decision module, and the results are then returned to the mobile device through the network, while other subtasks run on the mobile device. Each edge server runs numerous virtual machines to help process the tasks uploaded by each mobile device, and the computational capability of the edge server is represented by \(f_{s}\) (the number of CPU cores multiplied by the clock speed of each core). In this paper, we assume that virtual machine resource allocation is equal; thus, each virtual machine's computing power can be represented as \(f_{vm}~{}=~{}\frac{f_{s}}{K}\). Many innovative applications, including face recognition applications, can be executed collaboratively by a number of subtasks split by business processes. In this paper, face recognition is applied to a DAG representation, denoted as \(G~{}=~{}(T,E)\), where the vertex set T denotes the set of subtasks, while the edge set E records the execution requirements of the business process for the subtasks. The edge set is made up of directed edges \(\stackrel{{\rightarrow}}{{e}}~{}=~{}\left(t_{i},t_{j}\right)\), where \(\stackrel{{\rightarrow}}{{e}}\) denotes that task \(t_{i}\) is a subtask of task \(t_{i}\), and that task \(t_{i}\) is a precursor task of task \(t_{j}\). According to the edge constraint, a subtask cannot begin execution until all of its preceding tasks have been completed. Lastly, in the graph \(G~{}=~{}(T,E)\), the tasks without subtasks are called exit tasks and represent the end of the application task.  
As shown in Figure 1, each individual subtask can be offloaded to an edge server or executed locally on a mobile device, both of which have different processing latencies. If the task is executed locally, the task latency is defined as \(T_{i}^{MD}~{}=~{}\frac{C_{i}}{J_{MD}}\), where \(f_{MD}\) denotes the mobile device's CPU frequency, and \(C_{i}\) denotes the number of computation periods required for the task; if the task is executed on an edge server, the task latency is divided into three parts: task upload, task execution, and result download. The latency of these three elements is mostly determined by job execution metrics, as well as system upload and download speeds. Using task \(t_{i}\) as an example, some task execution metrics include task data size \(data_{i}^{u}\), received result data size \(data_{i}^{d}\), immediate wireless uplink channel transmission speed \(R_{u}\), wireless downlink channel transmission speed \(R_{d}\) in edge environments, and edge server CPU frequency \(f_{vm}\) to process the task. These factors have an impact on task latency. Therefore, when task \(t_{i}\) is offloaded to an edge server for execution, the task delay may be expressed as  
\[T_{i}^{EDGE}~{}=~{}\frac{data_{i}^{u}}{R_{u}}+\frac{C_{i}}{f_{vm}}+\frac{data_ {i}^{d}}{R_{d}}. \tag{1}\]  
Making appropriate offloading decisions for all subtasks so that they can minimize the total task processing latency while ensuring stable service is the goal of the edge task offloading strategy. To that aim, the latency, energy consumption, and device power in a single-edge-server multidevice MEC scenario are modeled in Section 3.2 in this paper.