Flow control and shape optimisation are fundamental problems in fluid mechanics, particularly in certain scenarios involving ocean engineering. Attempts to manage the flow field via reinforcement learning are based on newly developed deep-learning techniques. By utilising an adaptive optimisation process in the flow around two square cylinders (the main square cylinder with a smaller square cylinder in the front) for the position of the front square cylinder, the flow state that minimises the oscillation of the flow field in the wake can be obtained through deep reinforcement learning. Furthermore, as the training process for this reinforcement learning is time consuming, the flow simulation component of the process is replaced with a feature detection model based on a convolutional neural network, which effectively accelerates the training process. This approach to simulating the optimal position-finding procedure with acceleration can be extended to other similar situations and practical engineering projects.