A multi-functional network protocol converter
Patent Information
- Application Number
- CN202511763451.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2045-11-27
AI Technical Summary
[0005]本发明为了解决现有技术中存在的问题,创新提出了一种多功能网络协议转换器,有效解决由于现有技术造成网络协议转换成本以及复杂度高的问题,有效地降低了网络协议转换成本以及复杂度
1、本发明技术方案中交换机芯片包括多个网口,每个网口属于同一内网,且每个网口均可独立设置通信方式,支持多种不同协议以及数据转发配置,可实现多种转发模式,用于提供物理层数据交换功能;主控模块通过数据存储协议栈将网口以及通信模块接收的不同协议类型的数据进行识别、解析、存储、转换、封装,并将封装后的不同协议的数据通过网口以及通信模块进行数据转发,将交换机、协议转换器和数据处理功能集成在一个设备中,简化系统架构,有效解决由于现有技术造成网络协议转换成本以及复杂度高的问题,有效地降低了网络协议转换成本以及复杂度。
Smart Images

Figure CN121334269B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of protocol conversion, and in particular to a multifunctional network protocol converter. Background Technology
[0002] With the rapid development of IoT technology, various communication devices and protocols are emerging in an endless stream. Protocol conversion and data interoperability between different devices have become key challenges for IoT system integration.
[0003] Currently, technologies for converting between different protocols typically involve a combination of devices such as routers, switches, and industrial control computers. However, this approach suffers from one or more of the following problems: 1. The system architecture is complex, requiring multiple devices to work together, which increases the potential for failure; 2. High equipment costs, especially in large-scale deployment scenarios; 3. The protocol conversion lacks flexibility and is difficult to adapt to changing application requirements.
[0004] To address the aforementioned problems, this invention provides a multifunctional network protocol converter. Summary of the Invention
[0005] To address the problems existing in the prior art, this invention innovatively proposes a multifunctional network protocol converter, which effectively solves the problem of high cost and complexity in network protocol conversion caused by the prior art, and effectively reduces the cost and complexity of network protocol conversion.
[0006] The first aspect of this invention provides a multifunctional network protocol converter, comprising: a main control module, a switch chip, a communication module, and a storage module; the switch chip includes multiple network ports, each belonging to the same intranet, and each network port can be independently configured with a communication mode, supporting multiple different protocols and data forwarding configurations, and can realize multiple forwarding modes, used to provide physical layer data exchange functions; the storage module is used for data caching; the main control module is connected to the switch chip and the communication module respectively, and is used to identify, parse, store, convert, and encapsulate data of different protocol types received by the network ports and the communication module through a data storage protocol stack, and forward the encapsulated data of different protocols through the network ports and the communication module.
[0007] Optionally, the data storage protocol stack includes a device structure table, a data cache structure table, a historical record structure table, a protocol rule structure table, and a parameter storage structure table. The device structure table is associated with the data cache structure table and the historical record structure table through a header field. Data query and combination operations are performed between the protocol rule structure table and the data cache structure table. The parameter storage structure table provides configuration parameter updates to the device structure table. Starting from data reception, the process involves querying the device structure table, updating the data cache structure table, storing the historical record structure table, and querying the protocol rule structure table, ultimately completing data reassembly and transmission.
[0008] Furthermore, the device structure table is used to store basic information about devices that communicate with the network port or communication module; the basic information includes device ID, device type, device parameters, device communication method, and header field, with the header field used as the key for association with other structure tables; The data cache structure table is used to store the latest value of each data point. It is associated with the device structure table through the header field. A unified storage structure is used for data from different communication methods to ensure the consistency of data processing. The historical record structure table is used to store the historical records of the data. Each historical record contains a record ID, timestamp, header field, data point, data item, and data value. When querying data, the historical data that meets the conditions is returned by matching the header field, data item, and filtering the timestamp range, thus realizing the query of historical data. The protocol rule table is used to define protocol conversion rules. The protocol conversion rules include protocol conversion rule ID, register order, protocol type, conversion rule, and target interface, and are used for data reassembly and protocol conversion. Among them, register order represents the data order in the protocol combination, and protocol type represents different protocol formats. The parameter storage table is used to store the current configuration parameter ID, configuration parameter name, configuration parameter value, configuration parameter type, and configuration parameter update time of the device that is connected to the network port or communication module. The configuration parameters include communication parameters, network parameters, and working mode.
[0009] Furthermore, the storage structure in the data cache structure table includes cache ID, header field, data point, data length field, data type, data identifier, and data value. Different storage structures are cross-connected through field information to achieve structured data storage. After receiving new data in the history record structure table, the current timestamp of the new data is first recorded and added to the timestamp field of the history record structure table. Then, the device ID of the device that sent the new data is parsed. If the device ID does not exist in the new data or the device ID is inconsistent with the device ID already stored in the history record structure table, it is associated with the device structure table through the header field so as to ensure that each piece of data can be traced back to the physical device.
[0010] Optionally, the historical record structure table also includes a communication method identifier field, which includes a data receiving communication method field and a data outward forwarding communication method field. Through the data receiving communication method field and the data outward forwarding communication method field, the rule-based forwarding and management of data can be realized.
[0011] Optionally, when new data arrives, the header field of the device structure table is queried first, and the new data is added to the corresponding data cache table through the header field. At the same time, the current timestamp is recorded and the current timestamp and data value are added to the history record structure table. When data needs to be sent, the protocol conversion rule ID corresponding to the header field in the protocol rule structure table is queried, and then the target interface for data forwarding is queried. The new protocol order is determined according to the register order in the protocol conversion rule, and the data format is determined according to the target interface for data forwarding. The data is then reassembled into a new protocol and sent to the target interface.
[0012] Optionally, the communication module includes a first communication submodule and a second communication submodule. The first communication submodule is a LoRa wireless communication module, which is communicatively connected to the main control module and is used to support multiple spreading factors and bandwidth configurations to achieve long-distance communication. The second communication submodule is a 4G Cat1 communication module, which is communicatively connected to the main control module and is used to provide wide area network communication connectivity to meet the needs of distributed deployment scenarios.
[0013] Furthermore, the LoRa wireless communication module can be configured as a LoRa terminal node or a LoRa gateway; when acting as a LoRa terminal node, it can send and receive data through the LoRa interface; when acting as a LoRa gateway, it can connect multiple LoRa terminals, collect data, and forward it to the main control module; the communication parameters of the LoRa wireless communication module can be configured through the BOA web interface to adapt to the needs of different application scenarios.
[0014] Optionally, the 4G Cat1 communication module has a built-in TCP / IP protocol stack, supporting TCP client, TCP server, UDP protocol and MQTT protocol, consistent with the network port function; the network parameters and communication parameters of the 4G Cat1 communication module are configured through the BOA web interface.
[0015] Optionally, it also includes a power module, which provides power to the main control module, the switch chip, the communication module, and the storage module.
[0016] The technical solution adopted in this invention has the following technical effects: 1. The switch chip in this invention includes multiple network ports, each belonging to the same intranet, and each port can be independently configured with a communication mode, supporting multiple different protocols and data forwarding configurations, and enabling multiple forwarding modes to provide physical layer data exchange functions. The main control module identifies, parses, stores, converts, and encapsulates data of different protocol types received by the network ports and communication modules through a data storage protocol stack, and forwards the encapsulated data of different protocols through the network ports and communication modules. This integrates the switch, protocol converter, and data processing functions into one device, simplifying the system architecture and effectively solving the problem of high network protocol conversion costs and complexity caused by existing technologies, thus effectively reducing network protocol conversion costs and complexity.
[0017] 2. The data storage protocol stack in this invention includes a device structure table, a data cache structure table, a historical record structure table, a protocol rule structure table, and a parameter storage structure table. The device structure table is associated with the data cache structure table and the historical record structure table through a header field. Data query and combination operations are performed between the protocol rule structure table and the data cache structure table. The parameter storage structure table provides configuration parameter updates to the device structure table. Starting from data reception, the process involves querying the device structure table, updating the data cache structure table, storing the historical record structure table, and querying the protocol rule structure table, ultimately completing data reassembly and transmission, thus achieving efficient data processing and protocol conversion.
[0018] 3. In the technical solution of this invention, after receiving new data in the historical record structure table, the current timestamp of the new data is first recorded and added to the timestamp field of the historical record structure table. Then, the device ID of the device that sent the new data is parsed. If the device ID does not exist in the new data or the device ID is inconsistent with the device ID already stored in the historical record structure table, the header field is associated with the device structure table to ensure that each piece of data can be traced back to the physical device.
[0019] 4. The historical record structure table in the technical solution of the present invention also includes a communication method identifier field. The communication method identifier field includes a data receiving communication method field and a data outward forwarding communication method field. Through the data receiving communication method field and the data outward forwarding communication method field, the rule-based forwarding and management of data is realized.
[0020] 5. The technical solution of this invention integrates wired network, LoRa wireless communication, and 4G Cat1 cellular communication, adapting to various complex environments and application scenarios. The LoRa wireless communication module supports multiple spreading factors and bandwidth configurations to achieve long-distance communication; the 4G Cat1 communication module provides wide area network communication connectivity to meet the needs of distributed deployment scenarios; the LoRa wireless communication module can be configured as a LoRa terminal node or a LoRa gateway; as a LoRa terminal node, it can send and receive data through the LoRa interface; as a LoRa gateway, it can connect multiple LoRa terminals, collect data, and forward it to the main control module; moreover, this protocol converter can be set at the edge to perform data processing and protocol conversion, reducing the burden on the cloud platform and improving system response speed; integrating wired network, LoRa wireless communication, and 4G Cat1 cellular communication adapts to various complex environments and application scenarios.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of the hardware architecture of the multi-functional network protocol converter in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the software architecture of the multi-functional network protocol converter in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the data storage architecture of the multi-functional network protocol converter in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the communication protocol conversion process of the multi-functional network protocol converter in Embodiment 1 of the present invention; Figure 5 This is a schematic diagram of the BOA web page configuration interface of the multi-functional network protocol converter in Embodiment 1 of the present invention. Figure 6 This is a schematic diagram of a typical application scenario (LoRa application scenario in an industrial park) in Embodiment 1 of the present invention; Figure 7 This is a schematic diagram of a typical application scenario (4G remote access scenario) in Embodiment 1 of the present invention; Figure 8 This is a schematic diagram of a typical application scenario (protocol conversion scenario) in Embodiment 1 of the present invention; Figure 9 This is a schematic diagram of a typical application scenario (edge computing and data caching scenario) in Embodiment 1 of the present invention. Detailed Implementation
[0024] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure of the invention, components and arrangements of specific examples are described below. Furthermore, reference numerals and / or letters may be repeated in different examples. This repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. Descriptions of well-known components, processing techniques, and processes are omitted in this invention to avoid unnecessarily limiting the invention.
[0025] Example 1 like Figure 1 As shown, this invention provides a multifunctional network protocol converter, including: a main control module (main control microcontroller), a switch chip, a communication module, and a storage module (Flash storage); the switch chip includes multiple network ports (network port 1, network port 2, network port 3, network port 4, and network port 5, each network port belonging to the same intranet, and each network port can be independently configured with a communication mode, supporting multiple different protocols and data forwarding configurations, and can realize multiple forwarding modes, used to provide physical layer data exchange functions; the storage module is used for data caching; the main control module is connected to the switch chip and the communication module through an internal bus, and is used to identify, parse, store, convert, and encapsulate data of different protocol types received by the network ports and the communication module through a data storage protocol stack, and forward the encapsulated data of different protocols through the network ports and the communication module.
[0026] The switch chip has 5 network ports, supporting switch functionality, and all ports belong to the same internal network. Each port can be independently configured with a communication mode, supporting multiple protocols such as TCP client, TCP server, UDP, and MQTT client. The multi-functional network protocol converter supports flexible data forwarding configuration, enabling one-to-one, one-to-many, and many-to-one forwarding modes, and allows for data filtering and intelligent forwarding via scripts.
[0027] The communication module includes a first communication submodule and a second communication submodule. The first communication submodule is a LoRa wireless communication module (LoRa module), which communicates with the main control module to support various spreading factors and bandwidth configurations, enabling long-distance communication. The second communication submodule is a 4G Cat1 communication module (4G Cat1 module), which communicates with the main control module to provide wide area network (WAN) communication connectivity, meeting the needs of distributed deployment scenarios. It also integrates a LoRa wireless communication module, enabling the transparent transmission of Modbus commands, suitable for long-distance data acquisition and control in complex environments. Simultaneously, the device is also equipped with a 4G Cat1 communication module, providing the same functionality as a network port, offering WAN connectivity to meet the needs of distributed deployment scenarios.
[0028] This invention also features Modbus point table import and polling functions, supports multiple register types, allows editing of the host-slave tree structure via host computer software, and imports the configuration into the device to update parameters; it also supports network search functions, discovering and returning device information within the local area network via UDP broadcast.
[0029] This invention's multi-functional network protocol converter employs a hardware architecture combining a main control microcontroller and a switch chip. The main control microcontroller is responsible for protocol parsing, data processing, and business logic implementation, while the switch chip is responsible for the physical exchange and forwarding of network data. Working together, they achieve efficient data processing and forwarding functions.
[0030] The software system of this invention implements a wide range of functions, such as Figure 2 As shown, it mainly includes: 1. Multi-protocol support: Each network port can be independently configured as TCP client, TCP server, UDP, or MQTT client mode to meet different communication needs.
[0031] 2. Flexible forwarding configuration: Supports multiple forwarding modes such as one-to-one, one-to-many, and many-to-one, allowing users to flexibly configure data flow according to actual needs.
[0032] 3. Data Filtering and Processing: Data filtering and intelligent forwarding are implemented using Luat scripts. Forwarding functions are written in LoRa scripts. Using Luat programming, data is categorized, sending Hex data to the TCP channel and ASCII data to the MQTT channel, achieving data classification and transmission. The forwarding path and processing method are determined based on the data content. All forwarding methods are customizable. Data parsing scripts can be added freely in the BOA interface, along with communication device types (e.g., 4G, LoRa). Communication parameters can be set for each communication device type, or they can be specified in the scripts during data forwarding, such as channel address and port.
[0033] 4. Scheduled Function: Supports scheduled device restarts and scheduled access to the cloud server to retrieve parameters, improving system reliability and remote management capabilities.
[0034] 5. Polling function: The polling period and polling message can be set for each interface to realize periodic data collection from downstream devices.
[0035] 6. Modbus Functionality: Supports Modbus point table import and polling modes. The host computer software can edit the master-slave tree structure via RS-485 communication or LoRa, and import the configuration to the device to update parameters. The host computer software has a tree structure editing function, allowing for intuitive editing of the data types and formats associated with each device. The host computer supports multiple communication methods, including serial communication via RS-485 or LoRa, and can also establish a UDP client to communicate directly with devices within the local area network. It supports multiple register types, including Boolean, floating-point, 16-bit signed / unsigned integers, and 32-bit signed / unsigned integers.
[0036] 7. Web-based User Interface: Provides a configuration interface based on the BOA lightweight web server. The webpage runs on the main control microcontroller, and data uploaded by the device is stored in the database, specifically represented by registers. Users can manipulate registers through the webpage, combine new protocols, and forward data to other interfaces. The web server has a built-in database; all configuration items and parameters are stored there. Upon receiving data, the server selects a suitable processing strategy from the database based on the data source channel. Processing strategies include forwarding methods and forwarding channel parameters. The BOA server has low resource consumption and high performance, making it particularly suitable for embedded systems. It supports CGI and other dynamic content generation, enabling rich web interactive functions.
[0037] 8. Scripting: Supports Groovy scripts for implementing complex protocol conversions and data processing logic. Groovy has unique advantages in protocol conversion and data processing; its dynamic typing, closure features, metaprogramming capabilities, and seamless integration with the Java ecosystem make it an ideal tool for implementing complex protocol conversions. Script conversion programs can be written using the Groovy scripting language to classify data and then integrate it into protocols for other channels.
[0038] 9. LoRa Communication Function: Supports LoRaWAN protocol or proprietary LoRa protocol, configurable as a terminal node or gateway. In terminal mode, Modbus commands can be transparently transmitted via the LoRa interface to achieve data acquisition and control of remote devices. In gateway mode, multiple LoRa terminals can be connected to aggregate data and forward it to the upper-layer system. LoRa communication parameters (such as frequency, spreading factor, bandwidth, etc.) can be flexibly configured through the BOA web interface to adapt to the needs of different application scenarios. For long-distance communication, bandwidth is reduced, spreading factor is increased, and communication rate is reduced to ensure stable data transmission. For short-distance communication with a large number of devices, bandwidth is increased, spreading factor is decreased, and communication rate is increased to improve data transmission efficiency. When there is significant surrounding interference, the system automatically sends channel switching commands to the devices until all devices have completed channel switching, and then automatically switches to the corresponding channel to ensure data transmission stability.
[0039] 10.4G Cat1 Communication Function: Supports the same communication functions as the network port, including multiple protocols such as TCP client, TCP server, UDP, and MQTT client. Network parameters (such as APN, username, password, etc.) and communication parameters (such as server address, port number, etc.) of the 4G module can be configured through the BOA web interface. When users need to ensure data security and reliability, they can enable the APN function to achieve data transmission channel encryption in collaboration with the operator. When connecting to different servers to transmit data, data distribution and transmission can be achieved by adding channels and configuring server addresses and port numbers. The system also implements network status monitoring, automatic reconnection, and traffic management functions. Regarding network status monitoring, a restart mechanism has been added, with configurable reconnection counts. If four consecutive reconnection failures occur after a network outage, a system restart can be triggered. The effect of a system restart is the same as a power outage, greatly improving stability and ensuring stable and reliable communication. It supports automatic querying of remaining data for the card number, and automatically sends an alarm SMS to the management account when data usage exceeds the plan's limit, while also preventing data overdraft.
[0040] like Figure 2As shown in the diagram, the software functional block diagram illustrates the main software functional modules of the multi-functional network protocol converter and their interrelationships. The central data processing core (main control microcontroller) connects all functional modules and coordinates the overall system operation. Modules such as multi-protocol support, flexible forwarding configuration, and data filtering and processing provide basic communication functions. LoRa communication and 4G Cat1 communication functions expand the system's communication capabilities. The BOA web configuration interface provides a user interaction portal. All functional modules interact with external devices through communication interfaces.
[0041] One of the core innovations of this invention lies in its hardware architecture combining a main control microcontroller and a switch chip, and the design of a data storage protocol stack similar to MySQL, which enables efficient data processing and protocol conversion. This protocol stack contains five main structures (tables), establishing relationships between tables through a common header field, thus achieving efficient data storage, querying, and conversion.
[0042] Specifically, such as Figure 3 As shown, the data storage protocol stack includes a device structure table, a data cache structure table, a history record structure table, a protocol rule structure table, and a parameter storage structure table. The device structure table is associated with the data cache structure table and the history record structure table through a header field. Data query and combination operations are performed between the protocol rule structure table and the data cache structure table. The parameter storage structure table provides configuration parameter updates to the device structure table. Starting from data reception, the process involves querying the device structure table, updating the data cache structure table, storing the history record structure table, and querying the protocol rule structure table, ultimately completing the data reassembly and transmission.
[0043] Among them, 1. The device structure table is used to store the basic information of the devices that communicate with the network port or communication module; the basic information includes device ID, device type, device parameters, device communication method and header field, and the header field is used as the key to associate with other structure tables; the device structure table has added related fields for devices connected to LoRa modules and devices connected to 4G Cat1 modules, which are used to identify and manage devices under these communication methods, establish device connections for LoRa communication, and forward to 4G Cat1.
[0044] 2. The data cache structure table is used to store the latest value of each data point. It is associated with the device structure table through the header field. A unified storage structure is used for data from different communication methods to ensure the consistency of data processing. Only the latest value of each data point is stored, and it is associated with the device structure table through the header field. The data cache structure table adopts a unified storage structure for data from different communication methods. All storage structures include cache ID, header field, data point, data length field, data type, data identifier, data value, etc. Different storage structures are cross-connected through the above fields to achieve structured data storage and ensure data processing consistency.
[0045] 3. The historical record structure table is used to store the historical records of the data. Each historical record contains a record ID, timestamp, header field, data point, data item, and data value. When querying data, the historical data that meets the conditions is returned by matching the header field, data item, and filtering the timestamp range. After receiving new data in the history record structure table, the current timestamp of the new data is first recorded and added to the timestamp field of the history record structure table. Then, the device ID of the device that sent the new data is parsed. If the device ID does not exist in the new data or the device ID is inconsistent with the device ID already stored in the history record structure table, it is associated with the device structure table through the header field so as to ensure that each piece of data can be traced back to the physical device.
[0046] The historical record structure table also includes a communication method identifier field, which includes a data receiving communication method field and a data outward forwarding communication method field. Through the data receiving communication method field and the data outward forwarding communication method field, the rule-based forwarding and management of data is realized.
[0047] After new data is transmitted, the current timestamp is recorded and added to the timestamp field of the history record structure table. The history record structure table also includes a communication method identifier field. This mechanism deeply integrates device identifier parsing and protocol processing logic. Specifically, when new data arrives at the main control microcontroller through various hardware interfaces (such as serial ports, Ethernet, and wireless modules), a high-precision timestamp is immediately generated, and a critical data processing pipeline is initiated. First, an attempt is made to directly parse the device ID from the data content. If the data itself does not carry a device ID (common in some simple protocols), the header field of the data frame (usually containing metadata such as source address and protocol type) is used to perform a lookup query with the "device structure table" to accurately map it to a unique device ID, ensuring that each piece of data can be traced back to a specific physical device. Subsequently, this record, containing a timestamp, the parsed or associated device ID (indirectly associated through the header field), the data item name (such as "temperature"), and its data value (such as 25.5), is stored in the history record structure table along with a crucial communication method identifier field. This communication method identifier field is crucial for intelligent data forwarding. It's an enumerated field that primarily identifies two main sources and destinations of data: first, the sub-device communication method (data receiving communication method field, such as SUB_DEVICE_MODBUS, SUB_DEVICE_LORA), indicating that the data originates from downstream terminal devices such as sensors and controllers; second, the external forwarding data communication method (data external forwarding communication method field, such as FORWARD_MQTT, FORWARD_HTTP), indicating that the data needs to be forwarded to external systems, such as cloud platforms or upper-level monitoring centers. Based on this identifier, the system achieves highly flexible data rule forwarding and custom protocol conversion. The entire mechanism operates closely with the solution's hardware and software architecture. At the hardware level, the gateway device, acting as a crucial link, possesses multiple protocol interfaces and is responsible for collecting sub-device data and conducting external network communication. At the software level, an independent "data forwarding module" continuously monitors updates to the historical data structure table. When new data with the "external forwarding" identifier is detected, this module triggers the "protocol conversion engine."
[0048] 4. The protocol rule table is used to define protocol conversion rules. The protocol conversion rules include protocol conversion rule ID, register order, protocol type, conversion rule, and target interface, and are used for data reassembly and protocol conversion. Among them, register order represents the data order in the protocol combination, and protocol type represents different protocol formats. Define protocol conversion rules, including register order and protocol type, for data reassembly and protocol conversion. The order in which registers are stored represents the data order in the protocol combination, and the protocol type represents different protocol formats, such as JSON, Hex, etc. The protocol rule table extends support for LoRa and 4G Cat1 communication, allowing you to define protocol conversion rules for these communication methods.
[0049] 5. The parameter storage table is used to store the current configuration parameter ID, configuration parameter name, configuration parameter value, configuration parameter type, and configuration parameter update time of the device connected to the network port or communication module. The configuration parameters include communication parameters, network parameters, and working mode.
[0050] The parameter storage table now includes configuration parameters for LoRa and 4G Cat1 modules, including communication parameters, network parameters, and operating modes.
[0051] like Figure 4 As shown, the data processing flow is as follows: When new data arrives, first query the header field of the device structure table, add the new data to the corresponding data cache table through the header field, record the current timestamp, and add the current timestamp and data value to the history record structure table. When data needs to be sent, the protocol conversion rule ID corresponding to the header field in the protocol rule structure table is queried, and then the target interface for data forwarding is queried. The new protocol order is determined according to the register order in the protocol conversion rule, and the data format is determined according to the target interface for data forwarding. The data is then reassembled into a new protocol and sent to the target interface.
[0052] The data storage architecture diagram illustrates the structure of five main tables and their relationships. The device table is associated with the data cache table and the historical record structure table through header fields. The protocol rules table performs data query and combination operations with the data cache table. The parameter storage table provides configuration updates to the device table. The data flow begins with the reception of new data, proceeds through device table queries, data cache table updates, historical record structure table storage, and protocol rules table queries, ultimately completing data reassembly and transmission.
[0053] The data processing flow is as follows: When new data arrives (regardless of whether it's via Ethernet, LoRa, or 4G Cat1), the system first queries the device table's header. Using this header, the data is added to the corresponding data cache table, and the current time is recorded, along with the time and data value, which are then added to the historical record structure table. When data needs to be sent, the system queries the protocol rule table, first checking the protocol rule for the corresponding header, then the corresponding data forwarding interface. Based on the data order in the rules, the new protocol order is determined, and the data format is determined based on the protocol interface. The data is then reassembled into a new protocol and sent to the designated interface (which can be Ethernet, LoRa, or 4G Cat1).
[0054] like Figure 4 As shown in the flowchart, the communication protocol conversion process illustrates the complete data processing from reception to transmission. Data can be received via Ethernet, LoRa, or 4G Cat1. After processing steps such as data reception, protocol identification, data parsing, and data storage, it undergoes rule matching, data conversion, and protocol encapsulation before finally being sent out via the appropriate communication method. The script processing module can interact with the data conversion stage to implement complex data processing logic.
[0055] This invention also integrates a LoRa wireless communication module, which connects to the main control microcontroller via a UART or SPI interface. The LoRa module uses a high-performance RF chip, operating in frequency bands of 433MHz / 868MHz / 915MHz (selected according to the regulations of different countries and regions), supporting multiple spreading factors and bandwidth configurations, allowing for flexible adjustment of communication distance and data transmission rate according to actual application scenarios. The LoRa module boasts a high receiving sensitivity of -148dBm, enabling long-distance communication in complex environments. The communication distance can reach 3-5 kilometers in open environments and 1-2 kilometers in urban environments.
[0056] The LoRa communication function of this invention is mainly used to transmit Modbus commands downwards, making it suitable for long-distance data acquisition and control in complex environments. The LoRa communication implementation includes the following key technical points: 1. Hardware Interface: The LoRa module connects to the main control microcontroller via UART, supporting high-speed data exchange and command control.
[0057] 2. Protocol Support: The system supports both the standard LoRaWAN protocol and the proprietary LoRa protocol. When using the LoRaWAN protocol, the device can connect to a standard LoRaWAN network; when using the proprietary LoRa protocol, it can achieve point-to-point or star network topologies.
[0058] 3. Operating Modes: The device can be configured as a LoRa endpoint or a LoRa gateway. When acting as an endpoint, it can send and receive data via the LoRa interface; when acting as a gateway, it can connect multiple LoRa endpoints, aggregate data, and forward it to the upper-layer system.
[0059] 4. Modbus Pass-through: The system encapsulates Modbus commands into LoRa data packets for transmission. At the receiving end, the original Modbus commands are parsed and executed. The pass-through process is transparent to upper-layer applications, which do not need to concern themselves with the underlying transmission details and can operate remote devices as if they were local devices.
[0060] 5. Parameter configuration: LoRa communication parameters (such as frequency, spreading factor, bandwidth, transmit power, etc.) can be flexibly configured through the BOA web interface to adapt to the needs of different application scenarios.
[0061] 6. Data Processing: The data received by LoRa is also stored and processed through a five-table structure, which is consistent with the data processing flow of other communication methods, ensuring the uniformity and maintainability of the system.
[0062] Meanwhile, the multi-functional network protocol converter is also equipped with a 4G Cat1 communication module, which connects to the main control microcontroller via a UART interface. The 4G Cat1 module supports LTE Cat.1 technology, with uplink speeds up to 5Mbps and downlink speeds up to 10Mbps, meeting the data transmission needs of most IoT applications. The module has a built-in TCP / IP protocol stack, supports multiple socket connections, and can achieve the same communication functions as a network port. The module also supports multi-band operation, is compatible with major global operator networks, and features automatic reconnection and network status monitoring functions to ensure stable and reliable communication.
[0063] The 4G Cat1 communication function of this invention is mainly used to achieve the same function as the network port, providing wide area network connectivity to meet the needs of distributed deployment scenarios. The 4G Cat1 communication implementation includes the following key technical points: 1. Hardware Interface: The 4G Cat1 module connects to the main control microcontroller via a UART interface, supporting AT command control and data transmission.
[0064] 2. Protocol support: The 4G Cat1 module has a built-in TCP / IP protocol stack, supporting multiple protocols such as TCP client, TCP server, UDP and MQTT, consistent with the network port function.
[0065] 3. Network Management: The system implements network status monitoring, signal strength monitoring, automatic reconnection, and traffic management functions to ensure stable and reliable communication while avoiding excessive traffic.
[0066] 4. Security Mechanism: Supports SSL / TLS encrypted communication to ensure data transmission security.
[0067] 5. Parameter Configuration: The network parameters (such as APN, username, password, etc.) and communication parameters (such as server address, port number, etc.) of the 4G Cat1 module can be configured through the BOA web interface.
[0068] 6. Data processing: The data received by 4G Cat1 is also stored and processed through a five-table structure, which is consistent with the data processing flow of other communication methods, ensuring the uniformity and maintainability of the system.
[0069] The technical solution of this invention can use the BOA lightweight web server to implement a web configuration interface. Users can access the device through a web browser to configure parameters, monitor status, and manage data. The BOA web configuration interface has the following characteristics: 1. Lightweight Implementation: The BOA server boasts low resource consumption and high performance, making it particularly suitable for embedded systems. The system optimizes the configuration of the BOA server to further reduce resource consumption, ensuring a smooth web experience even with limited hardware resources. The BOA server occupies only approximately 200KB of ROM and 50KB of RAM, with a CPU utilization rate of less than 5% during runtime, making it suitable for use in resource-constrained embedded systems.
[0070] 2. Responsive Design: The website interface adopts a responsive design, supporting access on both PCs and mobile devices. The interface automatically adjusts its layout according to screen size, providing a superior user experience. The interface is implemented using HTML5 and CSS3 technologies, is compatible with mainstream browsers, and requires no additional plugins.
[0071] 3. Functional Modules: The web interface includes functional modules such as device status, network configuration, protocol conversion, LoRa settings, 4G Cat1 settings, Modbus configuration, and system settings, which users can operate as needed. These modules are organized via a left-hand navigation bar for easy access to the desired functions.
[0072] 4. Parameter Configuration: Supports configuration of all communication parameters and protocol conversion rules, including parameters related to network interface, LoRa, and 4GCat1. Users can flexibly configure various parameters through a web interface without the need for dedicated tools or complex operations. Parameter configuration uses a form-based approach, providing input validation and error prompts to reduce the configuration error rate.
[0073] 5. Visualization: Provides data monitoring and device status visualization functions, allowing users to intuitively understand the device's operating status and data flow. Visualization functions include real-time data curves, communication status indicators, network topology diagrams, etc., helping users quickly grasp the system's operating status.
[0074] 6. Security Mechanisms: User authentication and access control functions are implemented to prevent unauthorized access and operations. Security mechanisms include username and password authentication, session timeout control, and operation permission management to ensure system security and reliability.
[0075] like Figure 5 As shown in the diagram, the BOA web page configuration interface illustrates the LoRa communication settings page, offering richer configuration options including LoRa frequency settings, spreading factor, bandwidth, and transmit power. By configuring these parameters, one-to-one or one-to-many communication between LoRa modules can be achieved, ensuring that LoRa modules on different channels do not interfere with each other. The left side features a navigation menu with options for device status, network configuration, protocol conversion, LoRa settings, 4G Cat1 settings, Modbus configuration, and system settings. The right side displays the main content area of the LoRa communication settings page, including basic parameter settings (operating mode, frequency, spreading factor, bandwidth, transmit power, etc.), Modbus pass-through settings (pass-through enable, slave address, function code, start register, number of registers, etc.), and network topology settings. The network topology diagram visually displays the relationships between gateways and nodes. Save settings and cancel buttons are located at the bottom for confirming or discarding configuration changes.
[0076] The specific implementation method of the BOA web configuration interface is as follows: 1. Server Configuration: The BOA server is configured to listen on port 80 of the device, support the HTTP 1.1 protocol, and has a maximum concurrent connection count of 10. The server root directory is set as a dedicated partition in the device's Flash storage, and web page files are stored in compressed form to reduce storage space usage.
[0077] 2. Dynamic Content Generation: Dynamic content generation is achieved using CGI (Common Gateway Interface) technology. The CGI program, written in C, directly accesses the device's internal data structures to read and set parameters. To improve performance, the system implements a CGI program caching mechanism to avoid frequent loading of executable files.
[0078] 3. AJAX Technology Application: The web interface uses AJAX (Asynchronous JavaScript and XML) technology to achieve asynchronous data updates, improving the user experience. Data is transmitted in JSON format, reducing network traffic and improving response speed.
[0079] 4. Network Topology Visualization: The network topology map is implemented using HTML5 Canvas technology, supporting dynamic updates and interactive operations. Users can adjust the position of nodes by dragging and dropping, and click on nodes to view detailed information, achieving intuitive network management.
[0080] 5. Parameter Validation Mechanism: All user input parameters are validated on both the client and server sides to ensure parameter validity. Client-side validation is implemented using JavaScript, providing immediate feedback; server-side validation is implemented in a CGI program to prevent illegal parameter settings.
[0081] 6. Configuration File Management: The system supports configuration import and export functions. Users can save the current configuration as a file or load configurations from a file. The configuration files are in JSON format for easy editing and parsing. The system also provides configuration backup and restore functions to prevent configuration loss due to accidental operations.
[0082] 7. Multilingual support: The interface supports switching between Chinese and English to meet the needs of different users. Language files are stored in JSON format for easy expansion to support other languages.
[0083] 8. Mobile Device Optimization: The size and layout of interface elements have been optimized for mobile device access scenarios, ensuring convenient operation even on small-screen devices. The system detects the type of accessing device and automatically loads appropriate CSS styles.
[0084] The technical solution of this invention also supports network search functionality, implemented using UDP broadcasting. Within a local area network, a specified message is broadcast via UDP, and upon receiving the data, the device will broadcast back parameters such as its address and model. Users can search for and display all devices and their parameters within the network using host computer software, facilitating device management and configuration.
[0085] The multi-functional network protocol converter in this invention can be applied in the following scenarios: 1. Protocol Conversion Scenarios: This invention can be used to forward data from TCP client / TCP server devices to the MQTT protocol and convert hexadecimal data to JSON or ASCII format for easier interaction with cloud platforms. This function can replace the traditional "router + switch + industrial control computer" combination, integrating the functions of the three devices together, significantly reducing system costs and improving stability.
[0086] 2. Modbus Data Acquisition Scenarios: This invention, when used with a serial port server, enables the recall and conversion of Modbus device data. The converted data can be directly uploaded to the platform. The device performs data processing and forwarding functions at the edge, similar to an RTU, reducing the load on the cloud platform and demonstrating edge computing capabilities.
[0087] 3. Data Caching Application: This invention incorporates a structured database, storing all retrieved data in flash memory. Data can be queried by table and primary key. The system can store a significant amount of historical data and ensure stable data uploads even under unstable network conditions, thus improving system reliability.
[0088] 4. LoRa Long-Distance Data Acquisition Scenarios: This invention can connect to long-distance sensors and control devices via a LoRa interface, enabling data acquisition and control in complex environments. It is particularly suitable for complex environments and difficult wiring scenarios such as industrial parks, agricultural greenhouses, and mines. The device can be configured as a LoRa gateway, connecting multiple LoRa terminals, collecting data, and forwarding it to a cloud platform to achieve a large-scale, multi-node data acquisition network.
[0089] 5. 4G Remote Access Scenarios: This invention achieves remote access functionality through a 4G Cat1 module, suitable for distributed deployment scenarios. The device can be installed in remote areas or mobile environments, maintaining a connection with the central system via a 4G network to achieve remote data acquisition, monitoring, and control. This function is particularly suitable for remote monitoring systems in fields such as water conservancy, power, and environmental protection.
[0090] Specifically, such as Figures 6-9 As shown in the diagram, the application scenario diagram illustrates four typical application scenarios: LoRa application scenario in industrial parks, 4G remote access scenario, protocol conversion scenario, and edge computing and data caching scenario.
[0091] In LoRa application scenarios in industrial parks, the protocol converter acts as a LoRa gateway, connecting sensor nodes distributed in different factories and uploading data to the cloud platform via the MQTT protocol.
[0092] In 4G remote access scenarios, protocol converters are installed at remote sites and connect to cloud platforms via 4G networks to achieve remote data acquisition and control.
[0093] In protocol conversion scenarios, the protocol converter connects to devices using different protocols (TCP, UDP, Modbus) and converts the data into the MQTT protocol for uploading to the cloud platform.
[0094] In edge computing and data caching scenarios, protocol converters connect to multiple sensors, perform data processing and caching locally, save data when the network is interrupted, and upload it to the cloud platform after the connection is restored.
[0095] Furthermore, a multi-functional network protocol converter in this embodiment of the invention also includes a power supply module, which provides power to the main control module, switch chip, communication module, and storage module. In terms of power supply, it supports 8-60V wide-voltage DC power supply and 110-220V AC direct power supply, adapting to various industrial environment requirements.
[0096] The switch chip in this invention includes multiple network ports, each belonging to the same intranet, and each port can be independently configured with a communication mode, supporting multiple different protocols and data forwarding configurations, and enabling multiple forwarding modes to provide physical layer data exchange functions. The main control module identifies, parses, stores, converts, and encapsulates data of different protocol types received by the network ports and communication modules through a data storage protocol stack, and forwards the encapsulated data of different protocols through the network ports and communication modules. This integrates the switch, protocol converter, and data processing functions into one device, simplifying the system architecture and effectively solving the problem of high network protocol conversion costs and complexity caused by existing technologies, thus effectively reducing network protocol conversion costs and complexity.
[0097] The data storage protocol stack in this invention includes a device structure table, a data cache structure table, a historical record structure table, a protocol rule structure table, and a parameter storage structure table. The device structure table is associated with the data cache structure table and the historical record structure table through a header field. Data query and combination operations are performed between the protocol rule structure table and the data cache structure table. The parameter storage structure table provides configuration parameter updates to the device structure table. Starting from data reception, the process involves querying the device structure table, updating the data cache structure table, storing the historical record structure table, and querying the protocol rule structure table, ultimately completing data reassembly and transmission, thus achieving efficient data processing and protocol conversion.
[0098] In the technical solution of this invention, after receiving new data in the history record structure table, the current timestamp of the new data is first recorded and added to the timestamp field of the history record structure table. Then, the device ID of the device that sent the new data is parsed. If the device ID does not exist in the new data or the device ID is inconsistent with the device ID already stored in the history record structure table, the header field is associated with the device structure table to ensure that each piece of data can be traced back to the physical device.
[0099] The historical record structure table in the technical solution of this invention also includes a communication method identifier field, which includes a data receiving communication method field and a data outward forwarding communication method field. Through the data receiving communication method field and the data outward forwarding communication method field, the rule-based forwarding and management of data is realized.
[0100] This invention integrates wired network, LoRa wireless communication, and 4G Cat1 cellular communication to adapt to various complex environments and application scenarios. The LoRa wireless communication module supports multiple spreading factors and bandwidth configurations to achieve long-distance communication; the 4G Cat1 communication module provides wide area network communication connectivity to meet the needs of distributed deployment scenarios; the LoRa wireless communication module can be configured as a LoRa terminal node or a LoRa gateway; as a LoRa terminal node, it can send and receive data through the LoRa interface; as a LoRa gateway, it can connect multiple LoRa terminals, collect data, and forward it to the main control module; moreover, this protocol converter can be set at the edge to perform data processing and protocol conversion, reducing the burden on the cloud platform and improving system response speed; integrating wired network, LoRa wireless communication, and 4G Cat1 cellular communication adapts to various complex environments and application scenarios.
[0101] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A multi-functional network protocol converter, characterized in that, include: The system comprises a main control module, a switch chip, a communication module, and a storage module. The switch chip includes multiple network ports, each belonging to the same intranet, and each port can be independently configured with a communication mode, supporting various protocols and data forwarding configurations. It can implement multiple forwarding modes to provide physical layer data exchange functions. The storage module is used for data caching. The main control module is connected to the switch chip and the communication module, and is used to identify, parse, store, convert, and encapsulate data of different protocol types received by the network ports and the communication module through a data storage protocol stack. It then forwards the encapsulated data of different protocols through the network ports and the communication module. The data storage protocol stack includes a device structure table, a data cache structure table, a history record structure table, a protocol rule structure table, and a parameter storage structure table. The device structure table is associated with the data cache structure table and the history record structure table through a header field. Data query and combination operations are performed between the protocol rule structure table and the data cache structure table. The parameter storage structure table provides updates to the configuration parameters of the device structure table. Starting from data reception, the process involves querying the device structure table, updating the data cache structure table, storing historical records in the structure table, querying the protocol rule structure table, and finally completing the data reassembly and transmission. The device structure table is used to store basic information about devices that communicate with the network port or communication module; the basic information includes device ID, device type, device parameters, device communication method, and header field, with the header field used as the key to associate with other structure tables; The data cache structure table is used to store the latest value of each data point. It is associated with the device structure table through the header field. A unified storage structure is used for data from different communication methods to ensure the consistency of data processing. The historical record structure table is used to store the historical records of the data. Each historical record contains a record ID, timestamp, header field, data point, data item, and data value. When querying data, the historical data that meets the conditions is returned by matching the header field, data item, and filtering the timestamp range, thus realizing the query of historical data. The protocol rule table is used to define protocol conversion rules. The protocol conversion rules include protocol conversion rule ID, register order, protocol type, conversion rule, and target interface, and are used for data reassembly and protocol conversion. Among them, register order represents the data order in the protocol combination, and protocol type represents different protocol formats. The parameter storage table is used to store the current configuration parameter ID, configuration parameter name, configuration parameter value, configuration parameter type, and configuration parameter update time of the device that is connected to the network port or communication module. The configuration parameters include communication parameters, network parameters, and working mode.
2. The multifunctional network protocol converter according to claim 1, characterized in that, The storage structure in the data cache structure table includes cache ID, header field, data point, data length field, data type, data identifier, and data value. Different storage structures are cross-connected through field information to achieve structured data storage. After receiving new data in the history record structure table, the current timestamp of the new data is first recorded and added to the timestamp field of the history record structure table. Then, the device ID of the device that sent the new data is parsed. If the device ID does not exist in the new data or the device ID is inconsistent with the device ID already stored in the history record structure table, it is associated with the device structure table through the header field so as to ensure that each piece of data can be traced back to the physical device.
3. A multifunctional network protocol converter according to claim 1, characterized in that, The historical record structure table also includes a communication method identifier field, which includes a data receiving communication method field and a data outward forwarding communication method field. Through the data receiving communication method field and the data outward forwarding communication method field, the rule-based forwarding and management of data is realized.
4. A multifunctional network protocol converter according to claim 1, characterized in that, When new data arrives, first query the header field of the device structure table, add the new data to the corresponding data cache table through the header field, record the current timestamp, and add the current timestamp and data value to the history record structure table; When data needs to be sent, the protocol conversion rule ID corresponding to the header field in the protocol rule structure table is queried, and then the target interface for data forwarding is queried. The new protocol order is determined according to the register order in the protocol conversion rule, and the data format is determined according to the target interface for data forwarding. The data is then reassembled into a new protocol and sent to the target interface.
5. A multifunctional network protocol converter according to claim 1, characterized in that, The communication module includes a first communication submodule and a second communication submodule. The first communication submodule is a LORA wireless communication module, which is communicatively connected to the main control module and is used to support multiple spreading factors and bandwidth configurations to achieve long-distance communication. The second communication submodule is a 4G Cat1 communication module, which is communicatively connected to the main control module and is used to provide wide area network communication connectivity to meet the needs of distributed deployment scenarios.
6. A multifunctional network protocol converter according to claim 5, characterized in that, The LoRa wireless communication module can be configured as a LoRa terminal node or a LoRa gateway. When used as a LoRa terminal node, it can send and receive data through the LoRa interface. When used as a LoRa gateway, it can connect multiple LoRa terminals, collect data, and forward it to the main control module. The communication parameters of the LoRa wireless communication module can be configured through the BOA web interface to adapt to the needs of different application scenarios.
7. A multifunctional network protocol converter according to claim 5, characterized in that, The 4G Cat1 communication module has a built-in TCP / IP protocol stack, supporting TCP client, TCP server, UDP and MQTT protocols, consistent with the network port function; the network and communication parameters of the 4G Cat1 communication module are configured through the BOA web interface.
8. A multifunctional network protocol converter according to any one of claims 1-7, characterized in that, It also includes a power module, which provides power to the main control module, switch chip, communication module and storage module.
Citation Information
Patent Citations
Method for converting data protocols of database query interface based on multi-stage protocol stack structure
CN102890712A
Internet of Things intelligent gateway for multi-data protocol conversion
CN106878163A