Intelligent equipment management method and device, storage medium and computer program product
Through the cloud system dynamically generating and distributing serial number tags and dynamic keys, combined with the message queue telemetry transmission protocol for authentication and data reporting, the problem of complex production process and low security of smart devices is solved, and the rapid, efficient and secure connection of the device is achieved.
Patent Information
- Application Number
- CN202411914791.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-15
AI Technical Summary
Existing smart devices directly burn the key and serial number into the device when they leave the factory, resulting in complex production processes, high risk of errors, and high risk of authentication failure. Moreover, the leak or cracking of the burned keys will seriously threaten the security of the device.
Through the cloud system dynamically generate and distribute serial number tags and dynamic keys, the communication module logs into the IoT message middleware through the message queue telemetry transmission protocol, performs authentication, and obtains instruction templates based on the authentication results to read intelligent device data and report them to the cloud system.
It realizes fast and efficient connection of smart devices, reduces the risk of errors and authentication failures in the production process, enhances the safety and reliability of equipment connections, reduces the inconsistency between equipment, and improves the stability of equipment operation.
Smart Images

Figure CN119835296A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things technology, and in particular to a smart device management method, apparatus, storage medium and computer program product. Background Art
[0002] In Internet of Things (IoT) applications, the management and data collection of smart devices usually rely on complex configuration and authentication processes. At present, most smart devices directly burn the key and serial number (SN) tag into the smart device when leaving the factory, which meets the basic connection and authentication requirements of smart devices to a certain extent. However, burning the key and serial number (SN) tag directly into the device significantly increases the complexity of the production process, and requires a high degree of consistency in the production process, resulting in a significant increase in the risk of errors in the production process of smart devices and the risk of failure in the authentication process. In addition, once the burned key is leaked or cracked, it will pose a serious threat to the security of the smart device.
[0003] Therefore, how to achieve fast and efficient connection of smart devices and ensure the security and reliability of the connection of smart devices has become an urgent problem to be solved in this application.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a smart device management method, apparatus, storage medium and computer program product, aiming to solve the technical problem of how to achieve fast and efficient connection of smart devices and ensure the security and reliability of smart device connections.
[0006] To achieve the above objectives, the present application proposes a smart device management method, which is applied to a communication module, and the method includes:
[0007] Obtain the serial number tag and dynamic key generated and sent by the cloud system for the smart device;
[0008] Generate a login request according to the serial number tag and the dynamic key, log in to the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol, and forward the login request to the cloud system for authentication through the Internet of Things message middleware;
[0009] Obtaining an instruction template issued by the cloud system according to the result of the authentication;
[0010] The smart device data is read according to the instruction template, and the smart device data is reported to the cloud system, so that the cloud system forms a smart device management chain based on the smart device data to manage the smart device.
[0011] In one embodiment, the step of generating a login request according to the serial number tag and the dynamic key, and logging into the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol includes:
[0012] Using the serial number tag as a login name and the dynamic key as a login password, forming a login request according to the login name and the login password;
[0013] Log in to the Internet of Things message middleware through the login request and message queue telemetry transmission protocol.
[0014] In one embodiment, the step of reading the smart device data according to the instruction template and reporting the smart device data to the cloud system includes:
[0015] Communicate with the smart device through the serial port according to the instruction template to read the smart device data;
[0016] The smart device data is reported to the cloud system via the message queue telemetry transmission protocol.
[0017] In addition, to achieve the above purpose, the present application also proposes a smart device management method, which is applied to a cloud system, and the method includes:
[0018] Generate a serial number tag and a dynamic key for the smart device, and send the serial number tag and the dynamic key to the communication module;
[0019] Receive a login request, perform authentication according to the login request, and issue an instruction template to the communication module according to the result of the authentication, wherein the login request is generated by the communication module according to the serial number tag and the dynamic key, and is forwarded by logging into the Internet of Things message middleware through the message queue telemetry transmission protocol;
[0020] Receive smart device data, and form a smart device management chain based on the smart device data to manage the smart device, wherein the smart device data is read and reported by the communication module according to the instruction template.
[0021] In one embodiment, the steps of receiving a login request, performing authentication according to the login request, and issuing an instruction template to the communication module according to the result of the authentication include:
[0022] Receiving a login request, and extracting a serial number from a login name included in the login request;
[0023] Using the serial number as a reference, it is compared with the dynamic key stored in the cloud database;
[0024] If the serial number is successfully compared with the dynamic key stored in the cloud database, a command template is sent to the communication module according to the pre-acquired device ID, and the smart device is marked as online.
[0025] In one embodiment, the step of receiving smart device data and forming a smart device management chain based on the smart device data to manage the smart device includes:
[0026] Receiving and parsing the smart device data read and reported by the communication module according to the instruction template to obtain a unique identification code of the smart device;
[0027] The pre-stored corresponding relationship is associated with the unique identification code to form a smart device management chain to manage the smart device.
[0028] In one embodiment, before the step of receiving a login request and extracting a serial number from a login name included in the login request, the step further includes:
[0029] Storing the dynamic key in a cloud database;
[0030] Get the device ID of the communication module read by the application side;
[0031] A corresponding relationship between the device ID and the serial number tag is established, and the corresponding relationship is stored in a cloud database.
[0032] In addition, to achieve the above purpose, the present application also proposes a smart device management device, characterized in that the device includes:
[0033] A data acquisition module, used to acquire the serial number tag and dynamic key generated and sent by the cloud system for the smart device;
[0034] An authentication module, used to generate a login request according to the serial number tag and the dynamic key, log in to the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol, and forward the login request to the cloud system for authentication through the Internet of Things message middleware;
[0035] The device management chain generation module is used to obtain the instruction template issued by the cloud system according to the authentication result, read the smart device data according to the instruction template, and report the smart device data to the cloud system so that the cloud system can form a smart device management chain based on the smart device data to manage the smart device.
[0036] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the smart device management method described above are implemented.
[0037] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the smart device management method described above are implemented.
[0038] One or more technical solutions proposed in this application have at least the following technical effects:
[0039] The communication module obtains the serial number tag and dynamic key generated and sent by the cloud system; the cloud system generates and sends the serial number tag and dynamic key to the application end, avoiding the complex process of burning the key and SN into the device before the device is produced, thereby improving production efficiency; the communication module logs in to the Internet of Things Message Middleware (EMQX) through the Message Queue Telemetry Transmission (MQTT) protocol, and generates a login request based on the serial number tag and dynamic key; the Internet of Things Message Middleware (EMQX) forwards the login request of the communication module to the cloud system for authentication, and obtains the instruction template issued by the cloud system based on the authentication result: the cloud system is responsible for authentication and instruction issuance to ensure the rapidity and efficiency of device connection; the communication module reads the smart device data according to the instruction template, and reports the smart device data to the cloud system, so that the cloud system can form a smart device management chain based on the smart device data: the complete device management chain helps to realize the full life cycle management of the device and improve the reliability and availability of the device. In summary, the cloud system is responsible for dynamically generating and distributing serial number tags and keys, performing secure dynamic authentication, generating a smart device management chain, and realizing unified cloud management. Through unified cloud management, the inconsistency problem between devices is reduced and the stability of device operation is improved; by dynamically generating and distributing serial number tags and keys, the authentication failure error rate caused by the inconsistency between serial number tags and burning information in the production process of smart devices is reduced, thereby achieving fast and efficient connection of smart devices and ensuring the security and reliability of smart device connections. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0042] Figure 1 A flowchart of the first embodiment of the intelligent device management method of the present application is provided;
[0043] Figure 2 A flowchart of the second embodiment of the smart device management method of the present application is provided;
[0044] Figure 3 A flowchart of the fifth embodiment of the smart device management method of the present application is provided;
[0045] Figure 4 The overall process diagram provided for the intelligent device management method of this application;
[0046] Figure 5 This is a schematic diagram of the module structure of the intelligent device management device according to an embodiment of the present application;
[0047] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the intelligent device management method in the embodiment of the present application.
[0048] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0051] The main solution of the embodiment of the present application is: the cloud system generates a unique serial number tag and dynamic key for each smart device, and distributes the serial number tag and dynamic key to the application end. The communication module obtains the serial number tag and dynamic key sent by the application end, logs in to the Internet of Things message middleware through the message queue telemetry transmission protocol, and generates a login request based on the serial number tag and dynamic key; the Internet of Things message middleware forwards the login request to the cloud system for authentication, and obtains the instruction template issued by the cloud system according to the authentication result; the communication reads the smart device data according to the instruction template, and reports the smart device data to the cloud system, so that the cloud system can form a smart device management chain based on the smart device data.
[0052] The embodiments of the present application take into account that in the Internet of Things (IoT) applications, the management and data collection of smart devices usually rely on complex configuration and authentication processes. At present, most smart devices directly burn the key and serial number (SN) label into the device when they leave the factory. This practice leads to a series of problems: complex production process: before the device is produced, the key and SN label must be generated in the cloud and exported to the device manufacturer, which increases the complexity and time cost of the production process; high consistency requirements: the burned SN label must be consistent with the SN label attached to the outside of the device, requiring a high degree of consistency during the production process, increasing the risk of error; risk of authentication failure: when the device is networked or connected, the burned SN and key are usually used directly for cloud authentication. If the attached SN label is inconsistent with the burned SN label, the connection will fail, resulting in the device being unable to be used normally; key update is difficult: the burned key cannot usually be updated. If the background data is leaked, it will cause serious security risks and affect the security and reliability of the device. In summary, most smart devices directly burn the key and serial number (SN) label into the smart device when they leave the factory, thereby meeting the basic connection and authentication requirements of smart devices to a certain extent. However, burning the key and serial number (SN) tag directly into the device significantly increases the complexity of the production process and requires a high degree of consistency in the production process, which significantly increases the risk of errors in the production process of smart devices and the risk of failure in the authentication process. In addition, once the burned key is leaked or cracked, it will pose a serious threat to the security of smart devices.
[0053] Therefore, the present application provides a solution, wherein the communication module obtains the serial number tag and dynamic key generated and sent by the cloud system; the cloud system generates and sends the serial number tag and dynamic key to the application end, avoiding the complicated process of burning the key and SN into the device before the device is produced, thereby improving production efficiency; the communication module logs in to the Internet of Things Message Middleware (EMQX) through the Message Queue Telemetry Transmission (MQTT) protocol, and generates a login request based on the serial number tag and dynamic key; the Internet of Things Message Middleware (EMQX) forwards the login request of the communication module to the cloud system for authentication, and obtains the instruction template issued by the cloud system based on the authentication result: the cloud system is responsible for authentication and instruction issuance to ensure the speed and efficiency of device connection; the communication module reads the smart device data according to the instruction template, and reports the smart device data to the cloud system, so that the cloud system can form a smart device management chain based on the smart device data: the complete device management chain helps to realize the full life cycle management of the device and improve the reliability and availability of the device. In summary, the cloud system is responsible for dynamically generating and distributing serial number tags and keys, performing secure dynamic authentication, generating a smart device management chain, and realizing unified cloud management. Unified cloud management reduces inconsistencies between devices and improves the stability of device operation; by dynamically generating and distributing serial number tags and keys, the authentication failure error rate caused by inconsistencies between serial number tags and burning information during the production of smart devices is reduced, thereby achieving fast and efficient connection of smart devices and ensuring the security and reliability of smart device connections.
[0054] It should be noted that in the present application, the communication module and the cloud system communicate and exchange data through the IoT message middleware, and the communication module serves as a connecting bridge between the cloud system and smart devices, enabling smart devices with different communication protocols and standards to effectively interact with the cloud system, thereby realizing the management of smart devices by the cloud system through the smart device management chain.
[0055] Based on this, the embodiment of the present application provides a smart device management method, which is applied to the communication module, referring to Figure 1 , Figure 1 A flowchart of the first embodiment of the smart device management method provided in the present application.
[0056] In this embodiment, the smart device management method includes steps S10 to S40:
[0057] Step S10, obtaining the serial number tag and dynamic key generated and sent by the cloud system for the smart device;
[0058] The serial number tag is a unique identifier for smart devices, used to distinguish different smart devices or software instances. In the Internet of Things (IoT) environment, the serial number tag is used to ensure the uniqueness of the identity of smart devices for easy tracking and management. Dynamic keys are encryption keys that change over time and are used to enhance the security of communications.
[0059] Specifically, the cloud system will generate a unique serial number tag for each device based on the registration information or production information of the smart device. This serial number tag is assigned when the smart device is first connected to the cloud system and stored in the database of the cloud system. The cloud system will generate a dynamic key for each smart device based on a certain algorithm or rule, and the dynamic key will be changed regularly.
[0060] The application side is the interface for users to interact with the cloud system. It is responsible for receiving user instructions, sending requests to the cloud system, and displaying the data returned by the cloud system. Specifically, the cloud system sends the serial number tag and dynamic key to the application side, and the application side sends the serial number tag and dynamic key to the communication module.
[0061] Step S20, generating a login request according to the serial number tag and the dynamic key, and logging into the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol, and forwarding the login request to the cloud system for authentication through the Internet of Things message middleware;
[0062] Message Queuing Telemetry Transport (MQTT) is a lightweight, publish / subscribe-based messaging protocol designed for IoT environments, allowing smart devices to transmit messages reliably with minimal resource consumption and limited bandwidth.
[0063] IoT message middleware, namely EMQX message server, EMQX (Erlang MQTT Broker eXtended) is a high-performance, scalable open source MQTT message broker or message server, specially designed for IoT (IoT) communication. In IoT, devices need to frequently exchange data and information, and EMQX is the key component to undertake this task.
[0064] The purpose of the login request is to prove the legitimacy and identity of the device to the cloud system. The login request contains the serial number tag and dynamic key. The login request is sent to the cloud system through the IoT message middleware. The request contains necessary information such as the serial number tag and dynamic key of the smart device. After receiving the login request, the cloud system verifies the identity information in the request. This usually involves comparing it with the device information database stored in the cloud system.
[0065] Step S30, obtaining the instruction template issued by the cloud system according to the result of the authentication;
[0066] Based on the authentication result, the cloud system decides whether to allow the device to access resources or perform operations. If the authentication is successful, the cloud system generates a corresponding instruction template based on predefined rules. The cloud system sends the generated instruction template to the communication module through the IoT message middleware, and the communication module performs the corresponding operation or processing according to the instruction template.
[0067] Step S40, reading the smart device data according to the instruction template, and reporting the smart device data to the cloud system, so that the cloud system forms a smart device management chain based on the smart device data to manage the smart device.
[0068] Instruction templates are usually pre-defined by the cloud system based on specific business requirements or operation logic. These templates contain key information such as the operations that the device should perform, the data reading format, and the reporting cycle or conditions. According to the requirements in the instruction template, the corresponding data is read, and the communication module reports the read data to the cloud system. The reported data may include raw data, pre-processed data, or a combination of the two. The reporting process usually involves data encapsulation, encryption, and compliance with transmission protocols to ensure data integrity and security.
[0069] After receiving the data reported by the smart device, the cloud system will perform a series of processing and analysis. These processes may include data decoding, verification, storage and further analysis (such as data mining, machine learning, etc.). Based on this data, the cloud system can form a comprehensive management chain for smart devices, including device status monitoring, fault warning, performance evaluation and optimization suggestions.
[0070] In addition, consider introducing a multi-user access control model. Through the Merkle hash tree mechanism, multiple users can safely and efficiently obtain the key material of the hierarchical nodes through independent hash chains, thereby achieving effective management of massive data resources.
[0071] The present embodiment provides a smart device management method, which is applied to a communication module, wherein the communication module obtains a serial number tag and a dynamic key generated and sent by a cloud system; the cloud system generates and sends the serial number tag and the dynamic key to the application end, avoiding the complex process of burning the key and SN into the device before the device is produced, thereby improving production efficiency; the communication module logs in to the Internet of Things Message Middleware (EMQX) through the Message Queue Telemetry Transmission (MQTT) protocol, and generates a login request according to the serial number tag and the dynamic key; the Internet of Things Message Middleware (EMQX) forwards the login request of the communication module to the cloud system for authentication, and obtains the instruction template issued by the cloud system according to the authentication result: the cloud system is responsible for authentication and instruction issuance to ensure the rapidity and efficiency of device connection; the communication module reads the smart device data according to the instruction template, and reports the smart device data to the cloud system, so that the cloud system can form a smart device management chain based on the smart device data: the complete device management chain helps to realize the full life cycle management of the device and improve the reliability and availability of the device. In summary, the cloud system is responsible for dynamically generating and distributing serial number tags and keys, performing secure dynamic authentication, generating a smart device management chain, and realizing unified cloud management. Unified cloud management reduces inconsistencies between devices and improves the stability of device operation; by dynamically generating and distributing serial number tags and keys, the authentication failure error rate caused by inconsistencies between serial number tags and burning information during the production of smart devices is reduced, thereby achieving fast and efficient connection of smart devices and ensuring the security and reliability of smart device connections.
[0072] In a feasible implementation, step S20 may include steps S21 to S22:
[0073] Step S21, using the serial number tag as the login name and the dynamic key as the login password, and forming a login request according to the login name and the login password.
[0074] Each smart device has a unique serial number tag (SN) and dynamic key in the cloud system. SN is the unique identifier of the smart device, which is used to identify the device in the cloud system. The dynamic key is generated by the cloud for the device and is used to authenticate the device during the connection and communication process to ensure the security of communication. In the login request, the communication module uses the device's SN as the username and the dynamic key as the password.
[0075] The advantage of this is that even if the device is deployed in a different network environment after leaving the factory, as long as it can connect to the cloud and obtain the latest dynamic key, it can successfully log in to the message middleware. After EMQX receives the MQTT login request from the communication module, it forwards the request to the cloud for authentication. The cloud intercepts the SN from the user name and compares it with the password (key). After successful verification, the device is marked as online.
[0076] Step S22, logging into the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol;
[0077] The communication module attempts to log in to EMQX using the MQTT protocol. The login process involves establishing a TCP connection with EMQX and sending a login request in accordance with the provisions of the MQTT protocol.
[0078] In a feasible implementation, step S40 may include steps S41 to S42:
[0079] Step S41, communicating with the smart device through the serial port according to the instruction template to read the smart device data;
[0080] The instruction template is formulated by the cloud system according to specific needs, and is used to instruct the communication module on how to read data from smart devices. After receiving the instruction template, the communication module will use the serial port communication interface to communicate with the smart device. Serial port communication is a common data transmission method, especially suitable for short-distance, low-speed communication scenarios.
[0081] According to the instruction template, the communication module will send specific instructions to the smart device through the serial port, and then receive the data returned by the smart device. This data may include device status information, sensor readings, etc.
[0082] Step S42: reporting the smart device data to the cloud system via the message queue telemetry transmission protocol.
[0083] After reading the data from the smart device, the communication module will report the data to the cloud system through the MQTT protocol. This is usually achieved by sending a message to a specific topic subscribed to the cloud (such as / receive / communication module device ID).
[0084] After receiving the data reported by the communication module, the cloud system will parse and process it. On the one hand, the cloud will parse the data packet to obtain the unique identification code and other relevant data of the smart device; on the other hand, the cloud will associate the device ID of the communication module, the SN (serial number) of the smart device, the unique identification code, etc., to form a complete device management chain.
[0085] The present application also provides a smart device management method, which is applied to a cloud system. Figure 2 , Figure 2 A flowchart of a second embodiment of the smart device management method provided in this application. The method includes steps A10 to A30:
[0086] Step A10, generating a serial number tag and a dynamic key for the smart device, and sending the serial number tag and the dynamic key to the communication module;
[0087] In the cloud system, a unique serial number label (SN) and a dynamic key are generated for each smart device that is about to leave the factory. The SN is usually printed and affixed to the outside of the device for easy identification and management. The dynamic key is not burned into the device, but stored in the cloud database, waiting for the subsequent device connection and authentication process.
[0088] The cloud system sends the generated SN and dynamic key to a dedicated application terminal (usually a mobile phone APP or similar client software) through a secure method (such as HTTPS protocol), and then sends the SN and dynamic key to the communication module via Bluetooth, Wi-Fi (such as softAP mode) or other communication methods.
[0089] Step A20, receiving a login request, performing authentication according to the login request, and issuing an instruction template to the communication module according to the result of the authentication, wherein the login request is generated by the communication module according to the serial number tag and the dynamic key, and is forwarded by logging into the Internet of Things message middleware through the message queue telemetry transmission protocol;
[0090] The communication module uses the SN received from the APP as the login name and the dynamic key as the login password to form an MQTT login request. The communication module uses the SN received from the APP as the login name and the dynamic key as the login password to form an MQTT login request. The cloud intercepts information from the user name (ie, SN) and compares it with the password (ie, dynamic key) for authentication. According to the authentication result, an instruction template is sent to the communication module, which is used to instruct the communication module on how to read data from the smart device.
[0091] Step A30, receiving smart device data, and forming a smart device management chain based on the smart device data to manage the smart device, wherein the smart device data is read and reported by the communication module according to the instruction template.
[0092] The communication module communicates with the smart device through the serial port according to the Modbus command template issued by the cloud. The communication module reads the data of the smart device and reports the read data to the cloud through the MQTT protocol. The cloud receives the smart device data reported by the communication module by subscribing to a specific topic (such as / receive / communication module device ID) and forms a smart device management chain based on the smart device data.
[0093] Specifically, in another feasible implementation of step A30, a key tree can be constructed based on the serial number tag. In the key tree, the center of gravity of the tree is selected as the starting point for key derivation, and the key of each smart device is derived by using the characteristics of the center of gravity node (such as its central position in the tree structure, which can minimize the propagation range of key updates). In this way, the distribution and update of keys can be ensured to be more efficient and secure.
[0094] Furthermore, the derived key is used to encrypt the smart device data, and then the encrypted smart device data is reported to the cloud system. After receiving the encrypted data, the cloud system uses the corresponding key to decrypt it, and forms a smart device management chain based on the decrypted smart device data.
[0095] This embodiment provides a smart device management method, which is applied to the cloud system. The cloud system generates a unique serial number tag (SN) and a dynamic key for each smart device to ensure the uniqueness of the identity and the security of communication of the smart device; the introduction of dynamic keys increases the difficulty of cracking communications, thereby protecting smart devices from unauthorized access and data leakage; the message queue telemetry transmission protocol (MQTT) is used to log in to the Internet of Things message middleware for forwarding, and the serial number tag and dynamic key are used for authentication, ensuring that only legal devices can access the cloud system; the instruction template sent by the cloud to the communication module simplifies the device configuration process, and there is no need to manually set the instructions for reading data, and the operation is performed directly according to the instruction template. Improve the efficiency of device connection and data reading. Through the formed smart device management chain, the entire life cycle of the device can be tracked, and the smart device can be quickly and efficiently connected, and the security and reliability of the smart device connection can be ensured.
[0096] Based on the second embodiment of the present application, the third embodiment of the present application is proposed. In the third embodiment of the present application, the same or similar contents as those of the above-mentioned second embodiment can be referred to the above introduction, and will not be repeated in the following.
[0097] In this embodiment, step A20 of receiving a login request, performing authentication according to the login request, and issuing an instruction template to the communication module according to the authentication result may include steps A21 to A23:
[0098] Step A21, receiving a login request, and extracting a serial number from a login name included in the login request;
[0099] When the communication module attempts to log in to the EMQX service through the MQTT protocol, it will send a login request to the cloud. This login request contains the necessary authentication information, including the login name and password (in this scenario, the password is actually a dynamic key). After receiving the login request, the cloud server will parse the serial number from the login name.
[0100] Step A22, using the serial number as a reference, comparing it with the dynamic key stored in the cloud database;
[0101] The cloud server uses the serial number parsed from the login name as a query condition to query the dynamic key corresponding to the serial number stored in the cloud database. The cloud server compares the queried dynamic key with the password (i.e., dynamic key) provided in the login request.
[0102] Step A23, if the serial number is successfully compared with the dynamic key stored in the cloud database, a command template is sent to the communication module according to the pre-acquired device ID, and the smart device is marked as online.
[0103] If the serial number is successfully matched with the dynamic key stored in the cloud database, it means that the identity of the communication module has been verified. The cloud server will send a command template to the communication module based on the device ID of the successfully verified communication module obtained in advance. This command template is usually used to instruct the communication module on how to interact with the smart device.
[0104] The cloud server will also mark the smart device as online, indicating that the device has been successfully connected to the cloud and can perform subsequent data collection and management.
[0105] In this embodiment, the serial number is intercepted from the login request and compared with the dynamic key stored in the cloud database. The use of dynamic keys means that even if the key of the device changes after leaving the factory, there is no need to re-burn the device, which improves the flexibility and security of device deployment. The serial number is used as a unique identifier of the device identity, and the combination of the dynamic key can ensure that only legitimate devices can successfully log in and perform subsequent data interaction. This avoids the access of illegal devices and ensures the purity of the device network and the security of the data. Real-time data verification and comparison through the cloud avoids authentication failures caused by inconsistent device information. This reduces the error rate and ensures that the device can be put into operation efficiently and safely.
[0106] Based on the above embodiments of the present application, a fourth embodiment of the present application is proposed. In the fourth embodiment of the present application, the same or similar contents as those of the above embodiments can be referred to the above introduction, and will not be described in detail later.
[0107] In this embodiment, step A30 of receiving smart device data and managing the smart device by forming a smart device management chain based on the smart device data may include steps A31 to A32:
[0108] Step A31, receiving and parsing the smart device data read and reported by the communication module according to the instruction template, and obtaining a unique identification code of the smart device;
[0109] The cloud system is responsible for receiving the smart device data reported by the communication module. This data is usually uploaded by the communication module after reading the information of the smart device through communication methods such as the MQTT protocol.
[0110] After receiving the data from the smart devices, the cloud will parse it to extract the unique identification code of the smart device (usually denoted as SN2 to distinguish it from the SN label attached to the outside of the device mentioned above) from the data packet.
[0111] This unique identification code is an inherent attribute of the smart device and is used to uniquely identify the device in the cloud system. Obtaining this identification code by parsing the data packet is an important prerequisite for establishing a device management chain.
[0112] Step A32, associating the pre-stored corresponding relationship with the unique identification code to form a smart device management chain to manage the smart device.
[0113] In the cloud system, the corresponding relationship between the communication module device ID and the SN label attached to the outside of the device is pre-established through steps such as associating the cloud cache device ID with the SN and sending the SN and the key to the communication module.
[0114] The cloud will match and associate the parsed smart device unique identification code (SN2) with the established correspondence. The purpose of this step is to bind the data of the smart device with its identity information in the cloud system (including the communication module device ID and SN tag), thereby forming a complete smart device management chain.
[0115] In this embodiment, by using dynamic keys for identity authentication instead of fixed keys pre-burned in the device, the security of device connection is greatly enhanced. The intelligent device management chain makes device management more efficient and unified, and is suitable for the deployment and management of large-scale IoT devices. Through the intelligent device management chain, the cloud can monitor the status of the device in real time, and issue instructions and collect data as needed, which improves the efficiency and accuracy of device management.
[0116] Based on the above embodiments of the present application, a fifth embodiment of the present application is proposed. In the fifth embodiment of the present application, the same or similar contents as those of the above embodiments can be referred to the above introduction, and will not be repeated in the following.
[0117] On this basis, please refer to Figure 3 , Figure 3 A flowchart of the fifth embodiment of the smart device management method of the present application is provided.
[0118] In this embodiment, before step A21 of receiving a login request and extracting a serial number from a login name included in the login request, steps A121 to A123 are also included:
[0119] Step A121, storing the dynamic key in a cloud database;
[0120] The cloud system is responsible for securely storing the generated dynamic key in the cloud database, which is usually encrypted and strictly access-controlled to ensure the security and confidentiality of the dynamic key. The purpose of storing the dynamic key is to verify it in the subsequent authentication process to ensure that only legitimate devices can access the system.
[0121] Specifically, dynamic keys are usually encrypted before storage to prevent unauthorized access and data leakage. In addition, cloud databases should set strict access control policies so that only authorized users or system components can access and modify dynamic keys. To further improve security, dynamic keys may need to be updated regularly. This usually involves generating new keys and replacing old keys. To further improve security, dynamic keys may need to be updated regularly. This usually involves generating new keys and replacing old keys.
[0122] Step A122, obtaining the device ID of the communication module read by the application end;
[0123] The application (such as a mobile phone APP) is responsible for reading the device ID of the communication module and sending it to the cloud system. The device ID is the unique identifier of the communication module and is used to identify and track the device in the cloud system.
[0124] Specifically, the application establishes a connection with the communication module through Bluetooth, Wi-Fi or other communication protocols and reads its device ID. The application establishes a connection with the communication module through Bluetooth, Wi-Fi or other communication protocols and reads its device ID. After receiving the device ID, the cloud system may perform certain verification operations to ensure the accuracy and integrity of the data.
[0125] Step A123, establishing a corresponding relationship between the device ID and the serial number tag, and storing the corresponding relationship in a cloud database.
[0126] The cloud system is responsible for establishing the correspondence between the device ID and the serial number tag and storing this relationship in the database. This correspondence is the basis for subsequent device management and data tracking.
[0127] The cloud system is responsible for establishing the correspondence between the device ID and the serial number tag, and storing this relationship in the database. This correspondence is the basis for subsequent device management and data tracking. The cloud system is responsible for establishing the correspondence between the device ID and the serial number tag, and storing this relationship in the database. This correspondence is the basis for subsequent device management and data tracking. If the device ID or serial number tag changes (such as device replacement, serial number update, etc.), the cloud system should promptly update the correspondence in the database to ensure the accuracy and consistency of the data.
[0128] In this embodiment, by securely storing the dynamic key in the cloud database, the key can be prevented from being obtained by unauthorized users or systems, thereby protecting the smart device from malicious attacks and data leakage risks. Storing dynamic keys also provides the necessary conditions for the subsequent device authentication process. When a smart device attempts to connect to the cloud, the cloud can confirm its identity by verifying the dynamic key provided by the device, thereby ensuring that only legitimate devices can access the system. By establishing a correspondence between the device ID and the serial number tag, the cloud can achieve comprehensive management and tracking of smart devices. This helps to promptly detect and handle device failures, optimize device configuration, and improve device efficiency.
[0129] The following will be combined Figure 4 The complete process of the intelligent device management method of this application is described in detail, among which: Figure 4 A flowchart of the smart device management method provided for this application.
[0130] First, in the cloud system, a unique SN (serial number) and key are generated for each smart device that is about to leave the factory. The SN label is printed and affixed to the outside of the device, while the key is not burned into the device, but stored in the cloud database, waiting for the subsequent device connection and authentication process.
[0131] Furthermore, the APP quickly connects to the communication module via Bluetooth or softAP to obtain the device ID of the communication module. This connection process is simple and efficient, and the user operation is convenient. Through the APP to scan the SN label on the smart device or manually enter the SN, the APP calls the cloud interface to obtain the key corresponding to the SN, ensuring real-time acquisition of the key instead of pre-burning, reducing production complexity and improving security.
[0132] Furthermore, the device ID and SN of the communication module are sent to the cloud, and the cloud caches the relationship between the two to provide a basis for subsequent communication. The cloud performs real-time data verification to avoid using factory-fixed keys and enhance security.
[0133] Furthermore, the APP securely sends the SN and key to the communication module via TCP or UDP protocol via Bluetooth or softAP to ensure the security and integrity of the data during transmission. The communication module uses the MQTT protocol to log in to EMQX, and the login username is set to the device's SN (device_sn), and the password is the key provided by the cloud. This solution enhances the security of communication through dynamic key authentication.
[0134] Furthermore, after receiving the login request, it is forwarded to the cloud for authentication. The cloud intercepts the SN from the user name, verifies the correctness of the SN and the key, and marks the device as online. At this time, the cloud sends a Modbus instruction template through a custom MQTT topic ( / pub / communication module device ID) for interaction with the smart device.
[0135] Finally, after receiving the Modbus instruction template, the communication module conducts efficient and secure data interaction with the smart device through the serial port, reads the data of the smart device according to the template instruction set, and reports it to the cloud through the MQTT protocol. The cloud subscribes to a specific topic ( / receive / communication module device ID) to obtain the smart device data reported by the communication module, parses the data packet and obtains the unique identification code (SN2) of the device. The cloud associates the communication module device ID, the unique identification code SN2 of the smart device, and SN to form a complete device management chain.
[0136] This application also provides a smart device management device, please refer to Figure 5 , the intelligent device management device comprises:
[0137] The data acquisition module 10 is used to acquire the serial number tag and dynamic key generated and sent by the cloud system for the smart device;
[0138] An authentication module 20 is used to generate a login request according to the serial number tag and the dynamic key, and log in to the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol, and forward the login request to the cloud system for authentication through the Internet of Things message middleware;
[0139] The device management chain generation module 30 is used to obtain the instruction template issued by the cloud system according to the authentication result, read the smart device data according to the instruction template, and report the smart device data to the cloud system so that the cloud system can form a smart device management chain based on the smart device data to manage the smart device.
[0140] The intelligent device management device provided by the present application adopts the intelligent device management method in the above embodiment, which can solve the technical problems of intelligent device management. Compared with the prior art, the beneficial effects of the intelligent device management device provided by the present application are the same as the beneficial effects of the intelligent device management method provided by the above embodiment, and other technical features in the intelligent device management device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0141] The present application provides a management device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the smart device management method in the above-mentioned embodiment one.
[0142] Reference below Figure 6 , which shows a schematic diagram of the structure of a management device suitable for implementing an embodiment of the present application. The management device in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The management device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0143] like Figure 6As shown, the management device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the management device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the management device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a management device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0144] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0145] The management device provided by this application adopts the intelligent device management method in the above embodiment to solve the technical problems of intelligent device management. Compared with the prior art, the beneficial effects of the management device provided by this application are the same as the beneficial effects of the intelligent device management method provided by the above embodiment, and the other technical features in the management device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0146] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0147] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0148] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the smart device management method in the above-mentioned embodiment.
[0149] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0150] The computer-readable storage medium may be included in the management device; or may exist independently without being installed in the management device.
[0151] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the management device, the management device: obtains the serial number tag and dynamic key generated and sent by the cloud system for the smart device; generates a login request according to the serial number tag and the dynamic key, and logs in to the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol, and forwards the login request to the cloud system through the Internet of Things message middleware for authentication; obtains the instruction template issued by the cloud system according to the result of the authentication; reads the smart device data according to the instruction template, and reports the smart device data to the cloud system, so that the cloud system can form a smart device management chain based on the smart device data to manage the smart device.
[0152] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0155] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned smart device management method, and can solve the technical problems of smart device management. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the smart device management method provided in the above-mentioned embodiment, and will not be repeated here.
[0156] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned smart device management method when executed by a processor.
[0157] The computer program product provided in this application can solve the technical problem of intelligent device management. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the intelligent device management method provided in the above embodiment, which will not be repeated here.
[0158] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A smart device management method, characterized in that: Applied to a communication module, the method comprises: Obtain the serial number tag and dynamic key generated and sent by the cloud system for the smart device; Generate a login request according to the serial number tag and the dynamic key, log in to the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol, and forward the login request to the cloud system for authentication through the Internet of Things message middleware; Obtaining an instruction template issued by the cloud system according to the result of the authentication; The smart device data is read according to the instruction template, and the smart device data is reported to the cloud system, so that the cloud system forms a smart device management chain based on the smart device data to manage the smart device.
2. The method according to claim 1, characterized in that The step of generating a login request according to the serial number tag and the dynamic key, and logging into the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol includes: Using the serial number tag as a login name and the dynamic key as a login password, forming a login request according to the login name and the login password; Log in to the Internet of Things message middleware through the login request and message queue telemetry transmission protocol.
3. The method according to claim 1, characterized in that The step of reading the smart device data according to the instruction template and reporting the smart device data to the cloud system includes: Communicate with the smart device through the serial port according to the instruction template to read the smart device data; The smart device data is reported to the cloud system via the message queue telemetry transmission protocol.
4. A smart device management method, characterized in that: Applied to a cloud system, the method includes: Generate a serial number tag and a dynamic key for the smart device, and send the serial number tag and the dynamic key to the communication module; Receive a login request, perform authentication according to the login request, and issue an instruction template to the communication module according to the result of the authentication, wherein the login request is generated by the communication module according to the serial number tag and the dynamic key, and is forwarded by logging into the Internet of Things message middleware through the message queue telemetry transmission protocol; Receive smart device data, and form a smart device management chain based on the smart device data to manage the smart device, wherein the smart device data is read and reported by the communication module according to the instruction template.
5. The method according to claim 4, characterized in that The steps of receiving a login request, performing authentication according to the login request, and issuing an instruction template to the communication module according to the result of the authentication include: Receiving a login request, and extracting a serial number from a login name included in the login request; Using the serial number as a reference, it is compared with the dynamic key stored in the cloud database; If the serial number is successfully compared with the dynamic key stored in the cloud database, a command template is sent to the communication module according to the pre-acquired device ID, and the smart device is marked as online.
6. The method according to claim 5, characterized in that The step of receiving smart device data and forming a smart device management chain based on the smart device data to manage the smart device includes: Receiving and parsing the smart device data read and reported by the communication module according to the instruction template to obtain a unique identification code of the smart device; The pre-stored corresponding relationship is associated with the unique identification code to form a smart device management chain to manage the smart device.
7. The method according to claim 6, characterized in that The step of receiving a login request and extracting a serial number from a login name included in the login request also includes: Storing the dynamic key in a cloud database; Get the device ID of the communication module read by the application side; A corresponding relationship between the device ID and the serial number tag is established, and the corresponding relationship is stored in a cloud database.
8. An intelligent device management device, characterized in that: The device comprises: A data acquisition module, used to acquire the serial number tag and dynamic key generated and sent by the cloud system for the smart device; An authentication module, used to generate a login request according to the serial number tag and the dynamic key, log in to the Internet of Things message middleware through the login request and the message queue telemetry transmission protocol, and forward the login request to the cloud system for authentication through the Internet of Things message middleware; The device management chain generation module is used to obtain the instruction template issued by the cloud system according to the authentication result, read the smart device data according to the instruction template, and report the smart device data to the cloud system so that the cloud system can form a smart device management chain based on the smart device data to manage the smart device.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the smart device management method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the smart device management method according to any one of claims 1 to 7 are implemented.