The Underwater Internet of Things (UIoT) hasemerged as one of the prominent technologies in the developmentof future ocean monitoring systems, where mobile edge elements(such as autonomous underwater vehicles, AUVs) provide apromising method for the data collection from sensor nodes.However, as an important part of the UIoT, underwater wirelesssensor networks (UWSNs) are severely affected by the underwater dynamic environment. For instance, node locations changecontinuously, which significantly increases the difficulty of datacollection. To solve this problem, the concept of an inevitablecommunication space (ICS) is proposed. The ICS is calculatedby analyzing the variation in the position of nodes and thecommunication range. Furthermore, an ICS-based dynamic datacollection algorithm (ICS-DDCA) for UIoT is proposed to collectunderwater data. This method utilizes the ICS instead of theinitial location of the node for data collection to further improvethe performance of the algorithm and shorten the data collectiontime. The simulation results demonstrate that the ICS-DDCAcan effectively reduce the collection time, while ensuring the fullcompletion of data collection. Compared to EEDA and PNCS-GHA, ICS-DDCA reduces the time required for data collectionby 24.15% and 24.22% on the average respectively.