# 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
The Jetson nano development board communicates with the Argo buoy's main control board via UART using the 40 Pin IO pin ttyTHS1. First, the Jetson nano board powers on and automatically runs the main_com.py file. It executes the power_on function, sending the $JPWR,1,* command via the ttyTHS1 serial port to the main control board to confirm power-on completion. Then, it runs the rec_data function to wait for commands from the main control board. The main control board transmits profile data stored on the SD card to the Jetson nano via the UART4 serial port in $MESS,N,1,256 bytes,* format (where N is the total number of packets, and 1 is the current packet number) at intervals of 50 milliseconds per packet. The Jetson nano receives the data, verifies the $MESS message header, extracts the 256-byte data, and saves them as a txt file. If the $MESS message header is not received or the message format is incorrect, the Jetson nano will discard the message. Once data transmission is complete, the main control board sends the $COMP,1,* command to notify the Jetson nano that data transmission has ended. Upon receiving the command, the Jetson nano initiates data compression by executing the command python3 /home/zhang/compytorch/start_com.py. Before starting compression, it sends the $COMP,1,* command via the ttyTHS1 serial port to inform the main control board that data compression is about to begin. Then, the Jetson nano executes the command source -/.virtualenvs/pytorch/bin/activate && cd /home/zhang/compytorch && python3 cb_txt.py && deactivate to perform data compression, where source -/.virtualenvs/pytorch/bin/activate means entering the pytorch virtual environment, cd /home/zhang/compytorch means navigating to the specified folder compytorch, python3 cb_txt.py means executing the compression program cb_txt.py, and deactivate means exiting the virtual environment. After compression is completed, it sends the Figure 4:0SFND,1,* command, allowing the Jetson nano to send the compressed data. Subsequently, the Jetson nano transmits the compressed data back to the main control board via the ttyTHS1 serial port in the Figure 4:1FINS,1,* to notify the main control board that the transmission of the compressed data is complete. The main control board saves the received compressed data and forwards them to the BeiDou-3 transparent transmission module via the USART2 serial port. The BeiDou-3 module sends the compressed data to the satellite in chunks of 228 bytes with an interval of 65 s. Finally, the satellite relays the received data to the ground-based platform, where the data are decompressed on a PC. The specific module communication process is shown in Figure 4:2 The hardware connection of the Argo buoy compression system is shown in Figure 4:3

## 4 Results and Discussion

### Data Preparation

The preliminary probability prediction model of this study was trained on a dataset of approximately 4000 4000 m single-batch profiles collected by the laboratory's deep-sea Argo buoy. The PC environment is Python 3.9 with torch 1.10.0 and torchvision 0.11.0. The Jetson nano environment is Python 3.8 with torch 1.8.0 and torchvision 0.9.0. Twelve 4000 m single batch profile datasets were used for experimental verification on the PC and Jetson nano development board. The experimental data are shown in Figure 4:4 The composition of the 4000 m profile data are shown in Figure 4:5

Figure 4:6 Module communication process. Figure 4:7 Hardware connection of the Argo buoy compression system. ### Experimental Verification of the Block_len Parameter

On the basis of the preliminary probability prediction model, an MLP module and a block_len module are introduced to achieve block compression while training. The block_len parameter is used to determine the frequency of model updates and controls the amount of data processed at each step. Its size directly affects the model's performance, context capturing ability, and training efficiency, balancing the frequency of model updates with computational efficiency.