# Research on the Lossless Data Compression System of the Argo Buoy Based on BiLSTM-MHSA-MLP
## 3 Data Compression and Decompression
### Compression and Decompression Model
A smaller block_len can only capture short-term local context, which may overlook long-term dependencies. This limits the model's ability to capture long-term relationships, but more frequent updates may lead to increased I/O and computational overhead, reducing training efficiency. Additionally, a smaller context window may reduce the model's encoding ability. A larger block_len can capture a broader time range of context, helping the model better learn long-term dependencies. However, if block_len is too large, it may increase model complexity, significantly raise computational resource demands, and potentially lead to issues like insufficient memory or unstable gradients. In summary, the choice of block_len requires a trade-off between context capturing ability and computational resource demands. A smaller block_len provides more frequent model updates but may sacrifice long-term dependency capture, while a larger block_len allows for better long-term dependency capture, enhancing context understanding, but it may increase computational load and impact training efficiency. In the context of data compression, the block_len parameter is introduced to implement block-wise compression, where each block contains block_len \(\times\) batch_size data. Dividing data into smaller chunks can make computations more efficient and avoid over-loading memory. Chunking compression can also reduce the risk of numerical instability during computations. In addition, after compressing these data, they are also used for model training to gradually update the MLP model. This progressive training method allows the model to gradually adapt when processing new data, improves the learning effect of the model, and thus achieves a more efficient compression of new data. In this experiment, the values of block_len are 11, 12, 13, 14, and 15, and they are compared with those of the preliminary probability prediction model (BiLSTM-MHSA) in terms of the compression ratio and compression time. The specific comparison results are shown in Figures 10 and 11. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Number** & **4000 m Profile Data** & **Data Size (Bytes)** \\ \hline D1 & 4000 m data 1 & 4486 \\ D2 & 4000 m data 2 & 4486 \\ D3 & 4000 m data 3 & 4520 \\ D4 & 4000 m data 4 & 4486 \\ D5 & 4000 m data 5 & 4520 \\ D6 & 4000 m data 6 & 4486 \\ D7 & 4000 m data 7 & 4554 \\ D8 & 4000 m data 8 & 4520 \\ D9 & 4000 m data 9 & 4520 \\ D10 & 4000 m data 10 & 4588 \\ D11 & 4000 m data 11 & 4588 \\ D12 & 4000 m data 12 & 4486 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The 4000 m single batch profile data. \begin{table}
\begin{tabular}{c} \hline \hline
**4000 m Profile Data (Time, T/\({}^{\circ}\)C, D/m, C/\(\mu\)S/cm)** \\ \hline
211217173303, 01.3692, 4002.8, 0418 \\
211217174814, 01.3698, 3897.8, 0433 \\
211218033031, 28.0043, 0002.6, 0866 \\
211218033053, 28.0401, 0001.6, 0866 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The 4000 m profile data table. As shown in Figures 10 and 11, introducing the MLP on the basis of the BiLSTM-MHSA to achieve block compression while training can reduce the compression ratio and shorten the compression time. The minimum compression ratio of BiLSTM-MHSA is 12.98%, the average compression ratio is 13.37%, and the average compression time is 6.9 s. The experiment shows that when block_len is 12, the compression ratio is the lowest, the compression time is relatively short, and the compression effect is the best at this time. The lowest compression ratio is 12.03%, the average compression ratio is 12.11%, and the average compression time is 4.4 s. By comparison, the compression algorithm (BiLSTM-MHSA-MLP) adopted in this paper has an average compression ratio reduced by 1.26% and an average compression time reduced by 2.5 s compared with directly using BiLSTM-MHSA, indicating that the improved probability prediction model has stronger performance. Figure 10: Compression ratio comparison: (**a**) comparison between D1 and D7; (**b**) comparison between D8 and D12.