# 内存使用率定时上报

## 1. 上报消息

### 1.1 Topic

<table><thead><tr><th width="237">Topic</th><th>/v1/devices/device/datas</th></tr></thead><tbody><tr><td><strong>消息发送方</strong></td><td>网关设备</td></tr><tr><td><strong>消息接收方</strong></td><td>物联网平台</td></tr></tbody></table>

### 1.2 上报消息payload

#### 参数说明

<table><thead><tr><th width="155">字段名</th><th width="159">必选/可选</th><th width="176">类型</th><th>参数描述</th></tr></thead><tbody><tr><td>devices</td><td>必选</td><td>DeviceS[]</td><td>设备数据。</td></tr></tbody></table>

#### DeviceS结构体说明

<table><thead><tr><th width="158">字段名</th><th width="159">必选/可选</th><th width="182">类型</th><th>参数描述</th></tr></thead><tbody><tr><td>deviceSn</td><td>必选</td><td>String(256)</td><td>设备ESN码，用于唯一标识设备。</td></tr><tr><td>services</td><td>必选</td><td>List&#x3C;Services></td><td>服务列表。</td></tr></tbody></table>

#### Services结构体说明

<table><thead><tr><th width="162">字段名</th><th width="159">必选/可选</th><th width="179">类型</th><th>参数描述</th></tr></thead><tbody><tr><td>service</td><td>必选</td><td>String(256)</td><td>服务名。<strong>RuntimeData</strong></td></tr><tr><td>mid</td><td>必选</td><td>string</td><td>消息ID，用来匹配请求消息和应答消息，以及消息去重。</td></tr><tr><td>data</td><td>必选</td><td>ObjectNode</td><td>服务数据。</td></tr><tr><td>dataTime<br></td><td>必选</td><td>String(256)</td><td>时间格式：采用RFC3339标准，例如：1985-04-12T23:20:50.52Z</td></tr></tbody></table>

#### Data结构体说明

<table data-header-hidden><thead><tr><th width="165"></th><th width="160"></th><th width="177"></th><th></th></tr></thead><tbody><tr><td>字段名</td><td>必选/可选</td><td>类型</td><td>参数描述</td></tr><tr><td>indicator</td><td>必选</td><td>String(256)</td><td>指标类型。具体指标包括：<strong>memUsage</strong></td></tr><tr><td>min</td><td>必选</td><td>uint16</td><td>一个上报周期内多次采样的最小值。</td></tr><tr><td>max</td><td>必选</td><td>uint16</td><td>一个上报周期内多次采样的最大值。</td></tr><tr><td>avg</td><td>必选</td><td>uint16</td><td>一个上报周期内多次采样的最大值。</td></tr><tr><td>current</td><td>必选</td><td>number</td><td>采集到的最新的当前值</td></tr><tr><td>unit</td><td>必选</td><td>Sting</td><td>固定为：%</td></tr></tbody></table>

## **请求示例**

```json
{
    "devices": [{
        "deviceSn": "D68NZxB4",
        "services": [{
            "mid":"mymessageid",
            "data": {
                "indicator": "memUsage",
                "min": 55,
                "max": 70,
                "avg": 60,
                "current": 32,
                "unit": "%"
            },
            "dataTime": "2019-10-23T17:36:25Z",
            "service": "RuntimeData"
        }]
    }]
}
```


---

# 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://open.einfra.cn/api/search/runtime/mem-usage.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.
