## 3 Content Acquisition Process and Caching Algorithm Optimization
### Content Acquisition Process
If the request vehicle fails to find desired content among vehicles that are a one-hop or two-hop distance from itself in the same lane, then the request will be forward-delivered to vehicles that are a one-hop or two-hop distance from the request vehicle in the opposite lane. If the desired content exists, then the request vehicle and content source vehicle will separately act as CHs and make vehicles that are a one-hop distance from themselves in the same lane become CMs to construct the request cluster and the content source cluster. On this basis, according to caching optimization algorithm depicted in Section 3.2, the content source vehicle will averagely divide content into multiple chunks and cache them at multiple relay vehicles in content source cluster, and those vehicles will transfer content chunks to vehicles in request cluster using the multiuser multichannel transmission mode. As shown in Figure 3, \(V_{11}\) caches the content \(V_{6}\) requests. Then, \(V_{10}\), \(V_{11}\), \(V_{12}\), and \(V_{13}\) constitute the content source cluster, and \(V_{6}\), \(V_{7}\), \(V_{8}\), and \(V_{9}\) constitute the request cluster after the request arrives at \(V_{11}\). According to caching optimization algorithm, \(V_{11}\) divides the content into three chunks and separately caches them at \(V_{11}\), \(V_{12}\), and \(V_{13}\). During the transmission process, \(V_{11}\), \(V_{12}\), and \(V_{13}\) separately transfer content chunks to \(V_{6}\), \(V_{7}\), and \(V_{8}\), and then \(V_{6}\) receives the remaining content chunks from \(V_{7}\) and \(V_{8}\). If the request vehicle fails to find the desired content among vehicles that are a one-hop or two-hop distance away from the request vehicle in the same lane or in the front opposite lane, then the request will be delivered to an RSU. When the request vehicle is situated in the coverage area of the RSU, the request vehicle directly obtains desired  
Figure 3: The process of content acquisition. The SoftMax function can map the output of hidden layer to the range of \((0,1)\), by which the neural network can predict the probability of turning left, going straight, turning right, and turning around. The neural network will then treat the result with the maximum probability as the behavior of vehicles. The neural network considers the cross-entropy between the behavior distribution of the training output and the historical actual data as the objective function. By minimizing the value of objective function, our mechanism obtains network parameters and completes the training process. The objective function is formulated as follows:  
\[J(\theta)=-\frac{1}{N_{s}}[\sum_{g=1}^{N_{s}}\sum_{j=1}^{4}Y_{g,j}\log(softmax (y_{g,j}(\theta)))] \tag{7}\]  
where \(N_{s}\) denotes the sample number of training, \([Y_{g,1},Y_{g,2},Y_{g,3},Y_{g,4}]\) denotes the actual result of the g-th sample, and \([y_{g,1}(\theta),y_{g,2}(\theta),y_{g,3}(\theta),y_{g,4}(\theta)]\) denotes the training output of the g-th sample. The training process of the neural network uses the gradient descent to find the set \(\theta\) to minimize \(J(\theta)\), and the performance of the neural network can be illustrated by the prediction accuracy, which can be derived by dividing the number of correct predictions to the volume of test data. Our paper compares the prediction accuracy when the activation function is the sigmoid function and tanh function. The relationship between the prediction accuracy and training times is shown in Figure 5, which shows that prediction accuracy increased with the increase of training times, and that the prediction accuracy reached nearly 1 after 30 rounds training. Figure 5 also shows that the effect of the sigmoid function was better than that of the tanh function, so we chose the sigmoid function as the activation function. The neural network can predict the behavior of vehicles with high accuracy after finishing training. The cluster-dividing algorithm based on the vehicles' prediction trajectory is discussed next.