PHPackages                             zeevin/libiocm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. zeevin/libiocm

ActiveLibrary[API Development](/categories/api)

zeevin/libiocm
==============

中国电信物联网开放平台API对接库

1.1.5(2y ago)51570↑275%13MITPHPPHP &gt;=7.0

Since May 7Pushed 2y ago4 watchersCompare

[ Source](https://github.com/zeevin/libiocm)[ Packagist](https://packagist.org/packages/zeevin/libiocm)[ Docs](https://github.com/zeevin/libiocm)[ RSS](/packages/zeevin-libiocm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (24)Used By (0)

中国电信物联网开放平台API（北向）对SDK
======================

[](#中国电信物联网开放平台api北向对sdk)

[![Total Downloads](https://camo.githubusercontent.com/099aaf44c2cb7146b05715400d4ba33e9800c744ab52218cf2c2d2738259cf7f/68747470733a2f2f706f7365722e707567782e6f72672f7a656576696e2f6c6962696f636d2f642f746f74616c2e737667)](https://packagist.org/packages/zeevin/libiocm)[![Monthly downloads](https://camo.githubusercontent.com/db163d6e5392508a149b96175af22b321bfd29034f8d539e21bbbdedee40998e/68747470733a2f2f706f7365722e707567782e6f72672f7a656576696e2f6c6962696f636d2f642f6d6f6e74686c79)](https://packagist.org/packages/zeevin/libiocm)[![Latest Stable Version](https://camo.githubusercontent.com/6b658c1e672587b211872ef869b112a5cec4d405d99b9e80f3da9f75b4a395d3/68747470733a2f2f706f7365722e707567782e6f72672f7a656576696e2f6c6962696f636d2f762f737461626c652e737667)](https://packagist.org/packages/zeevin/libiocm)[![License](https://camo.githubusercontent.com/7d6a0e98f094644dc703e78c9e31825e64359b4173714e88ccb8e98a5e85de2d/68747470733a2f2f706f7365722e707567782e6f72672f7a656576696e2f6c6962696f636d2f6c6963656e73652e737667)](https://packagist.org/packages/zeevin/libiocm)

Libiocm 实现了对中国电信物联网开发平台（北向）API的对接。

### 关于NB-IoT的开发，有兴趣的朋友可以加QQ群交流：群号:577640752

[](#关于nb-iot的开发有兴趣的朋友可以加qq群交流群号577640752)

---

### 安装

[](#安装)

```
composer require zeevin/libiocm
```

#### 对接进度：

[](#对接进度)

```

应用安全接入（对应tests文件夹内的示例）
 鉴权 seclogin.php
 刷新token secrefresh.php

设备管理
 注册直连设备 Zeevin\Libiocm\Reg\RegClient
 刷新设备密钥 Zeevin\Libiocm\Reg\RefreshKeyClient
 修改设备信息 Zeevin\Libiocm\Dm\UpdateDeviceClient
 删除直连设备 Zeevin\Libiocm\Dm\DeleteDeviceClient
 查询设备激活状态 Zeevin\Libiocm\Reg\CheckActivatedStatClient

批量处理
 创建批量任务 Zeevin\Libiocm\BatchTask\CreateClient
 查询单个任务信息 Zeevin\Libiocm\BatchTask\QueryClient :响应中的param参数未适配动态类型
 查询任务详情信息 Zeevin\Libiocm\BatchTask\QueryDetailClient :响应中QueryTaskDetailDTOCloud2NA结构体的param参数未适配动态类型

规则管理 :稍后适配

订阅管理
 订阅平台业务数据 Zeevin\Libiocm\Sub\RegClient
 订阅平台管理数据 subscribecreate.php
 查询单个订阅  Zeevin\Libiocm\Sub\QueryClient
 批量查询订阅 Zeevin\Libiocm\Sub\BatchQueryClient
 删除单个订阅 Zeevin\Libiocm\Sub\DeleteClient
 批量删除订阅 Zeevin\Libiocm\Sub\BatchDeleteClient

消息推送 :此为推送信息，最后适配

命令下发
 创建设备命令 Zeevin\Libiocm\Cmd\CreateClient
 查询设备命令 Zeevin\Libiocm\Cmd\QueryClient
 修改设备命令 Zeevin\Libiocm\Cmd\UpdateClient
 创建设备命令撤销任务 Zeevin\Libiocm\Cmd\CreateTaskClient
 查询设备命令撤销任务 Zeevin\Libiocm\Cmd\QueryTaskClient

查询设备命令撤销任务
 查询单个设备信息 singlequery.php
 批量查询设备信息列表 Zeevin\Libiocm\Dm\QueryDevicesClient
 查询设备历史数据 Zeevin\Libiocm\Data\QueryHistoryClient :响应参数中含有totalCount、pageSize、pageNo，但是文档没写，这里我仍然保留
 查询设备服务能力 Zeevin\Libiocm\Data\QueryCapabilitiesClient

设备组管理
 创建设备组 Zeevin\Libiocm\Devgroup\CreateClient
 删除设备组 Zeevin\Libiocm\Devgroup\DeleteClient
 修改设备组 Zeevin\Libiocm\Devgroup\UpdateClient
 查询设备组详情 Zeevin\Libiocm\Devgroup\QueryClient 文档中返回值：queryDevGroups实际不存在，返回的是list
 查询指定设备组 Zeevin\Libiocm\Devgroup\SpecificQueryClient
 查询指定设备组成员 Zeevin\Libiocm\Dm\SpecificMemberQueryClient
 增加设备组成员 Zeevin\Libiocm\Dm\SpecificMemberAppendClient  返回值中的deviceIds实际都是返回空，与文档不一致
 删除设备组成员 Zeevin\Libiocm\Dm\SpecificMemberDeleteClient

2.10 设备升级 ：适配中

```

```
使用方式请参考tests文件夹内的测试用例，使用前复制config.php.sample.php 为config.php,并根据自己情况修改配置参数。

```

---

### 主要完成如下内容：

[](#主要完成如下内容)

- 1、使用JMS包装请求参数。以定义类变量的方式设置请求参数，便于参数的设置和参数提示。
- 2、使用JMS包装返回的json数据，默认会把请求数据映射为对应的RequestAttribute类，便于进一步使用。
- 3、使用doctrine/cache 缓存ouath token结果。目前适配了memcached、Redis、file三类。

---

### 注意事项：

[](#注意事项)

- 1、Guzzle 库只支持pem格式的证书，因此需要将默认的p12格式证书转换成pem格式，比如：

```
openssl pkcs12 -in outgoing.CertwithKey.pkcs12 -out key.pem -nodes -clcerts
```

目前测试平台的证书密码是：IoM@1234，如果后期电信有更新需要同步更新。

- 2、电信编写的api文档看起来并不十分完善，有些返回信息是从头信息中查看，比如1.2.2.4 删除直连设备接口， 此接口在删除成功时返回结果需要查看头信息的statusCode和reasonPhrase内容，body中并没有json信息，为解决这种问题， 我在所有的请求结果中都加入了"statusCode"和"reasonPhrase"属性。
- 3、接口调用方式请查看tests文件夹下的示例。

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~112 days

Recently: every ~428 days

Total

20

Last Release

797d ago

Major Versions

v0.5.0 → 1.0.02018-07-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/3194b82528f7eb52227681e902c1beea520bbd15bd5805599be92c402e615ffd?d=identicon)[zeevin](/maintainers/zeevin)

---

Top Contributors

[![zeevin](https://avatars.githubusercontent.com/u/6711535?v=4)](https://github.com/zeevin "zeevin (48 commits)")

---

Tags

apinb-iotiocmOceanConnectnbiot

### Embed Badge

![Health badge](/badges/zeevin-libiocm/health.svg)

```
[![Health](https://phpackages.com/badges/zeevin-libiocm/health.svg)](https://phpackages.com/packages/zeevin-libiocm)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[dsc/mercado-livre

Client para integração com API do Mercado Livre

8138.7k](/packages/dsc-mercado-livre)[stfalcon-studio/api-bundle

Base classes and helper services to build API application via Symfony.

1032.1k](/packages/stfalcon-studio-api-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
