The invention discloses an automatic leveling method for intelligently controlling an
underwater leveling
machine. The method comprises the following steps: acquiring real-time attitude data and working
surface flatness requirements of a plurality of execution mechanisms of the
underwater leveling
machine, and constructing state and operation action information characteristics; an execution mechanism is mapped into an agent with a body, information is shared through an
underwater acoustic communication network, and each agent selects and executes a leveling action based on self and neighborhood interaction data; after execution, obtaining a
reward value, storing the
reward value in an experience
pool, sampling and updating the state-
action function, and performing iterative training to obtain a multi-body agent
reinforcement learning optimization model; continuously monitoring the state of a mechanism when the model runs, dynamically updating the features of an affected area when a fault or hydrodynamic
abnormality is identified, and recalculating a leveling strategy to obtain a dynamic re-planning scheme; the scheme is combined with model output to generate a real-time leveling
instruction sequence, and the real-time leveling
instruction sequence is decomposed and then issued to each execution mechanism, so that self-adaptive accurate leveling control of the underwater leveling
machine is realized, and the working efficiency and reliability of a complex underwater environment are effectively improved.