> ## Documentation Index
> Fetch the complete documentation index at: https://alltick.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 心跳

> 本页面说明AllTick股票WebSocket接口的心跳机制，通过Ping-Pong消息示例介绍如何保持长连接在线、检测断线与重连策略，帮助开发者在订阅股票实时Tick与盘口推送时稳定维护WebSocket连接，提升行情系统可靠性。

## 接口说明

要求请求者每10秒发送一次，在30秒内如果没有收到心跳请求，就会认为超时，断开请求者的websocket连接

## 请求-协议号：22000

### 数据结构(json)

```json theme={null}
{
    "cmd_id":22000,
    "seq_id":123,
    "trace":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
    }
}
```

## 应答-协议号：22001

### 数据结构(json)

```json theme={null}
{
    "ret":200,
    "msg":"ok",
    "cmd_id":22001,
    "seq_id":123,
    "trace":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
    }
}
```

#### AllTick网站

<Note>
  官方网站：<a href="https://alltick.co/">[https://alltick.co/](https://alltick.co/)</a>
</Note>

<script src="/seo-keywords.js" />
