Truck platooning technology has been widely studied for its advantages in traffic efficiency and energy savings. Although recent studies have made significant progress in specific scenarios, research on merging ramp trucks into the main road truck platoons remains insufficient. This paper proposes an innovative cooperative control method for merging ramp trucks and main road truck platoons based on vehicle-to-everything (V2X) technology. The method integrates the intelligent driver model (IDM), acceleration control logic for merging trucks before merging, lane-changing decision logic, steering control methods, and on-board unit (OBU) and roadside unit (RSU) communication technologies. This ensures that autonomous merging trucks can smoothly join the main road truck platoon under various insertion positions and acceleration lane lengths. After successfully joining the platoon, the merging trucks can maintain appropriate spacing and high speed, thereby improving overall traffic efficiency. Further analysis on different insertion positions and acceleration lane lengths reveals that when using the proposed method, merging trucks have the least impact on the overall platoon when they join at the head or tail of the main road truck platoon. Although the proposed method performs better with longer acceleration lanes, these lanes are costly to construct. The proposed method can also enable successful platoon joining with shorter acceleration lanes, optimizing the use of acceleration lanes to some extent.