## 4 Model Establishment
### Objective Function
The energy consumption for the computing task \(t\) on the edge server \(s\) is defined as in Equation (5):  
\[E^{t_{j},s_{i}}=(P_{idle}^{s_{i}}+(P_{full}^{s_{i}}-P_{idle}^{s_{i}})\cdot\mu^{ s_{i}})\cdot T_{proc}^{t_{j}} \tag{5}\]  
where the current power per unit time of the edge server is given by Equation (6):  
\[P^{s_{i}}=P_{idle}^{s_{i}}+(P_{full}^{s_{i}}-P_{idle}^{s_{i}})\cdot\mu^{s_{i}} \tag{6}\]  
(c) The resource utilization rate is used to measure the current usage of the edge server, including the weighted average of the utilization rates of computing power and memory. The resource utilization rate is defined in Equation (7). \[U^{s_{i}}=w_{1}\cdot U_{C}^{s_{i}}+w_{2}\cdot U_{M}^{s_{i}} \tag{7}\]  
The computing power utilization rate is determined by the total computing power demand of all tasks currently allocated to server \(s\) divided by the total computing power of \(s\) under full load, which is defined as follows in Equation (8):  
\[U_{C}^{s_{i}}=\frac{\sum_{j=1}^{h}R_{task}^{t_{j}}}{C_{server}^{s_{i}}},\quad t _{j}\in Q_{s_{i}} \tag{8}\]  
Similarly, let \(M_{task}\) denote the size of memory occupied by the task and let \(M_{server}\) denote the total memory capacity of the edge server. The memory utilization rate is then given by Equation (9):  
\[U_{M}^{s_{i}}=\frac{\sum_{j=1}^{h}M_{task}^{t_{j}}}{M_{server}^{s_{i}}},\quad t _{j}\in Q_{s_{i}} \tag{9}\]  
Then, the comprehensive resource utilization rate can be obtained by Equation (10):  
\[U^{s_{i}}=w_{1}\cdot\frac{\sum_{j=1}^{h}R_{task}^{t_{j}}}{C_{server}^{s_{i}} }+w_{2}\cdot\frac{\sum_{j=1}^{h}M_{task}^{t_{j}}}{M_{server}^{s_{i}}},\quad t _{j}\in Q_{s_{i}} \tag{10}\]  
The weights for each type of resource must respect \(w_{1}+w_{2}=1\)  
(2) Constraints are as follows:  
In the CPN, let \(x_{ts}\) denote task \(t\) allocated to edge server \(s\), where \(S\) is the set of servers. For task \(t\) and server \(s\), it is necessary to ensure that the total computing power and memory requirements of the tasks allocated to the server do not exceed the server's total computing power and memory capacity. These constraints can be expressed as in Equations (11) and (12):\[T_{trans}^{j}=\frac{D_{task}^{t_{j}}}{B_{upload}^{k_{i}t_{j}}}+\frac{D_{result }^{t_{j}}}{B_{download}^{k_{i}t_{j}}}+\frac{L_{upload}^{k_{i}t_{j}}}{v}, \tag{2}\]0  
\[T_{trans}^{j}=\frac{D_{task}^{t_{j}}}{B_{upload}^{k_{i}t_{j}}}+\frac{D_{result }^{t_{j}}}{B_{download}^{k_{i}t_{j}}}+\frac{L_{upload}^{k_{i}t_{j}}}{v}, \tag{2}\]1  
Each task can only be assigned to one server. To ensure that this constraint is met, the scheduling algorithm must be designed to prevent any task from being duplicated across multiple servers. This is crucial for maintaining the integrity of the system and ensuring that resources are allocated efficiently. This approach helps to avoid conflicts and ensures that each server operates at its maximum potential without overloading, which could lead to decreased performance or system failures. This constraint is defined in Equation (13):  
\[T_{trans}^{j}=\frac{D_{task}^{t_{j}}}{B_{upload}^{k_{i}t_{j}}}+\frac{D_{result }^{t_{j}}}{B_{download}^{k_{i}t_{j}}}+\frac{L_{upload}^{k_{i}t_{j}}}{v}, \tag{2}\]2  
The transmission time for each task must not exceed the predetermined maximum latency. This constraint is defined in Equation (14):  
\[T_{trans}^{j}=\frac{D_{task}^{t_{j}}}{B_{upload}^{k_{i}t_{j}}}+\frac{D_{result }^{t_{j}}}{B_{download}^{k_{i}t_{j}}}+\frac{L_{upload}^{k_{i}t_{j}}}{v}, \tag{2}\]3  
Adhering to this constraint is essential for ensuring that tasks are completed within the required timeframes, which is particularly important in the IoV where real-time processing is often a critical factor. Exceeding the maximum latency can lead to delays in task execution, which may have cascading effects on downstream processes and ultimately impact the overall performance of the IoV system.