# 会话与轮换

移动会话模型与住宅相同，**唯一关键差别**：`sesstime` 上限为 **60 分钟**（住宅 30 分钟）。这与真实移动设备在运营商分配 IP 上的典型持续时间一致。

完整会话模型、语法与最佳实践见 [住宅会话与轮换](/helodata-zh/chan-pin/overview/sessions-and-rotation.md)。下面是移动特有要点。

## 移动特有行为

### 60 分钟上限

```
helo_s1a2b3c4d5e-type-mob-region-us-asn-6167-session-job1-sesstime-60
```

`sesstime` 超过 60 会返回 `400` + `X-Helodata-Error-Code: sesstime-out-of-range`。

### 重新分配更频繁

移动设备会切换基站、丢信号、被运营商重分 IP。`X-Helodata-Session-Repinned: true` 响应头出现比住宅更多——预期长会话中 5–15% 会被中途换 IP。

### 会话务必搭配 ASN

不带 ASN 的会话可能在选中设备掉线后由另一运营商设备接管，运营商发生漂移。**需要运营商一致性时务必 `session` + `asn` 并用**：

```
helo_s1a2b3c4d5e-type-mob-region-us-asn-6167-session-job1-sesstime-60
```

### 高吞吐移动的轮换模式

移动池较小，按连接轮换可能耗尽筛选后的子池。可用方案：

* 开 N 个粘性会话，每个绑定一个运营商
* 在它们之间轮询请求
* 某会话连续 3 次目标错误即丢弃，分配新会话 ID

```python
import requests, random, string

BASE = "helo_s1a2b3c4d5e-type-mob-region-us-asn-6167"

def new_session():
    sid = "".join(random.choices(string.ascii_lowercase + string.digits, k=8))
    return f"{BASE}-session-{sid}-sesstime-30"

pool = [new_session() for _ in range(10)]
```

## 会话**不会**做的事（移动特有）

* 不会绕过运营商侧限流。每个移动 IP 共享运营商的单 IP 配额——粘性会话把流量集中在一个 IP，反而更易触发运营商限流。请用**更多会话分摊**，而不是更少。

## 相关

* [ASN 定位](/helodata-zh/chan-pin/overview-1/asn-targeting.md) — 与会话配合保运营商一致
* [住宅会话与轮换](/helodata-zh/chan-pin/overview/sessions-and-rotation.md) — 完整模型与代码模式


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.helodata.com/helodata-zh/chan-pin/overview-1/sessions-and-rotation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
