How to-end development |? I remember things grow

Author | I was spiced corned egg 

 

Abstract Since the launch of Huawei Things platform, many developers are behind the scenes advice on how small series of equipment such as cloud, I could not resist, spent two days and nights, sorting out the "how-to-end development." to help you quickly understand the whole process of cloud on the device.

Before you begin, to understand the overall scheme of things platform. Things to build a complete solution uses the Internet of Things platform consists of three main parts: the Internet of Things platform, business applications and devices.

---------------------------Overall program--------------------- ------

1.png

  • Things internet: as an intermediate layer connecting devices and business applications, complex shielding device interface, fast access device; ability to open while providing a strong support various industry users quickly build things business applications.

  • Equipment: can be fixed by, 2/3 / 4G, NB-IoT, Wifi things other network access platform, and using LWM2M / CoAP, MQTT protocol, or ONVIF protocol service data reported to the platform, the platform may be the control command to the device.

  • Business Application: by calling the API platform provides Internet of Things, for device management, data reporting, command issued business scenarios.

Therefore, based on the platform of things to achieve an end to end solution of things, the need for product development in the Development Center (test environment), conducted on-line and in the daily management of the device management service console (business environment):

Development operations

Development notes

product development

Former developer carrying device is connected, the corresponding development work based development center, including the platform side development, equipment side development, application development side, self-testing, product release, is a real device access to the device management service preconditions.

On-line (revolutions commercial)

Console-based device management services provided by the real device access to the device management service, and docking user application server development, remote monitoring and control equipment.

Daily management

After the real device access, based on the console or API interface device management services provided by the daily application management and device management.

--------------------------- difference Development Center and device management services --------------- ------------

As mentioned above, in the process of implementing the scheme of things, the center will be used to develop and facilities management services, and that the two platforms so what difference does it make?

open your heart

Development Center offers device management service is a matter of one-stop networking based development tool to help developers quickly developed Profile (product model) and codec plug-ins, as well as the ability to provide a variety of online self-testing, product launches, end to end things develop guidelines to help developers enhance the integration development efficiency, shorten the construction period of things solutions.

Facilities management services

Device management is based on the access device, it provides a richer comprehensive device management capabilities to simplify management complexity massive equipment, saving manual operations, improve management efficiency. When the user opened the device management services, the system default device with the opening of access service, i.e. the user when using the device management service, the access capabilities of the device and services contained.

Development centers and facilities management services What are the differences?

  • Things platform environment where the two are not the same

    Platform environment development center is located is a test environment, facilities management services platform environment where a commercial environment. Two device data environment can not communicate, test environment docked device / application to migrate business environment, you need to access information in a commercial environment to re-create the application and register the device, and modify the device / application platform.

  • Both limit the number of devices is not the same

    Individual projects under development center (applications) can register up to 20 devices, device management services under a single application can register up to 10 million devices. On the other platform capabilities, both consistent with such development centers and facilities management services use the same API, the ability to use more platforms restrictions Please check use restrictions .

  • The two are not the same accounting policy

    Development Center is free of charge, to pay to use the device management, device management services specific accounting policy, please see billing details .

Whether development centers and equipment access services linked?

Development Center is based on things develop tools and equipment management services in the development of product development center (Profile file and codec plug-ins) applies only to facilities management services, can not be imported and used in the device access service.

---------------------------product development--------------------- ------

Former developer carrying device is connected, the corresponding development work based development center, is a real device access to the device management service preconditions.

Development operations

Development notes

Development platform side

主要包括Profile的开发和编解码插件的开发。编解码插件的开发仅针对上报数据为二进制码流格式的设备,对于上报数据为JSON格式的设备不需要开发编解码插件。

设备侧的开发

主要为设备与物联网平台的集成对接开发,包括设备接入物联网平台、业务数据上报和对平台下发控制命令的处理。

应用侧的开发

主要为业务应用与物联网平台的集成对接开发,包括API接口的调用、业务数据的获取和HTTPS证书的管理。

自助测试

自助测试提供了端到端的测试用例,帮助开发者自助完成产品的基础能力测试,如数据上报、命令下发等。旨在通过物联网检测技术帮助开发者发现自身产品中存在的缺陷或问题,缩短产品上市时间。

产品发布

如果开发中心已经对接产品中心,则开发者在完成产品的自助测试后,可以把产品发布到产品中心。可以申请公开发布或私有发布。

平台侧开发

2.png

开发操作

开发说明

创建项目

项目是物联网平台提供物联网应用和设备的调测空间,您可以根据场景的不同创建不同项目空间分别调测。

创建产品

在物联网平台中,某一类具有相同能力或特征的设备的合集被称为一款产品。产品包含Profile(产品模型)、编解码插件、测试报告等资源,其中产品信息被记录在Profile中。

开发profile

Profile(即产品模型)是用来描述一款产品中的设备“是什么”、“能做什么”以及“如何控制该设备”的文件。在物联网平台集成对接中需要先创建Profile,因为Profile里面定义了设备上报的数据和应用服务器下发的命令包含了哪些字段。Profile的开发手段有在线开发和离线开发两种。

开发编解码插件

一款产品的设备上报数据时,如果“数据格式”为“二进制码流”,则该产品需要进行编解码插件开发;如果“数据格式”为“JSON”,则该产品下不需要进行编解码插件开发。

设备侧开发

3.png

华为物联网平台支持终端设备直接接入,也可以通过工业网关或者家庭网关接入;支持多网络接入、原生MQTT协议接入、SDK接入,解决设备接入复杂多样化和碎片化难题,实现设备的快速接入,详见设备侧开发

  • 使用SDK接入:为了帮助设备快速连接到物联网平台,华为提供了Agent Lite SDK、Agent Tiny SDK和LiteOS SDK。支持TCP/IP协议栈的设备集成Agent Lite SDK或Agent Tiny SDK后,可以直接与物联网平台通信。不支持TCP/IP协议栈的设备例如蓝牙设备、ZigBee设备等需要利用网关将设备数据转发给物联网平台,此时网关需要事先集成Agent Lite SDK。 如果是智能设备,可以集成LiteOS操作系统,利用LiteOS与物联网平台通信。

  • 原生MQTT协议接入:支持设备通过MQTT原生协议接入。MQTT是一种基于发布/订阅范式的ISO标准消息协议,主要应用于计算能力有限,且工作在低带宽、不可靠的网络的远程传感器和控制设备,适合长连接的场景,如智能路灯等。

  • 使用模组接入:支持通过华为认证的Wifi、NB-IoT、2/3/4G模组直接接入物联网平台。模组厂商只需要将Agent Tiny SDK集成在现有的模组固件包中,这样模组就具备了接入华为物联网平台的能力。

应用侧开发

华为物联网平台面向全球各行各业提供物联网服务,并通过Restful API的形式对外开放物联网平台丰富的设备管理能力。应用开发人员基于API接口开发所需的行业应用,如智慧城市、智慧园区、智慧工业、车联网等行业应用,满足不同行业的需求。应用开发人员可以选择调用API接口、集成SDK两种方式进行应用服务器(简称为应用)的开发。具体详见应用侧开发

4.png

---------------------------上线(转商用)---------------------------

当产品发布到产品中心后,我们在“开发中心”定义好的产品就可以在“设备管理服务”中使用了。由于开发中心所在的平台环境为测试环境,设备管理服务所在的平台环境为商用环境,两个环境的数据不能互通,已对接测试环境的设备/应用服务器要迁移商用环境。具体详见商用对接

5.png

---------------------------云端日常管理---------------------------

真实设备接入后,用户就可以基于控制台或者API接口,进行日常的应用管理和设备管理。

6.png

功能

简介

订阅推送

订阅:是指应用服务器通过调用物联网平台的API接口,向平台获取发生变更的设备业务信息(如设备注册、设备数据上报、设备状态等)和管理信息(软固件升级状态和升级结果)。

推送:是指订阅成功后,物联网平台根据应用服务器订阅的数据类型,将对应的变更信息推送给指定的URL地址。

授权应用

IoT平台支持应用授权操作,包括同一个用户下的不同应用之间的授权、两用户下的不同应用之间授权,且两应用之间可以相互授权,即被授权的可以通过控制台查看和操作授权应用下的所有设备,如创建规则、批量任务操作等。

数据上报

当设备完成和物联网平台对接后,一旦设备上电,设备基于在设备定义上的业务逻辑进行数据采集和上报,可以是基于周期或者事件触发。

命令下发

为能有效地对设备进行管理,设备的产品模型中定义了物联网平台可向设备下发的命令,应用服务器可以调用物联网平台开放的API接口向单个设备或批量设备下发命令,或者用户通过物联网平台直接向单个设备下发命令,配置或修改设备的服务属性值,以实现对设备的远程控制。

设备配置更新

物联网平台提供设备配置更新功能,即用户可通过控制台对单个设备或批量设备的设备属性值进行修改,满足用户频繁、快捷、方便的管理设备的诉求。

设备影子

Shadow equipment is a JSON file, for online storage device, the device most recently reported device properties, application server delivers the desired configuration. Each device has one and only one shadow device, the device can get and set the device to synchronize the shadow of this state, the synchronization can be synchronized to the shadow device, the device can be synchronized to the shadow.

Rules Engine

Means that the user can set the appropriate rules can access platform of the device on the object networked platforms, after the rule set conditions, the appropriate action will trigger the platform to meet user needs. And a data forwarding device linkage comprising two types.

Groups and Tags

Group is a set of devices, the user may apply for all devices, regions are classified according to different rules, such as establishing a group type, batch processing for the management and operation of the equipment mass.

Things platform to support different custom labels, and tagging equipment, through the label, you can quickly screening equipment.

Equipment monitoring

View details provided equipment, device state management, viewing reports, see the operation log, view audit logs, alarm management, equipment monitoring and message tracking equipment operation and maintenance capabilities, improve maintainability of the equipment.

remote diagnosis

Support for user equipment access for remote maintenance operation, quickly locate the problem and restore service, reduce cost of the introduction of the proximal maintenance. Currently supported remote maintenance operations including running log collection device, reboot the module.

Firmware Upgrade

Users can upgrade the firmware of the device by way of OTA support LWM2M agreement, the upgrade agreement LWM2M agreement.

software upgrade

Users can support by way of equipment LWM2M OTA protocol software upgrade, upgrade agreement for the PCP protocol.

See this, you know how things Fun platform yet, if there is doubt, it does not matter, we have a more detailed book, please start here .

 

About Huawei Things may participate free learning courses, as the >>>>> "IoT seven days to develop training camp" or contact Huawei IoT assistant (Micro Signal: huawei-iot) for more courses.

 

Guess you like

Origin www.cnblogs.com/hwiot/p/11809937.html