## 4 Model
### Vehicular Communication Model
The larger \(\omega_{ik}\) is, the higher the priority of the data packet is. Finally. We use \(T\) to represent the total delay generated in the service domain per unit time. The calculation formula of \(T\) is as follows:  
\[T(\mathbf{\theta})=\sum\limits_{i=1}^{M}\sum\limits_{b_{k}\in\mathcal{B}_{i}} \left[\theta_{ik}\bigg{(}\frac{S_{ik}}{f^{CV2X}}+\omega_{ik}\times q_{ik}^{ CV2X}\bigg{)}+(1-\theta_{ik})\bigg{(}\frac{S_{ik}}{f^{DSRC}}+\omega_{ik} \times q_{ik}^{i}\bigg{)}\right] \tag{6}\]  
where \(\theta_{ik}\bigg{(}\frac{S_{ik}}{f^{CV2X}}+\omega_{ik}\times q_{ik}^{CV2X} \bigg{)}\) is the delay generated when the data packet is sent through C-V2X, and \((1-\theta_{ik})\bigg{(}\frac{S_{ik}}{f^{DSRC}}+\omega_{ik}\times q_{ik}^{i} \bigg{)}\) is the delay generated when the data packet is sent through VANET. It should be noted that if a packet is sent through the VANET link, the packet will enter the packet buffer of each node in the link. Therefore, when a data packet is sent through VANET, it is only necessary to accumulate the delay generated at each node that the data packet passes through. This is why the superscript of \(q_{ik}^{i}\) is \(i\). The topology map composed of CH and RSU in the service domain is always determined, and once the topology map is determined, the optimal routing path can always be found according to algorithms such as Dijkstra. At this time, the total delay in the service domain is only related to which method is used to send the data packet. Therefore, \(T\) is a function of \(\mathbf{\theta}\), which is the same in the following formulas; \(\mathbf{\theta}\) is a vector consisting of all \(\theta_{ik}\). Assume that the unit price of the cellular network traffic is \(p\) dollar/MB. The total communication cost generated in the system per unit time is represented by \(P\):  
\[P(\mathbf{\theta})=p\times\frac{\sum\limits_{i=1}^{M}\sum\limits_{b_{k}\in \mathcal{B}}\theta_{ik}\times S_{ik}}{1024^{2}} \tag{7}\]  
This formula is quoted from [13]. \(P\) can also reflect the level of the cellular network bandwidth consumption. To achieve the goal of balancing the QoS of packets and user communication costs, we use the following objective function:  
\[J(\mathbf{\theta})=\min\limits_{\mathbf{\theta}}\left(\ln T(\mathbf{\theta})+P(\mathbf{\theta})\right) \tag{8}\]  
\[(1-\theta_{ik})\times\sum\limits_{e(m,n)\in Path_{k}}\left(\frac{S_{ik}}{f^{ DSRC}}+q_{ik}^{m}\right)\leq l_{ik},\theta_{ik}=0 \tag{8a}\] \[C_{e(m,n)}^{DSRC}-\sum\limits_{b_{k}\in\mathcal{B}}(1-\theta_{ik})\times S _{ik}\geq 0,e(m,n)\in Path_{k} \tag{8b}\]\[C^{CV2X}-\sum_{b_{k}\in\mathcal{B}_{i}}\theta_{ik}\times Size_{ik}\geq 0 \tag{8c}\] \[\theta_{ik}\in\{0,1\} \tag{8d}\]  
where \(C^{CV2X}\) represents the capacity of the link of the cellular network. \(C^{DSRC}_{e(m,n)}\) represents the capacity of the VANETs link \(a_{m}\) to \(a_{n}\) in \(Path_{k}\). Equation (8a) specifies that if VANETs are used to transmit \(b_{ik}\), the total delay generated must be less than \(l_{ik}\) for \(b_{ik}\). Equations (8b) and (8c) stipulate that the capacity of the cellular network links and VANET links cannot be exceeded at any time. Equation (8d) illustrates the range of values for \(\theta_{ik}\).