A method and system for implementing device activation based on EMQ

CN116436966BActive Publication Date: 2026-09-22SICHUAN HONGMEI INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310374513.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-10
Publication Date
2026-09-22
Estimated Expiration
2043-04-10

AI Technical Summary

Technical Problem

上述发明解决了激活多个传输配置时,存在开销大和时延的问题

Benefits of technology

[0031]本发明的有益效果是:本发明在智能设备联网后,无需调用云端接口而是在智能设备通信后,智能设备向云端上报状态的同时,静默的完成设备注册激活过程,减少接口调用,优化智能设备流程。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116436966B_ABST
    Figure CN116436966B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on EMQ and realizes the method and system of equipment activation, method includes: S1: after smart device networking, the subject information of the smart device is released to EMQ, the subject information includes device information and the state information of device on and off;S2: cloud server receives the subject information, simultaneously, message is parsed and encapsulated, then it is sent out by Kafka division with agreed subject Kafka-topic;Cloud server receives the message sent by Kafka, obtains the subject information of the smart device after parsing;S3: obtain the on-line state and login condition of the smart device, if state is on-line, but the smart device does not have login record in platform, then the smart device is activated and identified.This application is after smart device networking, without calling cloud interface, but after smart device communication, the smart device is reported to cloud at the same time, and the device registration activation process is completed silently, reduces interface call, optimizes smart device process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of IoT smart device activation technology, and in particular to a method and system for device activation based on EMQ. Background Technology

[0002] With the development of smart homes, the use of smart devices is becoming increasingly widespread, and the intelligence of these devices is becoming more and more inseparable from users. In the process of users using smart devices, user preferences and ease of use are particularly important. Statistics on smart device activation data can indirectly reflect how users actually use the products, providing assistance for market strategies. Currently, smart device activation is mainly done through interfaces. After the device connects to the network, it completes registration and activation by calling the interface. After successful activation, the APP then binds and controls the device.

[0003] For example, in the prior art, document number CN202010254040.4, entitled "Activation Method, Smart Device, and Activation System for Smart Devices," discloses that: the smart device sends activation request information to the auxiliary device; the smart device receives activation information; wherein, the activation information is sent by the auxiliary device to the smart device after receiving the activation request information; the smart device connects to the network access node and uses the activation information to log in / register on the server to complete activation. The above invention mainly describes the method of obtaining activation information using an auxiliary device, and the activation information being activated on its respective server. Regarding document number CN201910365360.4, entitled "A Method, Network Device, and Terminal for Activating / Deactivating Configurations," it discloses: sending activation / deactivation information to the terminal to indicate the activation / deactivation of multiple transmission configurations; wherein, the multiple transmission configurations are associated with the configuration information of the activation / deactivation information, or, the first field of the activation / deactivation information is used to indicate the same first configuration information among the multiple transmission configurations. The above invention solves the problems of high overhead and latency when activating multiple transmission configurations. The differences are significant, but there is no conflict. Summary of the Invention

[0004] This invention provides a method and system for device activation based on EMQ, addressing the issue mentioned in the background art where smart device activation is achieved through interfaces. The purpose of this invention is to silently complete the device registration and activation process after communication, simultaneously reporting the device's status to the cloud without calling cloud interfaces, thus reducing interface calls and optimizing the smart device workflow.

[0005] The technical solution adopted in this invention is: to provide a method for device activation based on EMQ, comprising:

[0006] S1: After the smart device is connected to the network, it publishes the topic information of the smart device to EMQ. The topic information includes device information and device online / offline status information.

[0007] S2: The cloud server receives the topic information, parses and encapsulates the message, and then distributes it through Kafka with the agreed topic Kafka-topic; the cloud server receives the message sent by Kafka, parses it, and obtains the topic information of the smart device.

[0008] S3: Obtain the online status and login status of the smart device. If the status is online, but the smart device has no login record on the platform, then the smart device is identified as activated.

[0009] Furthermore, the cloud server integrates MQTT and Kafka functions, and deploys IoT microservices and Active microservices. EMQ is an MQTT message server developed based on the Erlang / OTP platform.

[0010] Furthermore, S1 includes:

[0011] S1.1: Smart devices connect to the network; the IoT microservice initializes the EMQ configuration, connects and subscribes to relevant topic messages; the Active microservice initializes the Kafka service and subscribes to relevant topic messages;

[0012] S1.2: After the smart device is connected to the network, it connects to the EMQ server. Once the connection is successful, the smart device can communicate with EMQ via messages.

[0013] S1.3: Smart devices send EMQ-topic messages to EMQ, which contain device information and device online / offline status information.

[0014] Furthermore, S2 includes:

[0015] S2.1: The IOT microservice receives messages subscribed from the EMQ server, parses and encapsulates the messages, and then distributes them out through Kafka using the agreed-upon Kafka-topic;

[0016] S2.2: The Active microservice listens to the Kafka subscription service, receives messages, and then processes them;

[0017] S2.3: After receiving a message, the Active microservice parses the encapsulated message body to obtain device information and the device's online / offline status information.

[0018] Furthermore, S3 includes:

[0019] When the online status of a smart device is obtained as "online", the system continues to verify the device's login status on the platform. If the device is present in the Redis cache, it indicates that the device has been registered; otherwise, it indicates that the device is activated.

[0020] Furthermore, after S3, it also includes:

[0021] S4: After determining that the smart device is activated, store the device information in the MySQL database and synchronize the information to the Redis database for business processing.

[0022] This invention also provides a system for device activation based on EMQ, comprising: a smart device, a MySQL database module, a Redis database module, and a cloud server. The cloud server integrates MQTT and Kafka functionalities and deploys IoT microservices and Active microservices. EMQ is an MQTT message server developed based on the Erlang / OTP platform. The system activates the device through the following method:

[0023] When smart devices connect to the network, the IoT microservice initializes the EMQ configuration, connects, and subscribes to relevant topic messages; the Active microservice initializes the Kafka service and subscribes to relevant topic messages.

[0024] After the smart device is connected to the network, it connects to the EMQ server. Once the connection is successful, the smart device can communicate with EMQ via messages.

[0025] Smart devices send EMQ-topic messages to EMQ, which contain device information and the device's online / offline status.

[0026] The IoT microservice receives messages subscribed from the EMQ server, parses and encapsulates the messages, and then distributes them out through Kafka using the agreed-upon Kafka topic.

[0027] The Active microservice listens to the Kafka subscription service, receives messages, and then processes them.

[0028] After receiving the message, the Active microservice parses the encapsulated message body to obtain device information and the device's online / offline status.

[0029] When the online status of a smart device is obtained as "online", the system continues to verify the device's login status on the platform. If the device is present in the Redis cache, it indicates that the device has been registered; otherwise, it indicates that the device is activated.

[0030] Once the device is confirmed to be activated, the device information is stored in a MySQL database and simultaneously synchronized to a Redis database for business processing.

[0031] The beneficial effects of this invention are: after the smart device is connected to the network, the invention does not require calling the cloud interface. Instead, after the smart device communicates, it silently completes the device registration and activation process while the smart device reports its status to the cloud, reducing interface calls and optimizing the smart device process. Attached Figure Description

[0032] Figure 1 This is a flowchart illustrating the method for device activation based on EMQ disclosed in this invention.

[0033] Figure 2 This is a schematic diagram of the system for device activation based on EMQ disclosed in this invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in further detail below with reference to the accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0035] Example 1:

[0036] Explanation of some terms in this embodiment:

[0037] Intelligent devices refer to any device, instrument, or machine with computing power. They possess sensitive and accurate perception capabilities, sound thinking and judgment abilities, and effective execution capabilities. Intelligent devices must integrate EMQ components for execution.

[0038] A cloud server, or server, has the functionality to integrate MQTT and Kafka, and can deploy IoT microservices, Active microservices, etc.

[0039] EMQ, or Erlang Enterprise ElasticMQTT Broker, is an MQTT (Message Queuing Telemetry Transport) message server developed based on the Erlang / OTP platform. It is the most popular MQTT message server in the open-source community. It enables message passing from the device to the server and device control message forwarding from the server to the device. Smart devices subscribe to messages published by the management platform in real time via MQTT using their device serial number (SN) as the topic. EMQ service topics are unique and based on the device serial number.

[0040] Kafka is a high-throughput distributed publish-subscribe messaging system. Cloud servers listen for messages by subscribing to devices with the specified serial number (SN) as topics.

[0041] After an IoT microservice (IoT: Internet of Things; IoT service: a self-developed microservice primarily handling IoT-related business) starts, it subscribes to specific topic messages (EMQ-topic, a custom topic name) from EMQ (EMQ: Erlang Enterprise ElasticMQTTBroker, an open-source IoT MQTT message server developed based on the Erlang OTP platform). The IoT microservice needs to integrate with EMQ and Kafka services.

[0042] Once the Active microservice (Active: activation, microservice name; a self-developed microservice mainly handling IoT-related business) starts, it subscribes to messages on a specific (Kafka-topic) topic from Kafka. The Active microservice needs to integrate with Kafka service.

[0043] MySQL is a relational database management system. Relational databases store data in different tables instead of putting all the data in one large repository, which increases speed and improves flexibility.

[0044] Redis, or REmoteDIctionaryServer (Redis), is a key-value storage system that runs in memory and is highly efficient.

[0045] See Figure 1 This embodiment discloses a method for device activation based on EMQ, including:

[0046] S1: After the smart device is connected to the network, it publishes the topic information of the smart device to EMQ. The topic information includes device information and the device's online / offline status information.

[0047] In this embodiment, the cloud server integrates MQTT and Kafka functionalities, and deploys IoT microservices and Active microservices. EMQ is an MQTT message server developed based on the Erlang / OTP platform. EMQ service topics are unique and based on device serial numbers. The smart device needs to integrate and execute the EMQ component.

[0048] Specifically, S1 includes:

[0049] S1.1: Smart devices connect to the network; the IoT microservice initializes the EMQ configuration, connects and subscribes to relevant topic messages; the Active microservice initializes the Kafka service and subscribes to relevant topic messages;

[0050] S1.2: After the smart device is connected to the network, it connects to the EMQ server. Once the connection is successful, the smart device can communicate with EMQ via messages.

[0051] S1.3: Smart devices send EMQ-topic messages to EMQ, which contain device information and device online / offline status information.

[0052] S2: The cloud server receives the topic information, parses and encapsulates the message, and then distributes it through Kafka with the agreed topic Kafka-topic; the cloud server receives the message sent by Kafka, parses it, and obtains the topic information of the smart device.

[0053] Specifically, S2 includes:

[0054] S2.1: The IOT microservice receives messages subscribed from the EMQ server, parses and encapsulates the messages, and then distributes them out through Kafka using the agreed-upon Kafka-topic;

[0055] S2.2: The Active microservice listens to the Kafka subscription service, receives messages, and then processes them;

[0056] S2.3: After receiving a message, the Active microservice parses the encapsulated message body to obtain device information and the device's online / offline status information.

[0057] S3: Obtain the online status and login status of the smart device. If the status is online, but the smart device has no login record on the platform, then the smart device is identified as activated.

[0058] Specifically, when the online status of a smart device is obtained as "online", the system continues to verify the device's login status on the platform. If the device is included in the Redis cache, it indicates that the device has been registered; otherwise, it indicates that the device is activated.

[0059] S4: After determining that the smart device is activated, store the device information in the MySQL database and synchronize the information to the Redis database for business processing.

[0060] Example 2:

[0061] See Figure 2This embodiment discloses a system for device activation based on EMQ, including: a smart device, a MySQL database module, a Redis database module, and a cloud server. The cloud server integrates MQTT and Kafka functions and deploys IoT microservices and Active microservices. EMQ is an MQTT message server developed based on the Erlang / OTP platform. The system activates the device through the following method:

[0062] When smart devices connect to the network, the IoT microservice initializes the EMQ configuration, connects, and subscribes to relevant topic messages; the Active microservice initializes the Kafka service and subscribes to relevant topic messages.

[0063] After the smart device is connected to the network, it connects to the EMQ server. Once the connection is successful, the smart device can communicate with EMQ via messages.

[0064] Smart devices send EMQ-topic messages to EMQ, which contain device information and the device's online / offline status.

[0065] The IoT microservice receives messages subscribed from the EMQ server, parses and encapsulates the messages, and then distributes them out through Kafka using the agreed-upon Kafka topic.

[0066] The Active microservice listens to the Kafka subscription service, receives messages, and then processes them.

[0067] After receiving the message, the Active microservice parses the encapsulated message body to obtain device information and the device's online / offline status.

[0068] When the online status of a smart device is obtained as "online", the system continues to verify the device's login status on the platform. If the device is present in the Redis cache, it indicates that the device has been registered; otherwise, it indicates that the device is activated.

[0069] Once the device is confirmed to be activated, the device information is stored in a MySQL database and simultaneously synchronized to a Redis database for business processing.

[0070] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for device activation based on EMQ, characterized in that, include: S1: After the smart device is connected to the network, it publishes the topic information of the smart device to EMQ. The topic information includes device information and device online / offline status information. S2: The IoT microservice of the cloud server receives the topic information, parses and encapsulates the message, and then distributes it out through Kafka with the agreed topic Kafka-topic; the Active microservice of the cloud server receives the message sent by Kafka, parses it and obtains the topic information of the smart device. S3: Obtain the online status and login status of the smart device. If the status is online, but the smart device has no login record on the platform, then the smart device is identified as activated.

2. The method for device activation based on EMQ according to claim 1, characterized in that, The cloud server integrates MQTT and Kafka functions, and deploys IoT microservices and Active microservices. EMQ is an MQTT message server developed based on the Erlang / OTP platform.

3. The method for device activation based on EMQ according to claim 2, characterized in that, S1 includes: S1.1: Smart devices connect to the network; the IoT microservice initializes the EMQ configuration, connects and subscribes to relevant topic messages; the Active microservice initializes the Kafka service and subscribes to relevant topic messages; S1.2: After the smart device is connected to the network, it connects to the EMQ server. Once the connection is successful, the smart device can communicate with EMQ via messages. S1.3: Smart devices send EMQ-topic messages to EMQ, which contain device information and device online / offline status information.

4. The method for device activation based on EMQ according to claim 3, characterized in that, S2 includes: S2.1: The IOT microservice receives messages subscribed from the EMQ server, parses and encapsulates the messages, and then distributes them out through Kafka using the agreed-upon Kafka-topic; S2.2: The Active microservice listens to the Kafka subscription service, receives messages, and then processes them; S2.3: After receiving a message, the Active microservice parses the encapsulated message body to obtain device information and the device's online / offline status information.

5. The method for device activation based on EMQ according to claim 4, characterized in that, S3 includes: When the online status of a smart device is obtained as "online", the system continues to verify the device's login status on the platform. If the device is present in the Redis cache, it indicates that the device has been registered; otherwise, it indicates that the device is activated.

6. The method for device activation based on EMQ according to claim 5, characterized in that, Following S3, the following also includes: S4: After determining that the smart device is activated, store the device information in the MySQL database and synchronize the information to the Redis database for business processing.

7. A system for device activation based on EMQ, characterized in that, include: The system comprises a smart device, a MySQL database module, a Redis database module, and a cloud server. The cloud server integrates MQTT and Kafka functionalities and deploys IoT microservices and Active microservices. EMQ is an MQTT message server developed based on the Erlang / OTP platform. Device activation is achieved through the following method: When smart devices connect to the network, the IoT microservice initializes the EMQ configuration, connects, and subscribes to relevant topic messages; the Active microservice initializes the Kafka service and subscribes to relevant topic messages. After the smart device is connected to the network, it connects to the EMQ server. Once the connection is successful, the smart device can communicate with EMQ via messages. Smart devices send EMQ-topic messages to EMQ, which contain device information and the device's online / offline status. The IoT microservice receives messages subscribed from the EMQ server, parses and encapsulates the messages, and then distributes them out through Kafka using the agreed-upon Kafka topic. The Active microservice listens to the Kafka subscription service, receives messages, and then processes them. After receiving the message, the Active microservice parses the encapsulated message body to obtain device information and the device's online / offline status. When the online status of a smart device is obtained as online, the system continues to verify the device's login status on the platform. If the Redis cache contains the device, it means that the device has been registered. Conversely, it indicates that the device is activated; Once the device is confirmed to be activated, the device information is stored in a MySQL database and simultaneously synchronized to a Redis database for business processing.

Citation Information

Patent Citations

  • A method for activating / deactivating configuration, a network device, and a terminal.

    CN111867117B

  • Activation methods for smart devices, smart devices, and activation systems for smart devices.

    CN113556723B

  • Online state identification method for Internet of Things equipment, online information platform and server

    CN110635970A

  • Activation method of intelligent equipment, intelligent equipment and activation system of intelligent equipment

    CN113556723A