Internet of things gateway external equipment type identification system

By integrating multiple interfaces and external device identification modules within the IoT gateway, using the GPIO interface to read level status to generate binary identification codes, and automatically configure device types, the problem of manual configuration of external devices in the IoT gateway is solved, and plug-and-play and cost reduction are achieved.

CN120342867APending Publication Date: 2025-07-18BEIJING UNIV OF POSTS & TELECOMM
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510594095.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

Existing IoT gateways require manual configuration of interfaces and device types when connecting external devices, resulting in cumbersome and costly development process, lack of flexibility and plug-and-play functionality.

Method used

The MCU, I2C, 1-Wire, UART and SPI interfaces are integrated within the Internet of Things gateway, and the identification module is integrated on the external device, communication is carried out through the connection line, and the level status of the device is read using the GPIO interface to generate a binary identification code, and the device type is automatically configured.

Benefits of technology

It realizes plug-and-play of IoT gateway devices, reduces production costs, improves flexibility and user experience, and reduces the need for manual configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342867A_ABST
    Figure CN120342867A_ABST
Patent Text Reader

Abstract

The invention discloses an Internet of Things gateway external equipment type identification system, which belongs to the field of Internet of Things gateway equipment adaptation, and comprises an Internet of Things gateway MCU (Microprogrammed Control Unit), an I2C (Inter-Integrated Circuit) equipment interface, a 1-Wire equipment interface, a UART (Universal Asynchronous Receiver / Transmitter) equipment interface and an SPI (Serial Peripheral Interface) standby interface which are packaged in an Internet of Things gateway shell, the integrated identification module and the identification equipment are packaged in the external equipment shell; and the two shells communicate with each other through a connecting line. The method comprises the following steps: firstly, connecting a to-be-identified device M to a GPIO (General Purpose Input / Output) interface of an MCU (Microprogrammed Control Unit) through a connecting line, setting the to-be-identified device M as an input port, and reading an initial level state of each data line; then, the initial level states are combined into an identification code in a binary mode; and finally, according to an identification code table pre-stored in the Internet of Things gateway MCU, finding a corresponding to-be-identified device type, and performing mode configuration of an internal configuration module. Or the method is used for identifying different versions of PCBs of the external equipment. According to the invention, extra chips are not needed, so that the production cost is reduced, and convenience is brought to users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of Internet of Things gateway device adaptation, and in particular relates to an Internet of Things gateway external device type identification system. Background Art

[0002] The Internet of Things (IoT) is a large-scale virtual network that connects a large number of electronic devices to the Internet through various access technologies. [1] Electronic devices including RFID, sensors and other actuators gather heterogeneous information to complete a specific task. The Internet of Things has a wide range of uses, covering transportation, environmental protection, safety, industrial monitoring and other fields. It has expanded the scope of communication from people to people and things, things to things, so that high-rise buildings and commodities that originally had no information meaning can also be well interconnected with computers through the Internet of Things technology, thereby providing users with various information services.

[0003] The architecture of the Internet of Things is simply divided into three layers: perception extension layer, network layer and application layer [2][3] , respectively, provide some important features for the Internet of Things: comprehensive perception, reliable transmission and intelligent processing. The perception extension layer of the Internet of Things usually uses a variety of sensors, sensor networks, REID, QR codes, cameras, GPS and smart objects to fully perceive various information in the real world. The perception extension layer nodes of the Internet of Things have the characteristics of large number, low cost and weak computing power; however, the perception extension layer is the source of information in the Internet of Things. How to better manage and maintain the data transmission within the perception extension layer network has always been one of the important issues of the Internet of Things.

[0004] Structurally, the IoT application structure is divided into IoT gateway, communication module, perception processing module and sensor module. Among them, 1) the perception processing module completes the physical connection between the sensor module and the communication module, as well as the preprocessing of sensor collected data, the conversion of communication protocols and other functions; its physical appearance is an independent module or integrated with the communication module and the sensor module. 2) The communication module realizes the function of the perception processing module to communicate with the outside world, and is usually connected to the routing node or the IoT gateway; it is installed on the perception processing module, or it is a separate functional module. 3) The sensor module has computing and storage functions, can complete the digital transmission of the collected information, and communicate with the perception processing module through a unified interface and corresponding protocols.

[0005] Industrial Internet of Things [4][5]It is an important part of the new generation of information technology. In the industrial Internet of Things architecture, a gateway device is needed between the perception layer network and the industrial Internet to achieve the interconnection between the industrial Internet and the sensor layer network. The industrial Internet of Things gateway is designed to solve the problem that the current perception layer network devices are horizontally unrelated and cannot be linked, controlled and managed in a unified manner. The gateway uses the industrial Internet as a carrier to exchange information and collect, store, analyze and manage the information of perception network devices scattered in various industrial sites.

[0006] From the perspective of the industrial chain, communication modules and perception processing modules have poor compatibility, are difficult to coordinate, and have high costs, so they need to be adapted by professional manufacturers. [6][7][8] From the user's perspective, being tied to a fixed manufacturer is not conducive to users getting high-quality after-sales service. From a cost perspective, setting a unified interface standard and forming large-scale production will greatly reduce the total cost.

[0007] Unifying the interface between the perception processing module and the communication module is beneficial to the entire industry chain [9] , which is beneficial to the selection of communication modules, product design, device selection, material procurement and unification of technical specifications of the entire industry by IoT enterprises, and promotes reasonable and orderly competition among enterprises, avoids industry monopoly and enables healthy development of the industry. Due to inconsistent interfaces, there are many PCB versions, and modules of different communication formats cannot be interchanged, which causes huge waste of resources for IoT manufacturers.

[10]

[11]

[12] .

[0008] Currently, the IoT gateways available on the market often use serial port connections to access the sensor processing module, that is, they are connected to the external MCU through the serial port. The MCU is not only responsible for the type identification of the sensor module, but also for converting the data of the sensor module into serial port transmission. Take Advantech's industrial communication IoT gateway ECU-1251TL as an example

[13] The IoT gateway has four sets of RS-232 / 485 serial communication interfaces. If you want to use the IoT gateway to connect multiple sensors to collect environmental data, users not only need to be familiar with each sensor module first, connect the sensor modules to be used to a single-chip microcomputer, but also need to write a logical processing program for the collected sensor data and a processing program for serial port conversion and transmission of the collected data. In addition, the IoT gateway also requires users to be familiar with the gateway's user development manual and manually configure it according to the RS-232 / 485 port to which the external device is connected, which results in a cumbersome development process.

[0009] In the prior art, a pluggable unified interface gateway based on a wireless sensor network is provided.

[14] , which can conveniently achieve the stable transmission of various types of data to the remote host computer. The data input part of this gateway includes a ZigBee module and a WiFi module. The data processing part includes a core processor, a power management module, a liquid crystal display, and a storage module. The data output part includes a communication interface and a communication module. The communication module includes a GPRS communication module, a 3G communication module, a 4G communication module, and a WiMax communication module.

[0010] In addition, there is also a method for identifying unmarked Internet of Things devices based on mobile AR

[15] , which uses the camera of a mobile AR device to identify the same type of Internet of Things devices, and then comprehensively uses various sensor data (including global positioning system, accelerometer, gyroscope, electronic compass) to calculate the global coordinates of the target Internet of Things device individual, and obtains the unique ID of the target Internet of Things device through database matching.

[0011] However, the existing technologies have the following disadvantages:

[0012] 1. Interface adaptation and manual configuration of external device types are required

[0013] In the Internet of Things embedded development, developers need to customize the interfaces connected to different device types and the types of external devices to be used, lacking flexibility and increasing the workload of developers.

[0014] 2. Only the adapted external devices and the corresponding interfaces can be selected for connection

[0015] Some Internet of Things gateway products support users to add external devices by themselves to enhance the functionality of the Internet of Things gateway, but they need to be connected according to the user manual and only support the relevant externally connected devices that have been adapted. The degree of freedom is not high, and it is quite dependent on the adaptation integrity and progress of the manufacturer.

[0016] 3. The device type identification solutions with identification modules are costly

[0017] By connecting an external device to a simplified single-chip microcomputer and using this single-chip microcomputer as an identification module to store the adaptation information of relevant devices. When in use, the device information is transmitted to the data center by means of wireless communication or wired transmission, etc., for driver loading and device invocation. Therefore, when applied to actual production, such solutions require additional costs for purchasing chips and network usage.

[0018] The references are as follows:

[0019] [1] Xiao Huibin. Research on the Development of Enterprise Information Interaction Middleware Technology in the Internet of Things p1. Beijing: North China University of Technology, 2009.

[0020] [2] Wang went to Beijing. Research and Application of the Internet of Things in Mechatronics Interface Technology II 1. Information Technology and Informatization, 2014(5): 106 - 108, 110.

[0021] [3] Yu Minghui. Research on Mechatronics System Interface Technology II 1. Journal of Jiangxi Vocational and Technical College of Electricity, 2013(4): 16 - 17.

[0022] [4] Wu Gongyi, Wu Ying. Introduction to the Internet of Things Engineering [M]. Beijing: China Machine Press, 2012.

[0023] [5] Zhan Yuexiangdong, Wei Qinfang, Xiang Min. Internet of Things Security [M]. Beijing: Science Press, 2012.

[0024] [6] Wu Renpeng, Shu Yi, etc. Internet of Things Technology and Applications [M]. Beijing: Publishing House of Electronics Industry, 2013.

[0025] [7] Xu Xiaotao, Yang Zhihong. Internet of Things Information Security [M]. Beijing: Posts & Telecom Press, 2012.

[0026] [8] Zhang Feizhou, Yang Dongkai. Internet of Things Applications and Solutions [M]. Beijing: Publishing House of Electronics Industry, 2012.

[0027] [9] Huang Haikun, Deng Jiajia. Internet of Things Gateway Technology and Applications [J]. Telecommunications Science, 2010(4): 20 - 24.

[0028]

[10] Li Zhan. Research and Simulation of Internet of Things Asynchronous Communication [D]. Chengdu: College of Information Science and Technology, Chengdu University of Technology, 2014.

[0029]

[11] Yuan Chaowei, Zhang Jinbo, Yao Jianbo. Current Situation and Development of the Convergence of the Three Networks [J]. Journal of Beijing University of Posts and Telecommunications. 2010, 33

[0030]

[12] Jinying Chen, Min Lin, Zhongming Zhu. Five Network

[0031] Amalgamation[C]. CECNet. 2011, The International Conference on Consumer Electronics,

[0032] Communications and Networks. Xianning, Hubei P.R.China, April 16th~18th, 201l Page(S): 4089 - 4092.

[0033]

[13] Advantech Gateway Industrial Communication Internet of Things Gateway ECU-1251TL. [Online]. Available:

[0034] https: / / www.advantech.com / products / 7332cf9e-bf70-4a79-b0b6-fd8a2182cd72 / ecu-1251 / mod_e5d32fa3-7e7a-47f4-bc5e-abef878c27c6, ADVANCETECH ECU-1251

[0035]

[14] Chen Kansong. A Pluggable Unified Interface Gateway Based on Wireless Sensor Network [P]. Chinese Patent: CN204168495U, September 11, 2014

[0036]

[15] Xia Ming, Xiang Wenxiu. A Method for Identifying Markerless Internet of Things Devices Based on Mobile AR [P]. Chinese Patent: CN110135238B, March 26, 2019. Summary of the Invention

[0037] In view of the phenomenon that existing Internet of Things gateways need to be manually configured according to the connected interfaces and device types when connecting external devices, the present invention proposes an external device type identification system for an Internet of Things gateway. An identification module is integrated on the external device without adding an additional identification chip. Through this identification module and the adaptation module inside the Internet of Things gateway, plug-and-play of various external devices when accessing the gateway is realized, enabling the gateway device to add external devices on demand at low cost without manual reconfiguration.

[0038] The external device type identification system for the Internet of Things gateway includes: an Internet of Things gateway MCU, an I2C device interface, a 1-Wire device interface, a UART device interface, and an SPI device interface encapsulated inside the housing of the Internet of Things gateway; and an integrated identification module and identification device encapsulated inside the housing of the external device; communication between the two housings is carried out through a connecting wire.

[0039] With the Internet of Things gateway MCU as the core, it includes a computing unit, a storage unit, and various types of external interfaces, which are respectively connected to the I2C device interface, the 1-Wire device interface, the UART device interface, the SPI device interface, and the GPIO interface through different types of external interfaces; each different device interface is matched with a GPIO interface and is connected to the external identification device through a connecting wire.

[0040] The recognition device includes: an external I2C device, an external 1-Wire device, an external UART device, and an external SPI device; each device is respectively connected to the corresponding device interface in the IoT gateway MCU through a connecting line.

[0041] The connecting line is a TYPE-C data cable, supporting up to 24 data lines; when it uses n data lines, the maximum number of recognition devices that can be supported is 2 to the power of n; the data lines include: 5V power input line, 3.3V power input, GND ground wire, GPIO line, SDA data line, SCL data line, and the data line of the 1-Wire device, etc.; the use and type of each data line are adjusted according to actual needs.

[0042] Each external recognition device represents the device type identification code of the recognition module through the high / low level status of the data line, which is represented by a binary code; if the data line level status is high, the recognition data bit feedback by the recognition module represents 1, otherwise, the recognition data bit represents 0.

[0043] The working principle of the IoT gateway external device type recognition system is as follows:

[0044] For a certain external device M to be recognized, first, connect it to the GPIO interface connected to the IoT gateway MCU through a connecting line, and set the GPIO interface as an input port to read the initial level status transmitted by the device M to be recognized through each data line; the initial level status of each device to be recognized is set in advance;

[0045] Then, according to the initial level status of each data line, combine them in binary to form the recognition code of the device M to be recognized;

[0046] When the initial level status is a high level status, it is judged that the data line connected to the GPIO interface is at a high level. If the recognition module contains multiple data lines for recognition and the current data line is the first data line, it is considered that the current recognition has the lowest bit as 1;

[0047] When the initial level status is a low level status, it is judged that the data line connected to the GPIO interface is at a low level. Similarly, if the current data line is the first data line, it can be considered that the current recognition has the lowest bit as 0;

[0048] Therefore, the high and low level recognition data bits of each data line read are combined in binary, with the high level as 1 and the low level as 0, and an OR operation is performed by shifting from low to high to combine the values of all data lines into a binary recognition code;

[0049] Finally, according to the identification code table pre-stored inside the MCU of the IoT gateway, find the corresponding device type to be identified, and perform mode configuration for the internal configuration module; or it is used to identify different versions of PCBs of external devices.

[0050] The advantages of the present invention are as follows:

[0051] 1. For the external device type identification system of the IoT gateway of the present invention, the sensor device is modularized. When applied to the IoT gateway, the user only needs to insert the sensor module into the gateway interface, and the IoT gateway device can identify the type of the connected sensor device and automatically configure it. Moreover, when there are multiple interfaces on the IoT gateway, the user does not need to select the corresponding interface according to the sensor device to be connected, realizing the generalization of the interface. At the same time, by using the interface adaptation method proposed by the present invention, the sensor module does not need to add extra chips for device identification, reducing the production cost and facilitating the user's use.

[0052] 2. For the external device type identification system of the IoT gateway of the present invention, it realizes the convenient identification of IO devices by connecting ordinary IO ports. That is, when the IoT gateway connects to a device, it is no longer necessary to manually confirm the device type and manually configure the device. Instead, after the device IO is hard-connected to the gateway, the gateway can independently identify the device type and find the configuration policy from the preset table. Specifically, the connection of the device will be almost imperceptible; the user only needs to connect the IO to the gateway, and the identification and configuration work will be carried out automatically, making the plug-and-play function realized from the user's perspective.

[0053] 3. For the external device type identification system of the IoT gateway of the present invention, it uses the redundant ordinary IO ports on the MCU of the IoT gateway and the high and low levels clamped by pull-up or pull-down resistors to represent each bit of data of the device identification code. Inside the gateway device, the corresponding device type is identified by looking up the table to automatically identify and configure the external device. Since no extra chips are needed for device identification, the production cost is reduced and the user's use is facilitated. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 is the architecture diagram of the external device type identification system of the IoT gateway of the present invention;

[0055] Figure 2 is the working principle diagram of the external device type identification system of the IoT gateway of the present invention;

[0056] Figure 3 is the implementation diagram of the external module of the DHT11 temperature and humidity sensor in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0057] The specific implementation method of the present invention is further described in detail below in conjunction with the accompanying drawings.

[0058] In the process of adapting and developing external devices, the traditional IoT gateway first needs to connect the external device to the user interface of the IoT gateway using a data connection jumper. Then the IoT gateway needs to load the corresponding device driver into the operating system kernel according to the identification interface number and device type of the interface to which the external device is connected before it can correctly identify the device. Developers need to manually write relevant codes to call the corresponding interface and the corresponding device driver for subsequent device use according to the interface identification number of the corresponding microcontroller connected to the external device and the type of the external device.

[0059] On this basis, the present invention proposes an IoT gateway external device type identification system, which does not use an additional identification chip, but only adds an identification module to the external device. Through the identification module and the adapter module inside the IoT gateway, plug-and-play is achieved when various external devices are connected to the gateway, so that the gateway device can add external devices on demand at low cost without manual reconfiguration.

[0060] In the field of Internet of Things, the Internet of Things gateway is the core component of the Internet of Things and various control systems. Since most traditional industrial embedded external devices cannot be connected to the Internet, and most small connection nodes are unable to provide IP layer protocols due to cost or power consumption considerations, the Internet of Things gateway plays a connecting role, and its main use scenario is the need to add various types of external devices. The Internet of Things gateway is essentially a computer connected to the Internet, and its core is the Microcontroller Unit (MCU). The MCU of the Internet of Things not only has stronger data processing capabilities, but also has a wealth of peripheral interfaces SPI, I2C, I2S, PCM, UART, JTAG, GPIO, etc. The GPIO (General-purpose input / output) on the MCU is a general-purpose input and output port. The GPIO port can be used as an input and output port through configuration. For the convenience of description below, ordinary IO ports are used.

[0061] The IoT gateway external device type identification system, such as Figure 1As shown in the figure, it includes: an Internet of Things gateway MCU 10 encapsulated inside the Internet of Things gateway housing 15, an I2C (Inter-Integrated Circuit) device interface 11, a 1-Wire device interface 12, a UART (Universal Asynchronous Receiver / Transmitter) device interface 13, and an SPI (Serial Peripheral Interface Bus) device interface 14; and an integrated identification module 31 and an identification device encapsulated inside an external device housing 30. Communication is carried out between the two housings through a connection line 20.

[0062] With the Internet of Things gateway MCU 10 as the core, it includes a computing unit, a storage unit, and various types of external interfaces (such as the above-mentioned GPIO, SPI, UART, etc. interfaces), and is respectively connected to the I2C device interface 11, the 1-Wire device interface 12, the UART device interface 13, the SPI device interface 14, and the GPIO interface through different types of external interfaces. Each different device interface is matched with a GPIO interface and is connected to an external identification device through a connection line.

[0063] Among them, the GPIO interface, as a general-purpose IO (Input / Output) port, has input and output functions. The single-chip microcomputer can select the input and output states of the IO port according to different applications. For the general-purpose IO port with the input state to be read, first, the single-chip microcomputer sets this general-purpose IO port to the input function, that is, this general-purpose IO port receives input signals as an input port.

[0064] It should be noted that the types of external devices supported by the Internet of Things gateway device are determined by the MCU of the gateway device. The types of interfaces inside different models of MCUs will be different. For example, some MCUs only have 1 group of UART interfaces, and according to the design of the internal MCU, some GPIO ports can only be configured as input modes. Each group of GPIO of each type of interface in this embodiment should be able to be configured as an input mode. Of course, the number of various types of interfaces of the MCU is not limited either. For example, if there is an MCU with two groups of UART interfaces, there can be two groups of UART device interfaces in the figure. In addition, there are cases where some GPIO ports can be configured as SPI or UART. The working principle can be configured into the corresponding mode according to the internal configuration module of the corresponding MCU model, which will not be elaborated here.

[0065] The identification device includes: an external I2C device 32, an external 1-Wire device 34, an external UART device 33, and an external SPI device 35; each device is respectively connected to the corresponding device interface in the Internet of Things gateway MCU through a connection line.

[0066] The connection line 20 is used to connect the external device interface of the Internet of Things gateway and external devices. It should be noted that, for the greatest convenience of users, the physical shapes of the above various types of device interfaces can adopt the same shape. Thus, the same connection line can be used to connect different types of external devices. Specifically, the connection line in this embodiment adopts TYPE-C as the interface shape and supports up to 24 data lines at most; when it uses n data lines, the maximum number of identifiable devices that can be supported is 2 to the power of n; the data lines include: 5V power input line, 3.3V power input, GND ground wire, GPIO line, SDA data line, SCL data line, and data line of 1-Wire device, etc.; the use and type of each data line are adjusted according to actual needs; the number of data lines used for the connection line of each identifiable device is set in advance.

[0067] For example, in this embodiment, there are two GPIO lines connected to the MCU for each external interface, and there are a total of 4 external device interfaces. The first data line can be used as the 5V power input line, the second as the 3.3V power input, the third data line as the GND ground wire, the fourth to fifth data lines as GPIO lines. Then, the sixth data line can be used as the SDA data line of the I2C interface, and the seventh data line can be used as the SCL data line of the I2C interface. The eighth data line is used as the data line of the 1-Wire device. And so on.

[0068] Each external identification device represents the device type identification code of the identification module through the high / low level state of the data line, which is represented by a binary code; if the data line level state is high, the identification data bit fed back by the identification module represents 1, and vice versa, the identification data bit represents 0. The number of bits of the device identification code can be determined according to the data of the ordinary IO ports used, and the maximum number of identifiable device types can be determined according to the number of bits of the identification code.

[0069] The working principle of the external device type identification system of the Internet of Things gateway is as follows: The internal reading module of the Internet of Things gateway reads the level state of the ordinary IO ports to obtain the external device identification code, and then matches it with the identification code stored inside the MCU to obtain the external device type corresponding to the identification code. Finally, the device driver module of the Internet of Things gateway is configured so that the programs of the external devices used by the entire Internet of Things gateway can automatically sense the type of the connected external device and execute the corresponding program logic.

[0070] As Figure 2 shown, the specific process is as follows:

[0071] S101. First, for an external device M to be recognized, connect it to a general-purpose IO port connected to the MCU of the IoT gateway through a connection line, set the general-purpose IO port as an input port, and read the initial level state transmitted by the device M to be recognized through each data line; the initial level state of each device to be recognized is set in advance.

[0072] The general-purpose IO ports of the IoT gateway have input and output functions. The IoT gateway can select the corresponding input and output states of the IO ports according to different applications. For the general-purpose IO port to read the input state, first, the IoT gateway sets the general-purpose IO port to the input function, that is, the general-purpose IO port receives input signals as an input port.

[0073] An external recognition module is externally connected to the IoT gateway through a general-purpose IO port. The external recognition module and the external device are integrated in a housing. The number of general-purpose IO ports connecting the external recognition module and the IoT gateway can be one or more. And according to the number of general-purpose IO ports connecting the external recognition module and the IoT gateway, the maximum number of device types that the external recognition module can recognize is determined. Each data line connected to the IoT gateway IO port inside the external recognition module can have two states: high level or low level, which is determined according to the connection situation of the data line.

[0074] When the data line is in the high-level state, one end of the data line is connected to the power supply of the recognition module through a pull-up resistor, and the other end is connected to the GPIO interface; when the data line is in the low-level state, one end is connected to the GPIO interface, and the other end is grounded through a pull-down resistor.

[0075] Furthermore, the IoT gateway needs to configure one or more general-purpose IO ports connected to the external recognition module as the input mode to detect the level of these general-purpose IO ports. The IoT gateway uses the level conditions of each general-purpose IO port read as the values of the recognition data bits fed back by the external recognition module. Generally, if the detected data line level is high, it represents 1; conversely, if the measured data line level is low, it represents 0.

[0076] Furthermore, if the external recognition module contains 3 data lines, the maximum number of devices that can be recognized is 8; if the external recognition module contains 4 data lines, the maximum number of devices that can be recognized is 16, and so on. Of course, when the recognition bit conditions represented by the level of each data line in the external recognition module connected to the general-purpose IO port are different, the corresponding input states are also different. Therefore, in this embodiment, different device types can be recognized by judging the level differences of the general-purpose IO ports connected to the external recognition module.

[0077] S102. Then, combine the initial level states of each data line into a recognition code in binary format.

[0078] The IoT gateway detects the general-purpose IO ports based on an external identification module and an internal configuration module. According to the initial level status of the general-purpose IO ports obtained, it determines the high and low level conditions of each data line for identification in the external identification module, and then determines the conditions of each identification bit. When the initial level status is high level, it is determined that the data line connected to the GPIO interface is high level. If the identification module includes multiple data lines for identification and the current data line is the first data line, it is considered that the current identification of the lowest bit is 1;

[0079] When the initial level status is low level, it is determined that the data line connected to the GPIO interface is low level. Similarly, if the current data line is the first data line, it can be considered that the current identification of the lowest bit is 0;

[0080] Therefore, the high and low level identification data bits of each data line read are, in binary form, with high level as 1 and low level as 0, and an OR operation is performed by shifting from low to high, combining the values of all data lines into a binary identification code;

[0081] For example, when three data lines are used, the corresponding high and low level identification data bits are 0, 1, 0 respectively. Then the first data line remains unchanged, the second data line is shifted left by 1 bit, the third data line is shifted left by 2 bits, and finally a bitwise OR operation is performed to obtain the final identification code 010.

[0082] Therefore, according to the initial level status of the general-purpose IO ports obtained, the high and low levels of the data lines of the identification module are used to represent the device type identification code represented by the identification module. The IoT gateway can determine the identification code value in the external identification module connected to the general-purpose IO port by detecting the level of the general-purpose IO, so as to perform mode configuration on the internal configuration module of the IoT gateway.

[0083] S103. According to the identification code table pre-stored in the IoT gateway MCU, find the corresponding device type to be identified and perform mode configuration on the internal configuration module; or be used to identify different versions of PCBs of external devices.

[0084] Based on the identification code detected, initialize the driver loading module of the IoT gateway for the device type represented by the external identification module.

[0085] After determining the identification code value in the external identification module according to the initial level status, the IoT gateway performs mode configuration on the internal configuration module through the device types corresponding to each identification code stored in the internal memory.

[0086] Specifically, if an external identification module includes 3 data lines for identification, the identification code of the identification module is a 3-bit binary number. For example, the obtained identification code in this embodiment is 001. Inside the IoT gateway, according to the query table, the device type corresponding to 001 is a temperature and humidity sensor such as DHT11. Then, the internal configuration module of the IoT gateway is configured into the DHT11 mode.

[0087] Inside the IoT gateway, there can be one or more groups of general-purpose I / O ports for connecting external identification modules, which are specifically manifested as one or more interfaces for connecting external devices outside the IoT gateway. In addition, when the IoT gateway determines that the external identification module is disconnected, it is considered that the external sensing device is disconnected. Until the next time the IoT gateway detects a change in the level, that is, a new external device is inserted, the IoT gateway re-obtains the identification code and configures the mode of the internal configuration module. When a device of type DHT11 is connected, after the daemon program inside the IoT gateway detects it, it directly calls the driver related to DHT11.

[0088] In addition, the general-purpose I / O ports can also be used to identify multiple input states to indicate different version numbers, such as the PCB version number. For example, when the PCB version number is indicated by the combination of 2 general-purpose I / O ports, 4 different PCB version numbers can be indicated, which can bring great convenience to the development and design of products in practical applications.

[0089] In an alternative embodiment of this embodiment, when it is necessary to identify different labels such as the PCB version number, different input states of the general-purpose I / O ports and their corresponding different labels, that is, the corresponding PCB version numbers, can be preset in advance, and a query table can be formulated according to the different input states of the general-purpose I / O ports preset in advance and their corresponding different labels. After identifying the different input states of the general-purpose I / O ports, look up and compare in the query table to identify the corresponding label, which can be more conveniently and quickly applied to identify different labels such as the PCB version number.

[0090] As Figure 3 shown, it is an implementation diagram of the external module of the identification module 31 representing the external device type of DHT11 temperature and humidity sensor in this embodiment. Among them, the DHT11 sensor is a 1-Wire device, and is connected to the DHT11 sensor through the 5V power input, GND ground wire, and 1-Wire data line of the connection line 20. DHT11 and the identification module 31 are wrapped in an external device housing 30. Among them, the identification module 31 is connected to the GPIO inside the IoT gateway through CC1 and CC2 of the connection 20.

[0091] In this implementation, there are two resistors R1 and R2 in the recognition module. One end of R1 is connected to CC1, and the other end is connected to the 5V power input. It is a pull-up resistor, which plays the role of current limiting and clamping the potential of CC1 at a high level. One end of R2 is connected to CC2, and the other end is connected to the GND ground wire. It is a pull-down resistor, which plays the role of current limiting and clamping the potential of CC2 at a low level. In addition, the other ends of CC1 and CC2 are connected to the GPIO interface on the IoT gateway MCU.

[0092] In this implementation, there are four groups of GPIOs: In one group of GPIOs, assume that CC1 is connected to GPIO1 and CC2 is connected to GPIO2. After the above DHT11 external module is connected to any interface on the IoT gateway, first, the IoT gateway internally identifies the level conditions of each group of GPIO ports. In this example, assume that GPIO1 is at a low level and GPIO2 is at a high level, then the device identification code 10 is recognized. By querying the query table inside the gateway, it is found that the device identification code 10 corresponds to DHT11. Then the internal program of the gateway calls the relevant module of DHT11, loads the corresponding driver, recognizes the device, and conducts data communication with the DHT11 connected to this interface through the above 1-Wire.

[0093] An IoT gateway external device type recognition system of the present invention represents different device identification codes according to the high and low levels of each data line of the recognition module of different external devices. By querying the identification code table, it automatically loads different device drivers to recognize the type of device connected to the interface; the high and low levels clamped by the power supply line, ground wire of the external device and the pull-up or pull-down resistor in the recognition module represent each bit of data of the device identification code, without the need for an additional chip, reducing the cost and facilitating user use.

Claims

1. An identification system for external device types of an Internet of Things gateway, characterized in that It includes an IoT gateway MCU, an I2C device interface, a 1-Wire device interface, a UART device interface, and an SPI device interface encapsulated inside the IoT gateway housing; and an integrated identification module and an identification device encapsulated inside an external device housing; communication is carried out between the two housings through a connecting wire; The identification device includes: an external I2C device, an external 1-Wire device, an external UART device, and an external SPI device; each device is respectively connected to the corresponding device interface in the IoT gateway MCU through a connecting wire; Each external identification device represents the device type identification code of the identification module through the high / low level state of the data line, represented by a binary code; If the data line level state is high, the identification data bit fed back by the identification module represents 1, and conversely, the identification data bit represents 0.

2. The type recognition system for external devices of an Internet of Things gateway according to claim 1, characterized in that, The IoT gateway MCU is the core, including a computing unit, a storage unit, and various types of external interfaces, and is respectively connected to the I2C device interface, the 1-Wire device interface, the UART device interface, the SPI device interface, and the GPIO interface through different types of external interfaces; each different device interface is matched with a GPIO interface and is connected to the external identification device through a connecting wire.

3. The type recognition system for external devices of an Internet of Things gateway according to claim 1, characterized in that, The connecting wire is a TYPE-C data line, supporting up to 24 data lines; when it uses n data lines, the maximum number of identification devices that can be supported is 2 to the power of n.

4. The system for identifying the types of external devices of an Internet of Things gateway according to claim 3, wherein, The data line includes: a 5V power input line, a 3.3V power input, a GND ground wire, a GPIO wire, an SDA data line, an SCL data line, and a data line of the 1-Wire device; the use and type of each data line are adjusted according to actual needs.

5. The type recognition system for external devices of an Internet of Things gateway according to claim 1, wherein The working principle of the system is as follows: For a certain externally connected device M to be identified, first, connect it to the GPIO interface connected to the IoT gateway MCU through a connecting wire, set the GPIO interface as an input port, and read the initial level state transmitted by the device M to be identified through each data line; the initial level state of each device to be identified is set in advance; Then, perform an OR operation on the high and low level identification data bits of each read data line in a binary manner, with the high level as 1 and the low level as 0, and shift from low to high to combine the values of all data lines into the binary identification code of the device M to be identified; Finally, according to the identification code table stored in advance inside the IoT gateway MCU, find the corresponding type of the device M to be identified and perform mode configuration of the internal configuration module; or it is used to identify different versions of the PCB of the external device.

6. The identification system for external device types of an Internet of Things gateway according to claim 5, wherein When the initial level state is a high level state, it is judged that the data line connected to the GPIO interface is at a high level. If the identification module includes multiple data lines for identification and the current data line is the first data line, it is considered that the current identification has the lowest bit as 1; When the initial level state is a low level state, it is judged that the data line connected to the GPIO interface is at a low level; similarly, if the current data line is the first data line, it is considered that the current identification has the lowest bit as 0; Therefore, the high and low level recognition data bits of each read data line are used to perform an OR operation in a binary manner, with the high level as 1 and the low level as 0, and shifted from low to high. The values of all data lines are combined into a binary recognition code.

Citation Information

Patent Citations

  • Unmarked Internet of Things device identification method based on mobile AR

    CN110135238A

  • Extended module identification method and device

    CN106897244A

  • Gateway extension port device and gateway extension port method

    CN110958175A

  • Serial communication system, communication control unit, and electronic device

    US20160140077A1