The increase in data amount makes the traditional Internet of Vehicles (IoV) fail to meet users' needs. Hence, the IoV is explored in series. To study the construction of freight integer linear programming (ILP) model based on fog computing (FG), and to analyze the application of the model in the optimization of the networking deployment (ND) of the IoV. FG and ILP are combined to build a freight computing ILP model. The model is used to analyze the application of ND optimization in the IoV system through simulations. The results show that while analyzing the ND results in different scenarios, the model is more suitable for small-scale scenarios and can optimize the objective function; however, its utilization rate is low in large-scale scenarios. While comparing and analyzing the network cost and running time, compared with traditional cloud computing solutions, the ND solution based on FG requires less cost, shorter running time, and has apparent effectiveness and efficiency. Therefore, it is found that the FG-based model has low cost, short running time, and apparent efficiency, which provides an experimental basis for the application of the later deployment of freight vehicles (FVs) in the Internet of Things (IoT) system for ND optimization. The results will provide important theoretical support for the overall deployment of IoV.