Supports dual-ecosystem compatible smart home gateway and control method with USB-UART intelligent multiplexing

CN122578735APending Publication Date: 2026-08-14成都旭光科技股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-21
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0005]本发明的目的在于提供一种支持USB-UART智能复用的双生态兼容智能家居网关及控制方法,解决了现有技术中智能家居网关接口利用率低、USB与UART端口无法自动识别复用、协议转换依赖人工配置、缺乏对HomeAssistant与Tizen双生态原生适配以及抗干扰能力弱的问题

Benefits of technology

[0031]本发明的一种支持USB-UART智能复用的双生态兼容智能家居网关及控制方法,主控模块集成协议识别、双向转换转发与配置管理功能作为控制中枢,USB-UART智能复用模块通过受主控模块控制的端口自动切换电路,在设备插入时优先执行USB枚举,并根据枚举结果自动切换为USB模式或UART串口模式,实现端口自适应复用,HASS生态接口与Tizen设备接口分别原生支持MQTT、HTTP协议与DLNA、TCP/IP、SSDP协议,电气隔离模块在主控模块与外部接口之间实现电气隔断以抑制干扰、防止浪涌;控制方法依次执行上电初始化、设备接入与端口适配、协议自动识别、跨协议双向转换与转发以及隔离保护步骤。本发明有效解决了现有智能家居网关接口利用率低、USB与UART端口无法自动识别复用、协议转换依赖人工配置、缺乏对HomeAssistant与Tizen双生态原生适配以及抗干扰能力弱的问题,实现了端口即插即用、免配置智能转换、双生态无缝联动及在复杂家居环境中的高可靠运行。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122578735A_ABST
    Figure CN122578735A_ABST
Patent Text Reader

Abstract

This invention relates to the field of smart home IoT gateway technology, and discloses a dual-ecosystem compatible smart home gateway and control method supporting USB-UART intelligent multiplexing. The gateway includes a main control module, a power management module, a physical interface unit, a USB-UART intelligent multiplexing module, a HASS ecosystem interface, and a Tizen device interface. The main control module integrates protocol identification, bidirectional conversion and forwarding, and configuration management functions as the control center. The USB-UART intelligent multiplexing module is controlled by the main control module and features an automatic port switching circuit. When a device is inserted, USB enumeration is prioritized, and the gateway automatically switches to USB mode or UART serial port mode based on the enumeration result, achieving single-port adaptive multiplexing. The HASS ecosystem interface and Tizen device interface natively support MQTT, HTTP, DLNA, TCP / IP, and SSDP protocols, respectively. An electrical isolation module provides electrical isolation between the main control module and the external interfaces. This achieves plug-and-play ports, configuration-free intelligent conversion, seamless dual-ecosystem linkage, and highly reliable operation in complex home environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart home IoT gateway technology, and in particular to a dual-ecosystem compatible smart home gateway and control method that supports USB-UART intelligent multiplexing. Background Technology

[0002] With the rapid development of the smart home industry, smart devices based on different communication interfaces and protocols have emerged in the market. Devices based on the Home Assistant ecosystem mainly use protocols such as MQTT and HTTP, while Samsung Tizen system TVs, refrigerators, and other home appliances use protocols such as DLNA, TCP / IP, and SSDP. Traditional sensors and controllers mostly use UART (RS232 / RS485) serial interfaces, and peripherals such as USB cameras and storage devices follow the USB protocol. These devices differ significantly in interface type and communication protocol, making direct interconnection impossible. To achieve data exchange between devices with different interfaces and protocols, existing technologies typically use multiple independent conversion modules for interfacing, such as USB to UART modules, serial to Ethernet modules, and Wi-Fi to serial modules, combining multiple converters to build a communication link.

[0003] However, the aforementioned technical solution employing multiple independent converters has significant drawbacks in practical applications. First, the USB and UART interfaces are used independently and fixedly, unable to automatically identify and reuse devices based on their type, resulting in low gateway interface utilization and failing to meet the flexible networking and dynamic plug-and-play requirements of smart home scenarios. Second, existing solutions lack automatic protocol identification capabilities, cannot respond to device online or offline events, and multi-protocol conversions are mostly unidirectional and fixed, unable to dynamically adjust forwarding strategies based on device status. Third, existing general-purpose IoT gateways typically only support unidirectional conversion of fixed protocols, lacking native adaptation to Home Assistant ecosystem and Tizen system devices, making cross-ecosystem collaboration difficult. Furthermore, the separate functional modules for protocol identification, conversion forwarding, and configuration management in existing solutions result in complex system structures, cumbersome wiring, high costs, poor stability, and a general lack of electrical isolation design, leading to weak resistance to electromagnetic interference and surges in the complex electrical environments of smart homes, and insufficient reliability.

[0004] In summary, there is currently a lack of an integrated smart home gateway that can automatically identify and reuse USB and UART ports, support plug-and-play devices, have automatic protocol identification and bidirectional conversion capabilities, and be compatible with both the Home Assistant ecosystem and Tizen devices. Existing technologies suffer from problems such as low port utilization, cumbersome configuration, fixed protocol conversion, poor adaptability, weak anti-interference capabilities, and a lack of native dual-ecosystem compatibility, which urgently need to be addressed. Summary of the Invention

[0005] The purpose of this invention is to provide a dual-ecosystem compatible smart home gateway and control method that supports USB-UART intelligent reuse, solving the problems of low interface utilization, inability to automatically identify and reuse USB and UART ports, manual configuration for protocol conversion, lack of native adaptation to Home Assistant and Tizen dual ecosystems, and weak anti-interference ability in the prior art.

[0006] To achieve the above objectives, the present invention provides a dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing, including a main control module, a physical interface unit, and a power management module, and further including an electrical isolation module, a USB-UART intelligent multiplexing module, a HASS ecosystem interface, and a Tizen device interface. The main control module is connected to the physical interface unit, the USB-UART intelligent multiplexing module, the HASS ecosystem interface, and the Tizen device interface through the electrical isolation module. The power management module supplies power to the main control module through the electrical isolation module, and is also electrically connected to the physical interface unit and the USB-UART intelligent multiplexing module.

[0007] The power management module is used to provide operating voltage to the connected modules;

[0008] The main control module integrates protocol identification, bidirectional conversion and forwarding, and configuration management functions, and serves as the control center of the gateway.

[0009] The electrical isolation module is used to achieve electrical isolation between the main control module and the external interface;

[0010] The USB-UART intelligent multiplexing module is used to automatically perform USB enumeration on the inserted physical port and switch to USB mode or UART serial port mode according to the enumeration result, so as to realize port adaptive multiplexing.

[0011] The HASS ecosystem interface is used to connect devices based on the Home Assistant ecosystem;

[0012] The Tizen device interface is used to connect to devices based on the Tizen system.

[0013] The USB-UART intelligent multiplexing module includes a USB HUB chip, a USB to UART conversion chip, and an automatic port switching circuit. The automatic port switching circuit is controlled by the main control module and is used to perform USB enumeration detection first after an external device is inserted. If the enumeration is successful, the port is controlled to work in USB mode; if the enumeration fails, it is automatically switched to UART serial port mode.

[0014] The main control module also integrates functions such as overall machine control, automatic protocol identification, bidirectional conversion and data forwarding of multiple protocols, dual-ecosystem data adaptation and linkage, control of the switching logic of the USB-UART intelligent multiplexing module, and ensuring system stability and data security.

[0015] The electrical isolation module uses a digital isolation chip or an optocoupler isolation chip to cut off ground loops, suppress electromagnetic interference and pulse interference, and prevent surge voltage and electrostatic backflow.

[0016] The physical interface unit includes a Wi-Fi module, a DC power supply interface, a USB interface, a UART hardware interface, and an Ethernet interface.

[0017] The Wi-Fi module is used to provide a wireless network connection to the gateway when the main control module does not have Wi-Fi functionality;

[0018] The USB interface communicates with the Ethernet interface through the USB HUB control chip, or establishes communication with the main control module and the USB-UART intelligent multiplexing module, and provides voltage input to the power management module;

[0019] The DC power supply interface is used to provide backup power for the connection of external devices, or to provide voltage input for the power management module;

[0020] The UART hardware interface provides a TTL interface, an RS232 interface, or an RS485 interface.

[0021] The power management module uses a combination of a step-down chip and a linear regulator to convert the voltage input from the DC power supply interface or the USB interface into the operating voltage required by each module.

[0022] The power management module integrates overcurrent protection, overvoltage protection, and reverse connection protection circuits. The overcurrent protection uses a fuse, the overvoltage protection uses a TVS diode, and the reverse connection protection uses a reverse connection protection diode.

[0023] The main control module has a built-in protocol feature library for automatically identifying the protocol type of the data stream. The protocol types include MQTT, HTTP, DLNA, UART, TCP / IP, and SSDP. The main control module is also used to perform bidirectional conversion between UART and MQTT protocols, bidirectional conversion between USB data streams and DLNA protocols, and bidirectional conversion and forwarding between Ethernet port data and serial port data according to preset forwarding rules.

[0024] The working logic of the automatic port switching circuit of the USB-UART intelligent multiplexing module is as follows: when an external device is inserted, the main control module controls the USB enumeration detection to be performed first; if the enumeration is successful, it is determined to be a USB device and the port works in USB communication mode; if the enumeration fails, it is determined to be a serial port device and the port automatically switches to UART serial port communication mode.

[0025] The control method for a dual-ecosystem compatible smart home gateway that supports USB-UART intelligent multiplexing includes the following steps:

[0026] The power management module supplies power to the connected modules, and the main control module completes initialization and loads preset forwarding rules and protocol feature libraries.

[0027] When an external device is connected, the main control module controls the USB-UART intelligent multiplexing module to perform USB enumeration detection first, and automatically switches to USB mode or UART serial port mode according to the enumeration result.

[0028] The main control module captures data streams from various interfaces and automatically identifies the protocol type of the data stream using the built-in protocol feature library;

[0029] The main control module completes bidirectional data conversion and forwarding across protocols and interfaces based on the identified protocol type and preset forwarding rules;

[0030] The electrical isolation module continuously maintains electrical isolation between the main control module and the external interface during data transmission, suppressing interference and preventing voltage backflow.

[0031] This invention discloses a dual-ecosystem compatible smart home gateway and control method supporting USB-UART intelligent multiplexing. The main control module integrates protocol identification, bidirectional conversion and forwarding, and configuration management functions as the control center. The USB-UART intelligent multiplexing module, through a port automatic switching circuit controlled by the main control module, prioritizes USB enumeration when a device is inserted and automatically switches to USB mode or UART serial port mode according to the enumeration result, realizing port adaptive multiplexing. The HASS ecosystem interface and Tizen device interface natively support MQTT, HTTP, DLNA, TCP / IP, and SSDP protocols, respectively. The electrical isolation module provides electrical isolation between the main control module and external interfaces to suppress interference and prevent surges. The control method sequentially executes the following steps: power-on initialization, device access and port adaptation, automatic protocol identification, cross-protocol bidirectional conversion and forwarding, and isolation protection. This invention effectively solves the problems of low interface utilization, inability to automatically identify and reuse USB and UART ports, manual configuration required for protocol conversion, lack of native adaptation to Home Assistant and Tizen dual ecosystems, and weak anti-interference capability of existing smart home gateways. It achieves plug-and-play ports, configuration-free intelligent conversion, seamless linkage between dual ecosystems, and highly reliable operation in complex home environments. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0033] Figure 1 This is a hardware structure block diagram of the dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing according to the present invention.

[0034] Figure 2 This is a software module architecture diagram of the dual-ecosystem compatible smart home gateway that supports USB-UART intelligent multiplexing according to the present invention.

[0035] Figure 3 This is a flowchart of the multi-protocol adaptive conversion and data forwarding method of the present invention.

[0036] Figure 4 This is a flowchart illustrating the automatic port switching process of the USB-UART intelligent multiplexing module of the present invention.

[0037] Figure 5 This is a flowchart of the steps of the dual-ecosystem compatible smart home gateway control method supporting USB-UART intelligent multiplexing according to the present invention.

[0038] In the diagram: 100 - Main control module, 110 - Electrical isolation module, 120 - Physical interface unit, 121 - Various interfaces, 122 - Wi-Fi module, 130 - USB-UART intelligent multiplexing module, 140 - Power management module, 150 - HASS ecosystem interface, 160 - Tizen device interface. Detailed Implementation

[0039] The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, but should not be construed as limiting the present invention.

[0040] Please refer to Figures 1 to 4 This invention provides a dual-ecosystem compatible smart home gateway that supports USB-UART intelligent multiplexing, including a main control module 100, a physical interface unit 120, a power management module 140, an electrical isolation module 110, a USB-UART intelligent multiplexing module 130, a HASS ecosystem interface 150, and a Tizen device interface 160. The physical interface unit 120 includes a Wi-Fi module 122 and various interfaces 121 (DC power supply interface, USB interface, UART hardware interface, and Ethernet interface).

[0041] The main control module 100 is connected to the physical interface unit 120, the USB-UART smart multiplexing module 130, the HASS ecosystem interface 150, and the Tizen device interface 160 through the electrical isolation module 110. The power management module 140 supplies power to the main control module 100 through the electrical isolation module 110, and is also electrically connected to the physical interface unit 120 and the USB-UART smart multiplexing module 130.

[0042] The power management module 140 is used to provide operating voltage to the connected module;

[0043] The main control module 100 integrates protocol identification, bidirectional conversion and forwarding, and configuration management functions, and is used as the control center of the gateway.

[0044] The electrical isolation module 110 is used to achieve electrical isolation between the main control module 100 and the external interface;

[0045] The USB-UART intelligent multiplexing module 130 is used to automatically perform USB enumeration on the inserted physical port and switch to USB mode or UART serial port mode according to the enumeration result, so as to realize single-port adaptive multiplexing.

[0046] The HASS ecosystem interface 150 is used to connect devices based on the Home Assistant ecosystem;

[0047] The Tizen device interface 160 is used to connect to devices based on the Tizen system.

[0048] Specifically, the power management module 140 supports three input voltages: 24V, 12V, and 5V, and can output multiple voltage levels such as 5V, 3.3V, and 1.8V. It also integrates a fuse, TVS diode, and reverse connection protection diode, providing triple protection against overcurrent, overvoltage, and reverse connection. The main control module 100 uses an ARM architecture processor (such as a Raspberry Pi CM4) or a high-performance STM32 microcontroller (such as the STM32H7 series), integrating protocol identification, bidirectional conversion and forwarding, and configuration management into one unit, eliminating the cumbersome structure of traditional discrete modules. The electrical isolation module 110 uses a digital isolation chip (such as the ADUM1400) or an optocoupler isolation chip (such as the TLP521) to completely isolate the main control circuit from external serial ports, USB, network ports, and power supply interfaces, effectively suppressing ground loop interference and surge impacts. The USB-UART intelligent multiplexing module 130 uses an automatic enumeration mechanism to enable the physical port to adaptively operate in USB mode or UART serial port mode, truly achieving "intelligent multiplexing." The HASS ecosystem interface 150 natively supports MQTT and HTTP protocols, while the Tizen device interface 160 natively supports DLNA, TCP / IP, and SSDP protocols, providing seamless access capabilities for the two major smart home ecosystems.

[0049] Secondly, the USB-UART intelligent multiplexing module 130 includes a USB HUB chip, a USB to UART conversion chip, and a port automatic switching circuit; the port automatic switching circuit is controlled by the main control module 100 and is used to perform USB enumeration detection first after an external device is inserted. If the enumeration is successful, the port is controlled to work in USB mode; if the enumeration fails, it is automatically switched to UART serial port mode.

[0050] Specifically, the hardware configuration of the USB-UART intelligent multiplexing module 130 is as follows: a USB HUB chip (such as GL850G or FE1.1s) is used to expand multiple downstream ports, a USB to UART chip (such as CP2102 or CH340E) is responsible for protocol conversion, and the automatic port switching circuit uses an analog switch (such as TS5A23157). The enable terminal of this analog switch is directly controlled by the GPIO pin of the main control module 100.

[0051] Its working logic is as follows: When an external device is plugged into the physical port, the main control module 100 first switches the analog switch to the USB path and initiates an enumeration process according to the USB protocol. If the device descriptor is successfully obtained within a set time, it is determined to be a USB device, the analog switch is locked on the USB side, and subsequent data is transmitted according to the USB protocol, which can be used to connect standard USB peripherals such as cameras and USB flash drives. If the enumeration times out or the bus does not respond, it is determined to be a serial port device, the analog switch immediately switches to the UART side, and the USB to UART chip is enabled, so that the port works in UART serial port mode, which is used to connect serial port devices such as temperature and humidity sensors and controllers. The whole process does not require any jumpers, DIP switches, or software configuration by the user, realizing plug-and-play functionality of the underlying hardware, while combining the functions that originally required two separate ports into one, greatly simplifying the number of interfaces and the size of the openings of the whole machine.

[0052] Subsequently, the main control module 100 also integrates functions such as overall machine control, automatic protocol identification, bidirectional conversion and data forwarding of multiple protocols, dual-ecosystem data adaptation and linkage, control of the switching logic of the USB-UART intelligent multiplexing module 130, and ensuring system stability and data security.

[0053] Specifically, the main control module 100, acting as the "brain" of the gateway, integrates not only the three basic functions of protocol recognition, bidirectional conversion and forwarding, and configuration management, but also six comprehensive system-level control capabilities:

[0054] Overall control of the whole machine: The main control module 100 uniformly schedules the electrical isolation module 110, the USB-UART intelligent multiplexing module 130, the dual ecological interface and all physical interfaces to ensure that each module works together in accordance with the preset timing and logic.

[0055] Automatic Protocol Recognition: The main control module 100 has a built-in multi-protocol feature library covering common smart home protocols such as MQTT, HTTP, DLNA, UART, TCP / IP, and SSDP. When a data stream arrives, the main control module 100 automatically determines the protocol type using a feature code matching algorithm, without requiring manual intervention.

[0056] Multi-protocol bidirectional conversion and data forwarding: Based on user-preset forwarding rules (e.g., "convert sensor data received from the UART port into MQTT messages and publish them to the HASS Broker"), the main control module 100 performs operations such as packet decomposition, protocol encapsulation, and address mapping to realize UART... MQTT, USB video stream DLNA, Ethernet Serial port and other bidirectional converters.

[0057] Dual-ecosystem data adaptation and linkage: The main control module 100 simultaneously maintains the session state and data model of both the HASS ecosystem and Tizen devices, enabling control commands from the HASS side to be understood and executed by Tizen devices, and vice versa, breaking down the data silos between the two ecosystems.

[0058] USB-UART switching logic control: The main control module 100 directly issues enumeration commands and switching instructions to precisely control the mode switching timing of the USB-UART intelligent multiplexing module 130, ensuring the accuracy of device identification.

[0059] System stability and data security assurance: The main control module 100, together with the electrical isolation module 110, monitors the abnormal characteristics of each data stream in real time (such as illegal frames and high-frequency interference) and takes active filtering or isolation measures. At the same time, external serial Flash and EEPROM are used to store protocol library, rules and configuration parameters to ensure that parameters are not lost when power is off and to ensure long-term operational reliability.

[0060] Then, the electrical isolation module 110 uses a digital isolation chip or an optocoupler isolation chip to cut off the ground loop, suppress electromagnetic interference and pulse interference, and prevent surge voltage and electrostatic backflow.

[0061] Specifically, the electrical isolation module 110 is located between the main control module 100 and each external interface and module. By electrically isolating the main control core circuit from external serial ports, USB ports, network ports, and power supply interfaces, it suppresses pulse interference and electromagnetic interference generated by relays, switching power supplies, and frequency converters in the smart home field, avoids data packet loss, protocol misidentification, and communication crashes, and can prevent external wiring misconnection, electrostatic discharge, and surge voltage backflow, thus preventing damage to the main control chip and core circuit.

[0062] Meanwhile, the Wi-Fi module 122 is used to provide a wireless network connection for the gateway when the main control module 100 does not have Wi-Fi functionality; specifically, this module provides a 2.4GHz / 5GHz dual-band Wi-Fi connection as an optional component, supporting the 802.11b / g / n / ac standards. If the main control module 100 itself already has Wi-Fi (such as a Raspberry Pi CM4), this module can be omitted or used as a backup.

[0063] The USB interface communicates with the Ethernet interface through the USB HUB control chip, or establishes communication with the main control module 100 and the USB-UART intelligent multiplexing module 130, and provides voltage input to the power management module 140. Specifically, the USB HUB control chip expands multiple downlink ports, one of which is connected to the Ethernet controller to realize the USB to Ethernet port function; another is directly connected to the USB-UART intelligent multiplexing module 130 for multiplexing port use; at the same time, this interface can also provide a +5V backup input to the power management module 140 (e.g., emergency power supply via MicroUSB).

[0064] The DC power supply interface is used to provide backup power for external devices or to provide voltage input to the power management module 140; specifically, it uses a DC-005 type socket to accept external +12V or +24V DC power input. This interface not only powers the main control and core modules, but also provides backup power for externally connected sensors, cameras, and other devices, achieving "one power source for multiple uses".

[0065] The UART hardware interface provides a TTL interface, an RS232 interface, or an RS485 interface. Specifically, a level conversion chip (MAX3232 for RS232, SP3485 for RS485) converts the TTL level of the main control module 100 into an industrial standard RS232 or RS485 differential signal, which can be directly connected to various serial port sensors, PLCs, smart meters, and other devices.

[0066] Ethernet interface: Integrated independent PHY chip (such as Gigabit RTL8211 or 100M LAN8720) and RJ45 socket with transformer, supporting full TCP / IP protocol stack communication for accessing home or industrial Ethernet networks.

[0067] In addition, the power management module 140 uses a combination of a step-down chip and a linear regulator to convert the voltage input from the DC power supply interface or the USB interface into the operating voltage required by each module.

[0068] Specifically, the voltage conversion core of the power management module 140 adopts a two-stage architecture of "buck converter + linear regulator". The first stage uses a switching buck converter (such as XL4015E1 or MP2303) to efficiently reduce the input +24V or +12V to the +5V intermediate bus. The second stage uses a low dropout linear regulator (such as LM1117 or AMS1117 series) to further regulate the +5V to +3.3V or +1.8V, supplying the main control module 100, isolation chip, USB HUB and other ripple-sensitive digital circuits.

[0069] The advantages of this combination are: the switching buck converter handles the main voltage difference, resulting in low heat generation and high efficiency; the linear regulator provides a clean output voltage, ensuring digital signal quality. For direct +5V input (e.g., via USB interface power supply), the buck chip is in pass-through or bypass mode, with secondary voltage regulation performed only by the linear regulator. The entire power supply chain can adapt to a wide voltage range from 5V (USB emergency power supply) to 24V (industrial field), meeting the power supply needs of different scenarios.

[0070] Meanwhile, the power management module 140 integrates overcurrent protection, overvoltage protection and reverse connection protection circuits. The overcurrent protection uses a fuse, the overvoltage protection uses a TVS diode, and the reverse connection protection uses a reverse connection protection diode.

[0071] Specifically, overcurrent protection: A resettable fuse or a one-time fuse is connected in series at the input terminal of each power supply branch. When the load is short-circuited or the current increases abnormally, the fuse blows quickly (or exhibits a high-resistance state), cutting off the faulty branch. It can automatically reset after the fault is cleared (resettable type) or needs to be replaced (one-time type).

[0072] Overvoltage protection: A transient voltage suppressor diode (TVS) is connected in parallel at the input. When the input voltage exceeds its clamping voltage (e.g., a 28V TVS is selected for a 24V input system), the TVS instantly enters a low-impedance avalanche conduction state, dissipating the overvoltage energy to ground and clamping the voltage at a safe level, protecting the subsequent circuitry.

[0073] Reverse connection protection: A high-current Schottky diode or PMOS transistor is connected in series at the power input terminal to prevent reverse connection. When the user accidentally reverses the positive and negative terminals of the power supply, the diode will cut off in reverse, preventing the circuit from forming a loop and thus avoiding backflow that could burn out components.

[0074] The aforementioned protection circuit ensures that the gateway can operate stably and safely in complex electrical environments, reducing the failure rate caused by power supply problems.

[0075] Furthermore, the main control module 100 has a built-in protocol feature library for automatically identifying the protocol type of the data stream. The protocol types include MQTT, HTTP, DLNA, UART, TCP / IP, and SSDP. The main control module 100 is also used to complete bidirectional conversion between UART and MQTT protocols, bidirectional conversion between USB data streams and DLNA protocols, and bidirectional conversion and forwarding between Ethernet port data and serial port data according to preset forwarding rules.

[0076] Specifically, the protocol feature library built into the main control module 100 is a feature code mapping table stored in serial Flash. Each record corresponds to a protocol type and its typical frame header, frame trailer, keywords, or data structure features. For example, the variable header of the MQTT protocol often contains control message type fields such as "CONNECT" or "PUBLISH"; the HTTP protocol starts with a Host header using methods such as "GET / POST"; the DLNA protocol is based on UPnP and contains specific SOAP action names; the UART protocol usually does not have a fixed frame structure, but the baud rate and parity can be identified by configuration.

[0077] When the data stream arrives, the main control module 100 first performs data frame boundary detection, then extracts the feature window, quickly compares it with the feature library, obtains the protocol type confidence score, and selects the result with the highest confidence score as the recognition output.

[0078] For conversion and forwarding, the main control module 100 maintains a forwarding rule table. Each rule in the table defines the mapping relationship between "source interface / protocol / address" and "target interface / protocol / address," as well as a conversion function pointer. For example: Rule 1—converts Modbus RTU data received on UART1 port into MQTT and publishes it to the " / sensor / modbus" topic; Rule 2—converts the MJPEG stream output from the USB camera into DLNA media format and pushes it to the specified Tizen device IP. The conversion process includes unpacking (removing the original protocol encapsulation), extracting the data payload, repackaging according to the target protocol format, adding necessary protocol headers / tails, and finally sending it through the target interface. All conversions support bidirectional transmission, meaning that MQTT messages can be restored to UART commands, or DLNA control point requests can be converted into USB memory read operations.

[0079] Finally, the working logic of the automatic port switching circuit of the USB-UART intelligent multiplexing module 130 is as follows: when an external device is inserted, the main control module 100 controls the USB enumeration detection to be performed first; if the enumeration is successful, it is determined to be a USB device, and the port works in USB communication mode; if the enumeration fails, it is determined to be a serial port device, and the port automatically switches to UART serial communication mode, thus eliminating the need for manual dialing, configuration or jumpering.

[0080] The USB-UART intelligent multiplexing module 130 enables dual-function adaptive access to ports, eliminating the need for manual patching or configuration and significantly improving interface utilization. The main control module 100 integrates automatic protocol identification and bidirectional conversion and forwarding functions, achieving configuration-free intelligent conversion and lowering the barrier to entry. The electrical isolation module 110 effectively cuts off ground loops, suppresses electromagnetic interference, and prevents voltage surges, enhancing the gateway's anti-interference capabilities and operational reliability in complex home environments. The native adaptation of the HASS ecosystem interface 150 and the Tizen device interface 160 breaks down ecosystem barriers, enabling cross-brand and cross-system device interconnection and data synchronization. Furthermore, the integration of protocol identification, conversion, and configuration functions into a single main control module 100 eliminates the need for multiple discrete converters, simplifying the hardware structure and reducing system complexity and cost.

[0081] Please refer to Figure 5 This invention provides a dual-ecosystem compatible smart home gateway control method supporting USB-UART intelligent multiplexing, comprising the following steps:

[0082] S201: The power management module 140 supplies power to the connected module, and the main control module 100 completes initialization and loads the preset forwarding rules and protocol feature library;

[0083] S202: When an external device is connected, the main control module 100 controls the USB-UART intelligent multiplexing module 130 to perform USB enumeration detection first, and automatically switches to USB mode or UART serial port mode according to the enumeration result.

[0084] S203: The main control module 100 captures data streams from various interfaces and automatically identifies the protocol type of the data stream using the built-in protocol feature library;

[0085] S204: The main control module 100 completes bidirectional data conversion and forwarding across protocols and interfaces based on the identified protocol type and preset forwarding rules;

[0086] S205: The electrical isolation module 110 continuously performs electrical isolation between the main control module 100 and the external interface during data stream transmission to suppress interference and prevent voltage backflow.

[0087] Specifically, the power management module 140 first supplies power to each unit and completes the main control initialization and rule loading. Then, when an external device is connected, the main control module 100 controls the USB-UART intelligent multiplexing module 130 to automatically perform USB enumeration and seamlessly switch to USB mode or UART serial port mode based on the result. Next, the main control module 100 captures the data stream and accurately identifies the protocol type using the built-in protocol feature library, and then completes cross-protocol (such as UART) operations according to the preset forwarding rules. MQTT, USB The invention enables bidirectional conversion and forwarding of data (such as DLNA), while the electrical isolation module 110 continuously isolates the electrical connection between the main control unit and the external interface to suppress interference and prevent surge backflow. Through the closed-loop coordination of the above steps, the invention achieves plug-and-play devices, intelligent protocol conversion without configuration, seamless linkage between two ecosystems, and high anti-interference and long-term stable operation in complex home environments.

[0088] This invention provides two specific application scenarios for smart home gateway implementation solutions.

[0089] Example 1: High-performance commercial gateway based on ARM processor (adapted for engineering / high-end home decoration scenarios)

[0090] This embodiment is a high-performance commercial-grade smart home gateway, adapted to multi-device and complex networking scenarios. The main controller integrates three core functions: protocol recognition, bidirectional conversion and forwarding, and configuration management. It features complete electrical isolation protection, USB-UART intelligent multiplexing, and dual-ecosystem compatibility. Power management supports wide voltage input and multi-voltage output. Physical interfaces include +24V / +12V DC input sockets, meeting engineering-grade power supply requirements. Specific modules are as follows:

[0091] Main Control Module 100: Utilizes a Raspberry Pi CM4104032 (ARM Cortex-A72 architecture, 1.5GHz main frequency), runs a Linux system, and integrates core functions. Protocol Recognition: Built-in MQTT, HTTP, DLNA, UART, TCP / IP, and SSDP protocol feature libraries; recognition algorithms are written in Python to achieve real-time data stream recognition. Bidirectional Conversion and Forwarding: Data interaction is achieved based on message queues, supporting bidirectional conversion between UART and MQTT, USB video stream and DLNA, and Ethernet and serial data. It supports preset forwarding rules and configured interface parameters. Built-in WiFi Functionality: Optional wireless LAN, supporting 2.4GHz and 5.0GHz dual-band, compliant with IEEE 802.11b / g / n / ac standards, Bluetooth 5.0, Bluetooth Low Energy (BLE), with optional onboard or external antennas. External Components: W25Q64 serial Flash (stores protocol feature libraries and forwarding rules), AT24C02 EEPROM (stores configuration parameters), ensuring parameter retention even after power loss.

[0092] Electrical isolation module 110: It adopts ADUM1400 digital isolation chip (4-channel isolation) and 74HC245 bus buffer to realize electrical isolation between the main control module 100 and all external interfaces and USB-UART intelligent multiplexing module 130; suppress electromagnetic interference and pulse interference, prevent surge voltage backflow, and ensure stable data transmission.

[0093] USB-UART Intelligent Multiplexing Module 130: integrates GL850G USB HUB expansion chip (expands 4 USB ports), CP2102 USB to UART chip, and TS5A23157 analog switch (automatic port switching circuit); the analog switch is controlled by the main control GPIO to realize "priority USB enumeration, automatic UART switching upon failure", and supports adaptive access of USB peripherals (cameras, memory) and UART serial port devices (sensors, controllers).

[0094] Power Management Module 140: Employs an XL4015E1 step-down chip and an LM1117 series linear regulator, supporting +24V, +12V, and +5V inputs, and +5V, +3.3V, and +1.8V outputs. Inputs: Supports +24V (commonly used in industrial applications), +12V (commonly used in residential applications), and +5V inputs. The physical interface is equipped with a DC-005 DC socket (supporting +24V / +12V inputs, adaptable to different power supply scenarios). Outputs: +5V, +3.3V, +1.8V. Protection functions: Integrated TVS diode (overvoltage protection), fuse (overcurrent protection), and reverse connection protection diode, adaptable to complex engineering power supply environments.

[0095] Physical interface unit 120: Power supply interface: DC-005 type DC socket (supports +24V / +12V input), spare MicroUSB interface (+5V input, emergency power supply); Network interface: RJ45 Ethernet interface (RTL8211 PHY chip, 1000M speed); Serial port interface: UART hardware interface (external MAX3232 RS232 level conversion chip, SP3485 RS485 level conversion chip), supports RS232 / RS485 device access; Multiplexing interface: 4 USB ports (one of which can be switched to UART mode through USB-UART intelligent multiplexing module 130).

[0096] HASS Ecosystem Interface 150: Runs the Mosquitto MQTT Broker via Wi-Fi / Ethernet to communicate with the HASS platform via MQTT / HTTP protocols, connects to HASS ecosystem sensors and controllers, and controls data conversion and forwarding by the main control module 100.

[0097] Tizen Device Interface 160: Deploys a DLNA media server via Wi-Fi, supporting DLNA, TCP / IP, and SSDP protocols, enabling access and media streaming for Tizen system devices (Samsung TVs, refrigerators), with media stream format conversion handled by the main control module 100.

[0098] The working process of this embodiment is as follows: Upon powering on the gateway (optionally via a DC connector with +24V, +12V voltage, or USB with +5V voltage), the power management module 140 converts the input voltage to +5V, +3.3V, and +1.8V to power each module. The main control module 100 completes initialization, loads the protocol feature library and forwarding rules, and starts listening on all interfaces. The USB-UART intelligent multiplexing module 130 enters standby mode. After an external device is inserted, the main control prioritizes USB enumeration; if enumeration succeeds, it enters USB mode; otherwise, it switches to UART mode. The main control module 100 captures data streams from each interface, automatically identifies the protocol type, and completes cross-protocol conversion and forwarding according to preset rules, enabling interconnection and interoperability among HASS ecosystem, Tizen devices, and various peripherals. The electrical isolation module 110 plays a crucial role throughout the process, ensuring the system's anti-interference capability. The power management module 140 provides stable power, ensuring the gateway's long-term reliable operation.

[0099] Example 2: Low-cost home gateway based on STM32 microcontroller (suitable for typical home decoration scenarios)

[0100] This embodiment is a low-cost, home-grade smart home gateway, suitable for the networking needs of ordinary households. The main control uses an STM32 microcontroller, integrating three core functions. It features a streamlined structure, controllable cost, and power management supporting wide voltage input and multiple voltage outputs. Physical interfaces include +12V / +24V DC input sockets, adapting to common household power supply scenarios while retaining core functionality and stability. The specific selection and design of this example are as follows:

[0101] Main Control Module 100: Employs an STM32H743VIT6 microcontroller (Cortex-M7 core, 480MHz clock speed), running the FreeRTOS real-time operating system, and integrating core functions. Protocol Identification: Based on a lightweight protocol feature table stored in Flash memory, it enables rapid identification of MQTT, HTTP, DLNA, UART, TCP / IP, and SSDP protocols with low resource consumption. Bidirectional Conversion and Forwarding: Data conversion and forwarding are completed through a message queue, supporting bidirectional conversion between UART and MQTT, and between USB data streams and DLNA, adapting to the data interaction needs of home devices. It supports user-preset forwarding rules, baud rate configuration, IP address, and other parameters. External Components: W25Q128 serial Flash (stores protocol feature library and forwarding rules), AT24C02 EEPROM (stores configuration parameters), meeting the storage needs of home scenarios.

[0102] Electrical isolation module 110: It adopts TLP521 optocoupler isolation chip (4-way optocoupler) to realize electrical isolation between the main control module 100 and external interface and USB-UART intelligent multiplexing module 130. It is low cost and can effectively suppress electromagnetic interference in the home environment (such as interference generated by refrigerators and air conditioners).

[0103] USB-UART Intelligent Multiplexing Module 130: Integrates FE1.1s USB HUB chip (expanding 2 USB ports), CH340E USB to UART chip, and TS5A23157 analog switch. Controlled by the main controller GPIO, it realizes automatic switching between USB mode and UART mode, and is compatible with commonly used USB peripherals (USB flash drives, cameras) and UART serial port sensors (temperature and humidity sensors).

[0104] Power Management Module 140: Employs an MP2303 step-down chip and an AMS1117 series linear regulator, supporting +24V, +12V, and +5V inputs, and +5V, +3.3V, and +1.8V outputs. Inputs: Supports +24V, +12V, and +5V; Outputs: +5V, +3.3V, and +1.8V; Protection features: Integrated overcurrent protection resistor and reverse connection protection circuit; compact size, suitable for home installation.

[0105] Physical interface unit 120: Power supply interface: DC-005 type DC socket (supports +12V / +24V input, compatible with common household power adapters), MicroUSB interface (+5V input, spare); Network interface: RJ45 Ethernet interface (LAN8720 PHY chip, 100M speed); Serial port interface: UART hardware interface (external MAX3232 RS232, SP3485 RS485 level conversion chip), supporting the connection of common household serial port devices; Multiplexing interface: 2 USB ports (one of which can be switched to UART mode through USB-UART intelligent multiplexing module 130).

[0106] HASS Ecosystem Interface 150: Through the ESP8266 Wi-Fi module 122, it runs the AT command set to realize MQTT and HTTP protocol communication, and connects to HASS ecosystem devices (such as smart switches and sensors). The main control module 100 completes protocol identification and data forwarding.

[0107] Tizen device interface 160: Through the ESP8266 Wi-Fi module 122, it realizes DLNA, TCP / IP and SSDP protocol communication, connects to the Tizen system TV, and the main control module 100 completes the conversion between USB video stream and DLNA format to realize media stream push.

[0108] The working process of this embodiment is as follows: The gateway is powered on (connected to a commonly used household voltage of +12V or +24V via a DC connector), and the power management module 140 completes voltage conversion to provide stable power to each module; after the main control module 100 is initialized, it loads the protocol feature table and preset forwarding rules, and starts listening to all interfaces; the USB-UART intelligent multiplexing module 130 detects the access of external devices and completes USB enumeration and mode switching under the control of the main control module; the main control module 100 captures the data stream of each interface, automatically identifies the protocol type, and completes data conversion and forwarding according to preset rules to realize the linkage between HASS ecosystem devices, Tizen devices and home USB / serial devices; the electrical isolation module 110 suppresses electromagnetic interference in the home environment to ensure stable data transmission, and the power management module 140 provides reliable power supply to meet the long-term power supply requirements of the home.

[0109] The above-disclosed embodiments are merely one or more preferred embodiments of this application and should not be construed as limiting the scope of this application. Those skilled in the art can understand that all or part of the processes for implementing the above embodiments and equivalent changes made in accordance with the claims of this application still fall within the scope of this application.

Claims

1. A dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing, comprising a main control module, a physical interface unit, and a power management module, characterized in that... It also includes an electrical isolation module, a USB-UART intelligent multiplexing module, a HASS ecosystem interface, and a Tizen device interface. The main control module is connected to the physical interface unit, the USB-UART intelligent multiplexing module, the HASS ecosystem interface, and the Tizen device interface through the electrical isolation module. The power management module supplies power to the main control module through the electrical isolation module, and is also electrically connected to the physical interface unit and the USB-UART intelligent multiplexing module. The power management module is used to provide operating voltage to the connected modules; The main control module integrates protocol identification, bidirectional conversion and forwarding, and configuration management functions, and serves as the control center of the gateway. The electrical isolation module is used to achieve electrical isolation between the main control module and the external interface; The USB-UART intelligent multiplexing module is used to automatically perform USB enumeration on the inserted physical port and switch to USB mode or UART serial port mode according to the enumeration result, so as to realize port adaptive multiplexing. The HASS ecosystem interface is used to connect devices based on the Home Assistant ecosystem; The Tizen device interface is used to connect to devices based on the Tizen system.

2. The dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing as described in claim 1, characterized in that, The USB-UART intelligent multiplexing module includes a USB HUB chip, a USB to UART conversion chip, and an automatic port switching circuit. The automatic port switching circuit is controlled by the main control module and is used to perform USB enumeration detection first after an external device is inserted. If the enumeration is successful, the port is controlled to work in USB mode; if the enumeration fails, it is automatically switched to UART serial port mode.

3. The dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing as described in claim 1, characterized in that, The main control module also integrates functions such as overall machine control, automatic protocol identification, bidirectional conversion and data forwarding of multiple protocols, dual-ecosystem data adaptation and linkage, control of the switching logic of the USB-UART intelligent multiplexing module, and ensuring system stability and data security.

4. The dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing as described in claim 1, characterized in that, The electrical isolation module uses a digital isolation chip or an optocoupler isolation chip to cut off ground loops, suppress electromagnetic interference and pulse interference, and prevent surge voltage and electrostatic backflow.

5. The dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing as described in claim 1, characterized in that, The physical interface unit includes a Wi-Fi module, a DC power supply interface, a USB interface, a UART hardware interface, and an Ethernet interface; The Wi-Fi module is used to provide a wireless network connection to the gateway when the main control module does not have Wi-Fi functionality; The USB interface communicates with the Ethernet interface through the USB HUB control chip, or establishes communication with the main control module and the USB-UART intelligent multiplexing module, and provides voltage input to the power management module; The DC power supply interface is used to provide backup power for the connection of external devices, or to provide voltage input for the power management module; The UART hardware interface provides a TTL interface, an RS232 interface, or an RS485 interface.

6. The dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing as described in claim 5, characterized in that, The power management module uses a combination of a step-down chip and a linear regulator to convert the voltage input from the DC power supply interface or the USB interface into the operating voltage required by each module.

7. The dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing as described in claim 6, characterized in that, The power management module integrates overcurrent protection, overvoltage protection, and reverse connection protection circuits. The overcurrent protection uses a fuse, the overvoltage protection uses a TVS diode, and the reverse connection protection uses a reverse connection protection diode.

8. The dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing as described in claim 1, characterized in that, The main control module has a built-in protocol feature library for automatically identifying the protocol type of the data stream. The protocol types include MQTT, HTTP, DLNA, UART, and TCP / IP. The main control module is also used to perform bidirectional conversion between UART and MQTT protocols, bidirectional conversion between USB data streams and DLNA protocols, and bidirectional conversion and forwarding between Ethernet port data and serial port data according to preset forwarding rules.

9. The dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing as described in claim 1, characterized in that, The working logic of the automatic port switching circuit of the USB-UART intelligent multiplexing module is as follows: when an external device is inserted, the main control module controls the USB enumeration detection to be performed first; if the enumeration is successful, it is determined to be a USB device and the port works in USB communication mode; if the enumeration fails, it is determined to be a serial port device and the port automatically switches to UART serial port communication mode.

10. A control method for a dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing, applicable to the dual-ecosystem compatible smart home gateway supporting USB-UART intelligent multiplexing as described in any one of claims 1-9, characterized in that, Includes the following steps: The power management module supplies power to the connected modules, and the main control module completes initialization and loads preset forwarding rules and protocol feature libraries. When an external device is connected, the main control module controls the USB-UART intelligent multiplexing module to perform USB enumeration detection first, and automatically switches to USB mode or UART serial port mode according to the enumeration result. The main control module captures data streams from various interfaces and automatically identifies the protocol type of the data stream using the built-in protocol feature library; The main control module completes bidirectional data conversion and forwarding across protocols and interfaces based on the identified protocol type and preset forwarding rules; The electrical isolation module continuously maintains electrical isolation between the main control module and the external interface during data transmission, suppressing interference and preventing voltage backflow.