Vehicle modularization has become an emerging trend in the automotive industry, leading to research on modular configuration, composition, and related control strategies. In this paper, we propose a modular power system with a hydraulic free piston engine (HFPE) as the power unit and develop a power distribution control strategy to enhance the overall efficiency of the system. Firstly, we determine the configuration scheme of the modular power system and establish a simulation model of the HFPE using MATLAB/Simulink. We conduct principle verification of the simulation model. Secondly, based on the simulation model of HFPE, we research the power unit control strategy using the machine learning regression prediction algorithm, enabling dynamic working condition switching of the power unit. Next, we propose a power distribution optimization algorithm which is named as the Rule Based Double Iterative Optimization Algorithm (RBDI) and compare it with several mature optimization algorithms under the framework of model predictive control, considering related constraints. Finally, we validate the performance of the proposed power distribution control strategy using a hardware-in-loop system. The results demonstrate that the output power of the modular power system can be effectively ensured. Compared with the average distribution algorithm (AVE), the genetic algorithm (GA), and the ameliorated particle swarm optimization algorithm (APSO), the overall working efficiency of the modular power system using the proposed control strategy is increased by 6.57%, 6.13%, and 5.59%, respectively, under the three test driving cycles.