# SLA-DQTS: SLA Constrained Adaptive Online Task Scheduling Based on DDQN in Cloud Computing
## 3 Proposed Online Task Scheduling Model
### Problem Formulation  
Our simulation environment is somewhat simplified. We consider the task-related attributes of million instructions per second (MIPS), bandwidth, amount of calculation, bandwidth transmission, and expected completion time, and ignore failure situations that may occur in the real environment. Tasks arrive at the data center in batches, and their arrival times conform to a Poisson distribution. The number of tasks and resource requirements in different batches of tasks are randomly generated within a certain range. The scheduler assigns a task to the task cache queue of the appropriate machine. Tasks are submitted online. The scheduler cannot predict resource requirements and numbers of tasks. Based on this assumption, we define that a batch can contain multiple tasks, expressed as \(CLU\_T=\{t_{i}|i\in N+\}\), where \(|CLU\_T|\) is the number of tasks in a batch. Each task can be expressed as  
\[t_{i}=\left\{ \begin{array}{l}t_{i}^{\textit{mips}},t_{i}^{\textit{low}},t_{ i}^{\textit{mips}\_l}l_{i}^{\textit{br}\_l},t_{i}^{\textit{load}},t_{i}^{\textit{load}} \\ t_{i}^{\textit{load}},t_{i}^{\textit{finish}}t_{i}^{\textit{start}},t_{i}^{ \textit{cost}}\end{array} \right\}, \tag{2}\]  
where \(i\) is the number of a task; \(t_{i}^{\textit{mips}}\) and \(t_{i}^{\textit{br}}\) respectively represent the task's requirements for computing and bandwidth resources; \(t_{i}^{\textit{mips}\_l}\), \(t_{i}^{\textit{bu}\_l}\) respectively indicate the lengths of tasks corresponding to computing and bandwidth resources; \(t_{i}^{\textit{dead}}=\frac{t_{i}^{\textit{mips}\_l}}{t_{i}^{\textit{mips}}} +\frac{t_{i}^{\textit{bu}\_l}}{t_{i}^{\textit{bu}}}\) indicates the task processing time expected by the user; \(t_{i}^{\textit{load}},t_{i}^{\textit{start}},t_{i}^{\textit{finish}}\), and \(t_{i}^{\textit{cost}}\) are respectively the time when a task is submitted, time the task is executed by the node, time the task is completed, and execution cost. Prices differ according to the resources of VMs, so the cost of a task is determined by the VM and the execution time. After submission to the data center, a task is scheduled to the VM, which will be occupied until the end of execution, with no preemption. The VM set in the cluster is  
Figure 2: Task scheduling framework. defined as \(CLU\_VM=\left\{vm_{j}|j\in N+\right\}\), where \(|CLU\_VM|\) is the number of the VM. A VM instance is defined as  
\[vm_{j}=\left\{vm_{j}^{mips},vm_{j}^{bw},vm_{j}^{price}\right\}, \tag{3}\]  
where \(j\) is the number of the VM, \(vm_{j}^{mips}\) is the number of instructions per second executed by the VM, \(vm_{j}^{bw}\) is the bandwidth of the VM, and \(vm_{j}\) can perform the task only when  
\[t_{i}^{k}\leq vm_{j}^{k}\;\forall k\in[mips,bw], \tag{4}\]  
where \(vm_{j}^{price}\) is the price per hour of a VM. We refer to Alibaba cloud resource pricing to determine pricing. Computing resources have linear pricing, bandwidth resources have tiered pricing, and the price ratio (this article is set as 0.0003/MIPS, (0.063,0.248)/mb) is calculated as  
\[vm_{mips}^{price} =vm^{mips}*mips_{price} \tag{5}\] \[vm_{bw}^{price} =\left\{ \begin{array}{cc}vm^{bw}*bw_{price1}&\left(vm^{bw}<bw_ {basic}\right)\\ bw_{basic}*bw_{pric1}+(vm^{bw}-bw_{basic})*bw_{price2}&(else)\end{array} \right.,\] \[vm^{price} =vm_{mips}^{price}+vm_{bw}^{price}\]  
where \(bw_{basic}\) is the critical point of bandwidth ladder pricing; \(bw_{pric1}(0.063)\) and \(bw_{price2}(0.248)\) are respectively the first- and second-stage prices of bandwidth; and \(mips_{price}\) is the price of computing resources.