An automatically discovered Internet of Things protocol access device and access method
Through the design of automatic discovery and protocol adaptation modules, the access process of IoT devices is simplified, the complex problems of traditional access processes are solved, the rapid interoperability between devices and platforms is achieved, the development cost and time are reduced, and the equipment and Diversity of agreements.
Patent Information
- Application Number
- CN202411467283.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-10-21
AI Technical Summary
The access process between traditional IoT devices and platforms is complex and time-consuming, requiring developers to manually program and customize development, resulting in long access time for equipment and limited system deployment and expansion.
Design an automatic discovery IoT protocol access device, including an automatic discovery configuration module, a protocol adaptation module and a storage layer. By automatically scanning and configuring IoT devices, it supports the conversion of data from different protocols into a unified MQTT protocol, simplifying the device Access process.
It realizes rapid interconnection between devices and IoT platforms, reduces developer workload and time costs, provides flexibility and configurability, adapts to changing devices and protocols, and promotes the rapid deployment and expansion of IoT systems.
Smart Images

Figure CN119011631B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to an automatically discovered Internet of Things protocol access device and access method. Background Art
[0002] With the rapid development of the Internet of Things, different IoT devices and platforms have adopted a variety of communication protocols, such as MQTT, CoAP, HTTP, etc. This diversity has brought challenges to the interconnection between devices and IoT platforms, requiring protocol conversion and adaptation.
[0003] Traditional solutions usually require developers to perform programming and customized development, manually configure and adapt each device and protocol, which makes the access process complicated and time-consuming. Developers need to have a deep understanding of the details of each protocol and the characteristics of the device, and write specialized code to achieve protocol conversion and data interaction. This cumbersome development process not only increases the workload of developers, but also prolongs the time for device access, limiting the rapid deployment and expansion of IoT systems. Summary of the invention
[0004] The object of the present invention is to provide an automatically discovered Internet of Things protocol access device and access method.
[0005] An automatically discovered Internet of Things protocol access device, comprising an Internet of Things device, a device access layer, a storage layer, and a business processing layer;
[0006] The IoT device includes multiple IoT devices;
[0007] The device access layer includes an automatic discovery configuration module, a protocol adaptation module, and a task module; the device access layer is used to automatically scan and configure IoT devices, and supports the unified conversion of device messages of different IoT device protocols into the MQTT protocol and forwarding them to the business processing layer;
[0008] The storage layer is used to store automatic discovery strategy data, device information and object model data, and time series data;
[0009] The business processing layer includes a rule engine module, which is used to receive JSON data of MQTT in a unified standard after being processed by the protocol adaptation module, and is used to store time series data processed by the rule engine;
[0010] The IoT device communicates with the device access layer, the device access layer communicates with the IoT device, the storage layer, and the business processing layer, the business processing layer communicates with the storage layer and the device access layer, and the storage layer communicates with the device access layer and the business processing layer.
[0011] Preferably, the automatic discovery configuration module interacts with the Internet of Things device to automatically discover the Internet of Things device, and the automatic discovery configuration module interacts with the storage layer to store the discovered Internet of Things device information in the storage layer; the automatic discovery configuration module interacts with the protocol adapter module to send the discovered Internet of Things device information to the protocol adapter module.
[0012] Preferably, the protocol adaptation module interacts with the automatic discovery configuration module to receive the IoT device information and object model configuration issued by the automatic discovery configuration module, convert the different protocols of the IoT devices into a unified MQTT JSON format, and then pass it to the rule engine module of the business processing layer.
[0013] Preferably, the communication protocol server provided by the protocol adapter module includes MQTT, HTTP, TCP, and UDP servers. The protocol adapter module converts different protocol data of the IoT device into a unified JSON format and transfers it to the business processing layer through MQTT.
[0014] Preferably, the storage layer interacts with the automatic discovery configuration module and the task module through JDBC; after the storage layer obtains the Internet of Things devices discovered by the automatic discovery configuration module, the information data, object model data, and collection task data of the Internet of Things devices are stored; the storage layer interacts with the task module to store the task collection request information initiated periodically by the task module.
[0015] Preferably, the business processing layer interacts with the protocol adaptation module through the MQTT protocol to receive the unified standard MQTT JSON data processed by the protocol adaptation module; the business processing layer interacts with the storage layer through JDBC to store the time series data processed by the rule engine.
[0016] An automatic discovery Internet of Things protocol access method, the steps comprising:
[0017] (1) The automatic discovery configuration module of the device access layer requests the discovery policy from the storage layer, and the storage layer sends the policy data to the automatic discovery configuration module and decrypts it;
[0018] (2) The automatic discovery and configuration module scans and automatically configures the IoT devices, and the IoT devices return the configured data to the automatic discovery and configuration module;
[0019] (3) The automatic discovery configuration module automatically creates device information and object models based on the discovered IoT devices, and stores the device and object model data in the storage layer;
[0020] (4) The automatic discovery configuration module sends the protocol adaptation configuration to the protocol adaptation module based on the configured data returned by the IoT device;
[0021] (5) The task module scans the IoT device information at the storage layer and starts the scheduled polling task;
[0022] (6) The task module initiates a query through the MQTT protocol;
[0023] (7) The protocol adapter module converts the MQTT protocol into the protocol selected in the automatic configuration of the IoT device, and the IoT device reports data using the protocol selected in the automatic configuration;
[0024] (8) After receiving the data reported by the IoT device, the protocol adapter module completes the conversion from the IoT device protocol to the MQTT protocol;
[0025] (9) The protocol adaptation module transmits JSON data to the business processing layer through the MQTT protocol;
[0026] (10) The business processing layer converts JSON data into time series data based on the configured object model and stores it in the storage layer.
[0027] Preferably, in step (2), the step of automatically discovering and configuring the IoT device by the automatic discovery configuration module includes:
[0028] 1) Automatically discover the configuration module, load the policy execution class, and scan the network segment;
[0029] 2) The policy execution class starts scanning IP and ports in combination with the scanning network segment;
[0030] 3) Parse the response and determine whether the authentication method is http basic authentication;
[0031] 4) If the authentication method is http basic authentication, try the configured account and password list. If it is other methods, find the account and password identification bit through the returned HTML response, try the user and pass input tags, and try to log in;
[0032] 5) If login fails, repeat step 4) until all accounts have been tried;
[0033] 6) After successful login, identify the brand of the IoT device according to the mapping part of the extended parameters and call the specific handler class to automatically configure the IoT device;
[0034] 7) Automatic configuration of IoT devices, including selecting the protocol for reporting information, reporting the server's IP and port, generating a unique accessToken and configuring it in the IoT device;
[0035] 8) After the device configuration is completed, a unique identifier is returned, and device information and object model information are automatically created in the storage layer to describe the properties, services, and events of the IoT device.
[0036] Preferably, in step (4), the automatic discovery configuration module sends the protocol adaptation configuration to the protocol adaptation module, and the steps include:
[0037] 1) The protocol adaptation module receives the protocol adaptation configuration sent by the automatic configuration module;
[0038] 2) Get the downlink configuration in the configuration and determine whether the content type of the uplink and downlink is json or plaintext;
[0039] 3) If it is in json format, then get the key value of the content configuration. Two methods are supported for obtaining data: jsonPath expression and custom transformer method;
[0040] 4) If it is in plaintext format, then the method for obtaining the plaintext configured by content is used, which supports the call chain method and uses the plug-in provided by the system;
[0041] 5) Load the protocol configured by the automatic configuration module, support MQTT and HTTP methods to transmit data, and interact with IoT devices.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] The device of the present application can automatically identify the brand and protocol type of IoT devices, and perform automatic protocol conversion and configuration according to pre-configured rules and policies. In this way, developers do not need to manually write special codes, but only need to perform simple configuration and management operations to achieve rapid interconnection between devices and IoT platforms.
[0044] The automatic discovery and rapid configuration of IoT protocol access devices greatly simplifies the device access process and reduces the workload and time cost of developers. It provides flexibility and configurability, can adapt to the growing and changing devices and protocols, and facilitates the rapid deployment and expansion of IoT systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a structural block diagram of the Internet of Things protocol access device of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technical personnel in this field without creative work are within the scope of protection of the present invention.
[0047] An automatically discovered Internet of Things protocol access device includes an Internet of Things device, a device access layer, a storage layer, and a business processing layer; the Internet of Things device communicates with the device access layer, the device access layer communicates with the Internet of Things device, the storage layer, and the business processing layer, the business processing layer communicates with the storage layer and the device access layer, and the storage layer communicates with the device access layer and the business processing layer.
[0048] IoT devices include multiple IoT devices;
[0049] The device access layer includes an automatic discovery configuration module, a protocol adaptation module, and a task module. The device access layer is used to automatically scan and configure IoT devices, and supports the unified conversion of device messages of different IoT device protocols into the MQTT protocol and forwarding them to the business processing layer.
[0050] The storage layer is used to store automatic discovery policy data, device information, object model data, and time series data;
[0051] The business processing layer includes a rule engine module, which is used to receive the JSON data of the unified standard MQTT after being processed by the protocol adaptation module, and is used to store the time series data processed by the rule engine;
[0052] The automatic discovery configuration module in the device access layer interacts with the IoT devices to automatically discover the IoT devices. The automatic discovery configuration module interacts with the storage layer to store the discovered IoT device information in the storage layer. The dynamic discovery module interacts with the protocol adapter module to send the discovered IoT device information to the protocol adapter module.
[0053] The protocol adapter module interacts with the automatic discovery configuration module to receive the IoT device information and object model configuration issued by the automatic discovery configuration module, convert the different protocols of the IoT devices into a unified MQTT JSON format, and then pass it to the rule engine module of the business processing layer.
[0054] The communication protocol servers provided by the protocol adapter module include MQTT, HTTP, TCP, and UDP servers. The protocol adapter module converts different protocol data of IoT devices into a unified JSON format and transfers it to the business processing layer through MQTT.
[0055] The storage layer interacts with the automatic discovery configuration module and the task module through JDBC; after the storage layer obtains the IoT devices discovered by the automatic discovery configuration module, it stores the information data, object model data, and collection task data of the IoT devices; the storage layer interacts with the task module to store the task collection request information initiated periodically by the task module.
[0056] The business processing layer interacts with the protocol adapter module through the MQTT protocol to receive the unified standard MQTT JSON data processed by the protocol adapter module; the business processing layer interacts with the storage layer through JDBC to store the time series data processed by the rule engine.
[0057] An automatic discovery Internet of Things protocol access method, the steps comprising:
[0058] (1) The automatic discovery configuration module of the device access layer requests the discovery policy from the storage layer, and the storage layer sends the policy data to the automatic discovery configuration module and decrypts it;
[0059] (2) The automatic discovery and configuration module scans and automatically configures the IoT devices, and the IoT devices return the configured data to the automatic discovery and configuration module;
[0060] (3) The automatic discovery configuration module automatically creates device information and object models based on the discovered IoT devices, and stores the device and object model data in the storage layer;
[0061] (4) The automatic discovery configuration module sends the protocol adaptation configuration to the protocol adaptation module based on the configured data returned by the IoT device;
[0062] (5) The task module scans the IoT device information at the storage layer and starts the scheduled polling task;
[0063] (6) The task module initiates a query through the MQTT protocol;
[0064] (7) The protocol adapter module converts the MQTT protocol into the protocol selected in the automatic configuration of the IoT device, and the IoT device reports data using the protocol selected in the automatic configuration;
[0065] (8) After receiving the data reported by the IoT device, the protocol adapter module completes the conversion from the IoT device protocol to the MQTT protocol;
[0066] (9) The protocol adaptation module transmits JSON data to the business processing layer through the MQTT protocol;
[0067] (10) The business processing layer converts JSON data into time series data based on the configured object model and stores it in the storage layer.
[0068] In step (2), the steps of the automatic discovery and configuration module scanning and automatically configuring the IoT device include:
[0069] 1) Automatically discover the configuration module, load the policy execution class, and scan the network segment;
[0070] 2) The policy execution class starts scanning IP and ports in combination with the scanning network segment;
[0071] 3) Parse the response and determine whether the authentication method is http basic authentication;
[0072] 4) If the authentication method is http basic authentication, try the configured account and password list. If it is other methods, find the account and password identification bit through the returned HTML response, try the user and pass input tags, and try to log in;
[0073] 5) If login fails, repeat step 4) until all accounts have been tried;
[0074] 6) After successful login, identify the brand of the IoT device according to the mapping part of the extended parameters and call the specific handler class to automatically configure the IoT device;
[0075] 7) Automatic configuration of IoT devices, including selecting the protocol for reporting information, reporting the server's IP and port, generating a unique accessToken and configuring it in the IoT device;
[0076] 8) After the IoT device is configured, it returns a unique identifier and automatically creates device information and object model information in the storage layer to describe the properties, services, and events of the IoT device.
[0077] In step (4), the automatic discovery configuration module sends the protocol adaptation configuration to the protocol adaptation module, and the steps include:
[0078] 1) The protocol adaptation module receives the protocol adaptation configuration sent by the automatic configuration module;
[0079] 2) Get the downlink configuration from the configuration and determine whether the content type of the uplink and downlink is in JSON format or plaintext format;
[0080] 3) If it is in json format, then get the key value of the content configuration. Two methods are supported for obtaining data: jsonPath expression and custom transformer method;
[0081] 4) If it is in plaintext format, then the method for obtaining the plaintext configured by content is used, which supports the call chain method and uses the plug-in provided by the system;
[0082] For example: Uplink configuration example:
[0083] {
[0084] "uplink": {
[0085] "contentType": "json",
[0086] "content": {
[0087] "chains": [{
[0088] "chainClass": "com.vasoyn.iot.chain.JsonHandler",
[0089] "params": {
[0090] "fields": [{
[0091] "key": "accessToken",
[0092] "value": "$.getAccessToken()"
[0093] },
[0094] {
[0095] "key": "deviceName",
[0096] "value": "${$.device}"
[0097] } ]
[0099] }
[0100] }]
[0101] }
[0102] }
[0103] }
[0104] Downlink configuration example:
[0105] {
[0106] "downlink": {
[0107] "contentType": "plainText",
[0108] "content": {
[0109] "chains": [{
[0110] "chainClass": "com.vasoyn.iot.chain.JsonToText",
[0111] "params": {
[0112] "expression": "${$.temperature}"
[0113] }
[0114] },
[0115] {
[0116] "chainClass": "com.vasoyn.iot.chain.TextToHex",
[0117] "params": {}
[0118] } ]
[0120] }
[0121] }
[0122] }
[0123] For existing data such as {"device": "2BFEC3", "lat":"19.1", "lng":"99.1","temperature":"11","humidity":"22"}', in jsonPath mode, such as ${$.device}, the content obtained is 2BFEC3, then the data is constructed as {"deviceName":"2BFEC3"}, and the getAccessToken method in JsonHandler is called with $.getAccessToken() to obtain lltglegu5szbxtlbgv2i (extracted through the mqtt subscription queue), and further construct the data as {"deviceName":"2BFEC3","accessToken":"lltglegu5szbxtlbgv2i"}.
[0124] For example, for the existing data {"device": "2BFEC3", "lat":"19.1", "lng":"99.1","temperature":"11","humidity":"22"}', after the conversion of the downstream chains, the temperature data 11 in json will be obtained first, and then the data will be converted to a after passing through the TextToHex chain.
[0125] 5) Load the protocol configured by the automatic configuration module, support MQTT and HTTP methods to transmit data, and interact with IoT devices.
[0126] This application supports automatic device discovery and automatic configuration. The system can scan IoT devices in the network segment and try to automatically log in and configure. The reason for this design is that in actual scenarios, IoT devices are limited by their own performance and usage scenarios, so in terms of security design, only basic authentication schemes are generally used, such as no verification code, no request limit, and a universal account password, which makes it possible to configure through simulated login. Previously, simulated logins were generally targeted at web business websites, and automatic configuration of IoT devices usually used their own supporting hardware devices, and there was no universal multi-brand solution.
[0127] The automatic discovery configuration strategy is designed to be very flexible. Based on the configuration driver, it can support more device brands and scenarios by extending the implementation class or extending the parameters. At the same time, jasypt is used for encryption and decryption to avoid the leakage of sensitive information.
[0128] After automatic configuration, accessToken can be formed to control and identify the device. The system will automatically create device information and object model information according to the device configuration results, automatically match according to the brand model, and push the configuration to the protocol adapter module. Here, the protocol adapter module only performs protocol conversion and does not process message format parsing. In general, the message format is directly parsed in the protocol adapter module to form a specific key-value pair and report it to the upper platform. This will cause the coupling between the protocol adapter module and the specific device to be unfavorable for expansion. This solution designs the protocol adapter module to be driven by configuration. The configuration adopts chains design, which can be reused and freely combined, but does not process message format parsing. It passes the message format to the business processing layer like a pipeline, and the business processing layer parses it according to the object model. The advantage is that if a new brand is connected, such as adding a new temperature and humidity sensor of brand A, you only need to adjust the object model information. The protocol conversion part can be fully reused.
[0129] The above shows and describes the basic principles, main features and advantages of the present invention. Technical personnel in this industry should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not used to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. An automatic discovery Internet of Things protocol access method, characterized in that: steps include: (1) The automatic discovery configuration module of the device access layer requests the discovery policy from the storage layer, and the storage layer sends the policy data to the automatic discovery configuration module and decrypts it; (2) The automatic discovery and configuration module scans and automatically configures the IoT devices, and the IoT devices return the configured data to the automatic discovery and configuration module; (3) The automatic discovery configuration module automatically creates device information and object models based on the discovered IoT devices, and stores the device and object model data in the storage layer; (4) The automatic discovery configuration module sends the protocol adaptation configuration to the protocol adaptation module based on the configured data returned by the IoT device; (5) The task module scans the IoT device information at the storage layer and starts the scheduled polling task; (6) The task module initiates a query through the MQTT protocol; (7) The protocol adapter module converts the MQTT protocol into the protocol selected in the automatic configuration of the IoT device, and the IoT device reports data using the protocol selected in the automatic configuration; (8) After receiving the data reported by the IoT device, the protocol adapter module completes the conversion from the IoT device protocol to the MQTT protocol; (9) The protocol adaptation module transmits JSON data to the business processing layer through the MQTT protocol; (10) The business processing layer converts JSON data into time series data according to the configured object model and stores it in the storage layer; In step (2), the steps of the automatic discovery and configuration module scanning and automatically configuring the IoT device include: 1) Automatically discover the configuration module, load the policy execution class, and scan the network segment; 2) The policy execution class starts scanning IP and ports in combination with the scanning network segment; 3) Parse the response and determine whether the authentication method is http basic authentication; 4) If the authentication method is http basic authentication, try the configured account and password list. If it is other methods, find the account and password identification bit through the returned HTML response, try the user and pass input tags, and try to log in; 5) If login fails, repeat step 4) until all accounts have been tried; 6) After successful login, identify the brand of the IoT device according to the mapping part of the extended parameters and call the specific handler class to automatically configure the IoT device; 7) Automatic configuration of IoT devices, including selecting the protocol for reporting information, reporting the server's IP and port, generating a unique accessToken and configuring it in the IoT device; 8) After the device configuration is completed, a unique identifier is returned, and device information and object model information are automatically created in the storage layer to describe the properties, services, and events of the IoT device.
2. The method for automatically discovering an Internet of Things protocol access according to claim 1, characterized in that: In the step (4), the automatic discovery configuration module sends the protocol adaptation configuration to the protocol adaptation module, and the steps include: 1) The protocol adaptation module receives the protocol adaptation configuration sent by the automatic configuration module; 2) Get the downlink configuration in the configuration and determine whether the content type of the uplink and downlink is json or plaintext; 3) If it is in json format, then get the key value of the content configuration. Two methods are supported for obtaining data: jsonPath expression and custom transformer method; 4) If it is in plaintext format, then the method for obtaining the plaintext configured by content is used, which supports the call chain method and uses the plug-in provided by the system; 5) Load the protocol configured by the automatic configuration module, support MQTT and HTTP methods to transmit data, and interact with IoT devices.
3. An access device for executing the automatic discovery Internet of Things protocol access method according to any one of claims 1-2, characterized in that: Including IoT devices, device access layer, storage layer, and business processing layer; The IoT device includes multiple IoT devices; The device access layer includes an automatic discovery configuration module, a protocol adaptation module, and a task module; the device access layer is used to automatically scan and configure IoT devices, and supports the unified conversion of device messages of different IoT device protocols into the MQTT protocol and forwarding them to the business processing layer; The storage layer is used to store automatic discovery strategy data, device information and object model data, and time series data; The business processing layer includes a rule engine module, which is used to receive JSON data of MQTT in a unified standard after being processed by the protocol adaptation module, and is used to store time series data processed by the rule engine; The IoT device communicates with the device access layer, the device access layer communicates with the IoT device, the storage layer, and the business processing layer, the business processing layer communicates with the storage layer and the device access layer, and the storage layer communicates with the device access layer and the business processing layer.
4. The access device for executing the automatic discovery Internet of Things protocol access method according to claim 3, characterized in that: The automatic discovery configuration module interacts with the IoT device to automatically discover the IoT device, and the automatic discovery configuration module interacts with the storage layer to store the discovered IoT device information in the storage layer; The automatic discovery configuration module interacts with the protocol adaptation module to send the discovered Internet of Things device information to the protocol adaptation module.
5. The access device for executing the automatic discovery Internet of Things protocol access method according to claim 3, characterized in that: The protocol adapter module interacts with the automatic discovery configuration module to receive the IoT device information and object model configuration issued by the automatic discovery configuration module, convert the different protocols of the IoT devices into a unified MQTT JSON format, and then pass it to the rule engine module of the business processing layer.
6. The access device for executing the automatic discovery Internet of Things protocol access method according to claim 3, characterized in that: The communication protocol server provided by the protocol adapter module includes MQTT, HTTP, TCP, and UDP servers. The protocol adapter module converts different protocol data of IoT devices into a unified JSON format and transfers it to the business processing layer through MQTT.
7. The access device for executing the automatic discovery Internet of Things protocol access method according to claim 3, characterized in that: The storage layer interacts with the automatic discovery configuration module and the task module through JDBC; after the storage layer obtains the Internet of Things devices discovered by the automatic discovery configuration module, the information data, object model data, and collection task data of the Internet of Things devices are stored; the storage layer interacts with the task module to store the task collection request information initiated periodically by the task module.
8. The access device for executing the automatic discovery Internet of Things protocol access method according to claim 3, characterized in that: The business processing layer interacts with the protocol adaptation module through the MQTT protocol to receive the JSON data of the unified MQTT after being processed by the protocol adaptation module; the business processing layer interacts with the storage layer through JDBC to store the time series data processed by the rule engine.