In view of the current requirements of reducing labor cost and improving low loading efficiency of grain and oil products in grain and oil factories or farms, the global planning of freight truck loading process was carried out by using image recognition system combined with spatial coordinate allocation algorithm. In the process of traditional cargo loading, SSD target tracking detection algorithm is added to obtain the precise location coordinates of the truck bucket in real time from the truck entering the work area, and extract its center coordinates. Start from the midpoint and carry out the loading operation outward, providing the maximum loading plan within the height of the truck. The numerical simulation results show that the algorithm can save most manpower, improve the loading efficiency, and save the transportation cost and time of agricultural products.