Intelligent gateway system

Through the design of the intelligent gateway system, the universal data interface layer and protocol adapter layer are used to achieve multi-protocol adaptation, which solves the communication obstacle problem when the traditional gateway system handles multiple protocols and improves the flexibility and intelligence level of the Internet of Things system. Simplified new protocol integration process.

CN118612307APending Publication Date: 2024-09-06SHANGHAI ELECTRICAL APPLIANCES RES INSTGROUP
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410885769.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Traditional gateway systems can only handle specific communication protocols, resulting in communication barriers between devices and systems, affecting the overall performance and flexibility of the IoT system.

Method used

An intelligent gateway system is designed, including a communication protocol processing module, a protocol identification module, a dynamic configuration module and a control logic module. It implements a variety of communications through a general data interface layer, protocol adapter layer, protocol manager and protocol parser plug-in. Automatic identification and adaptation of protocols, dynamic loading and unloading of protocol adapter modules, and support for adaptation and expansion.

Benefits of technology

It achieves seamless communication between different devices and systems, improves the system's versatility and intelligence, reduces manual maintenance costs, simplifies the integration process of new protocols, and enhances the system's flexibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118612307A
    Figure CN118612307A
Patent Text Reader

Abstract

The invention discloses an intelligent gateway system which is characterized by comprising a communication protocol processing module, a protocol identification module, a dynamic configuration module and a control logic module. The invention aims to provide the intelligent gateway system which can automatically identify and adapt to various communication protocols, so that seamless communication between different equipment and the system is realized, the universality and the intelligent level of the system are improved, and the problem of communication compatibility when the existing intelligent gateway system processes various communication protocols is solved. Compared with an existing patent scheme, protocol identification and adaptation are carried out based on a protocol head feature library, and a complicated and huge equipment type library does not need to be established; a plug-in management mode is introduced, so that the expandability is higher; maintenance and management are simpler, more convenient and easier to implement, and the coverage range of compatible equipment is wider.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an intelligent gateway system and belongs to the technical field of communications. Background Art

[0002] With the development of Internet of Things technology, various communication protocols are being used more and more widely. In order to achieve interoperability between devices, there are a large number of devices and sensors in the fields of Internet of Things and smart home, and these devices may use different communication protocols for communication. Existing gateway systems usually only support a single communication protocol and lack the ability to uniformly manage and adapt to multiple protocols, resulting in system complexity and reduced communication efficiency.

[0003] Patent CN201410606450.5 introduces a communication protocol configuration method based on a device model library. The method obtains the device identification of the entered network access device and selects the device type from the preset device type set; according to the corresponding trigger conditions and trigger actions, a communication protocol corresponding to the device identification for accessing the Internet of Things service platform and connecting and communicating with the network access device is generated and stored on the Internet of Things service platform. Summary of the invention

[0004] The technical problem to be solved by the present invention is that traditional gateway systems can often only process specific communication protocols, resulting in communication barriers between devices and systems, affecting the overall performance and flexibility of the Internet of Things system.

[0005] In order to solve the above technical problems, the technical solution of the present invention is to provide an intelligent gateway system, which is characterized by comprising a communication protocol processing module, a protocol identification module, a dynamic configuration module and a control logic module, wherein:

[0006] The communication protocol processing module is used to process the received data packets and distribute the data packets to the corresponding data processing submodules in the control logic module for processing according to the identification results of the protocol identification module. Its implementation includes the following steps:

[0007] Step 101, implement a universal data interface layer: design a universal data interface layer to unify the data formats of different protocols. The data interface layer defines a universal data structure and operation method, so that the control logic module can uniformly process data of various protocols;

[0008] Step 102, implement the protocol adapter layer: on the data interface layer designed in step 101, design the protocol adapter layer, each protocol adapter module in the protocol adapter layer is responsible for converting the data of a specific protocol into the data format defined by the data interface layer, and encapsulating it into a unified data packet for transmission;

[0009] Step 103, implement the protocol manager: design a protocol manager for managing and scheduling various protocol adapter modules. The protocol manager is responsible for dynamically loading and unloading various protocol adapter modules as needed, and distributing the received data to the corresponding protocol adapter modules for processing; the protocol manager is also used to maintain the status information of each protocol adapter module and dynamically adjust the working status of the protocol adapter module;

[0010] Step 104, implement protocol extensibility design: design the communication protocol parser as an independent protocol parser plug-in, each protocol parser plug-in corresponds to a specific communication protocol, and when the system is running, the required protocol parser plug-in is obtained from the predefined plug-in directory or the cloud through the dynamic loading function, and dynamically loaded into the memory, and the loaded protocol parser plug-in interacts with other modules of the system to implement parsing and processing of data packets; each protocol adapter module implements a standard plug-in interface, and the user writes a customized protocol parser plug-in as needed and loads it into the system for use;

[0011] The protocol identification module is used to identify the communication protocol used by the data packet, based on the protocol-specific start identifier, to determine the communication protocol type of the data packet;

[0012] The dynamic configuration module is used to dynamically configure system parameters and priority strategies, and realize adaptive adjustment and optimization of system parameters according to the external environment and user needs;

[0013] The control logic module is used to implement the control logic and functions of the system, including a data processing submodule, a communication control submodule and an error handling submodule.

[0014] Preferably, in step 102, each of the protocol adapter modules implements a standard interface, including data parsing and encapsulation methods, to achieve rapid adaptation and expansion of new protocols.

[0015] Preferably, in step 104, the management of the protocol parser plug-in is implemented through a plug-in management module, and the implementation scheme covers the directory structure, interface specification, custom plug-in module loader and plug-in manager of the protocol parser plug-in:

[0016] In the plug-in management module, all protocol parser plug-ins are stored in a predefined plug-in directory. Each protocol parser plug-in is an independent module. Each protocol parser plug-in defines a standard interface, which all protocol parser plug-ins must implement.

[0017] Customize the plugin module loader to support searching for the specified protocol parser plugin module from the plugin directory; call the create_module(spec) function to create and initialize the module object; support calling exec_module(spec) to execute the protocol logic in the protocol parser plugin;

[0018] A custom plug-in manager is responsible for managing the dynamically running protocol parser plug-in instance object pool.

[0019] Preferably, the implementation of the protocol identification module includes the following steps:

[0020] Step 201, feature extraction: extract the start identifier by reading the first few bytes of the data packet to obtain the feature, and extract the protocol type information by parsing the header field of the data packet;

[0021] Step 202, feature matching: a feature library is established for each communication protocol through string matching and regular expression matching methods, which contains feature information of the communication protocol. After receiving the data packet, the features extracted in step 201 are matched with the features in the feature library to determine the protocol type used by the data packet and obtain the feature matching result;

[0022] Step 203, outputting the recognition result: according to the feature matching result, the communication protocol used by the data packet is determined, and the recognition result is output to the communication protocol processing module for processing. If the match fails or the protocol type cannot be determined, a default unknown protocol type or an error prompt is output;

[0023] Step 204, protocol feature library update: adopt an automatic crawling update mechanism to regularly obtain the latest protocol feature information from the protocol standard library or the protocol manufacturer's website, and update it to the local feature library.

[0024] Preferably, in step 204, the following steps are adopted to implement the regular collection and update of the communication protocol feature information in the feature library:

[0025] Step 2041, define and initialize a list URLS containing target URLs, where the URLs include authoritative standard protocol libraries and protocol vendor website links;

[0026] Step 2042: declare and implement the fetch_protocol_info(url) function, access the given URL through the requests library and issue an HTTP GET request to obtain response information;

[0027] Step 2043: declare and implement the parse_protocol_page(html_content) function, parse the HTML response body and extract the target information through the BeatifulSoup library;

[0028] Step 2044: declare and implement the save_protocol_info(protocols) function, and store the protocol extracted in step 2043 and its corresponding header feature value into the local file protocols.json;

[0029] Step 2045: declare and implement the update_protocols() function, which is used to traverse the URLS list and call the fetch_protocol_info(url), parse_protocol_page(html_content) and parse_protocol_page(html_content) interfaces one by one to complete the feature value update operation of the entire protocol list;

[0030] Step 2046: Start the main loop. In the main loop, call the schedule library to set the scheduled task.

[0031] Preferably, the implementation of the dynamic configuration module comprises the following steps:

[0032] Step 301, determine configuration items: determine configuration items that need to be prioritized;

[0033] Step 302: Priority definition: define the priority range of each configuration item, and for each level, clarify its priority order;

[0034] Step 303: Priority adjustment strategy: automatically adjust the priority of the configuration item, or allow the administrator or user to manually adjust the priority of the configuration item to cope with temporary special circumstances or demand changes;

[0035] Step 304, configuration item persistence: ensure that the priority setting of the configuration item can be persisted, save the priority setting to a persistent storage medium, and load and apply it when the system starts.

[0036] Preferably, the data processing submodule is responsible for processing and parsing the received data: according to the identification result of the protocol identification module, the data is distributed to the corresponding data processing submodule for processing, and the data processing submodule is designed according to specific business requirements.

[0037] Preferably, the communication control submodule is used to manage and control the communication with the external device: establish a communication connection with the external device according to the configuration information of the dynamic configuration module, and monitor the communication status in real time.

[0038] Preferably, the error handling submodule is used to monitor errors and abnormal conditions during system operation, and to handle and recover them according to predefined strategies.

[0039] The present invention aims to propose an intelligent gateway system that can automatically identify and adapt to various communication protocols, thereby achieving seamless communication between different devices and systems, improving the versatility and intelligence of the system, and solving the communication compatibility problems faced by existing intelligent gateway systems when dealing with multiple communication protocols. Compared with the existing patent solutions, the present invention uses a protocol header feature library for protocol identification and adaptation, without the need to establish a complex and large device type library; and introduces a plug-in management method, which has stronger scalability; maintenance and management are simpler and easier, and the coverage of compatible devices is wider.

[0040] The present invention achieves the following significant effects by introducing an automatic crawling mechanism and a plug-in management mechanism into the intelligent gateway multi-protocol adaptive system:

[0041] 1) Automatically collect and update the protocol feature library, reduce manual maintenance costs, and improve overall operating efficiency;

[0042] 2) Standardize the storage protocol header format to ensure data processing consistency;

[0043] 3) Dynamically load and unload protocol plug-ins to achieve flexible expansion of system functions and simplify the integration process of new protocols;

[0044] 4) Modular and low-coupling plug-in management mechanism effectively reduces the dependency between modules.

[0045] The present invention significantly improves the flexibility, scalability and automation level of the intelligent gateway multi-protocol adaptive system, can efficiently meet the application requirements in a multi-protocol environment, and provides users with a reliable, efficient and intelligent solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is the functional module diagram of the intelligent gateway system. Figure 1 The functional module diagram of the intelligent gateway system is shown, including the communication protocol processing module, protocol identification module, dynamic configuration module and control logic module. The communication protocol processing module is used to process the received data packets, the protocol identification module is used to identify the communication protocol used by the data packets, the dynamic configuration module is used to dynamically configure the system parameters and priority strategies, and the control logic module is used to implement the control logic and functions of the system.

[0047] Figure 2 This is a schematic diagram of plug-in management. In the figure, the plug-in interface is a standard interface provided by the main application, which defines the functions that the plug-in needs to implement and the way to interact with the main application in XML format. The plug-in manager is used to manage the life cycle of the plug-in, including operations such as loading, initialization, enabling, disabling, and uninstalling. The plug-in is a dynamic link library encapsulation of a specific communication protocol, providing message packaging, parsing, and transceiver function interfaces of different protocols for the main program to call.

[0048] Figure 3 The workflow diagram for protocol feature library update (automatic crawling mechanism) uses a scheduled task to traverse the target website (such as IETF, IEEE official website, etc.), parse and obtain the target feature value, and store it in a local file in the form of structured data. DETAILED DESCRIPTION

[0049] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.

[0050] like Figure 1 As shown, an intelligent gateway system disclosed in an embodiment of the present invention includes a communication protocol processing module, a protocol identification module, a dynamic configuration module and a control logic module. Each model is described in detail below.

[0051] 1) Communication protocol processing module: used to process received data packets and distribute the data packets to corresponding data processing submodules for processing according to the identification results of the protocol identification module.

[0052] The implementation of the communication protocol processing module includes the following steps:

[0053] Step 1: Implement a universal data interface layer: Design a universal data interface layer to unify the data formats of different protocols. The data interface layer defines a universal data structure and operation method, so that the upper layer modules (e.g., communication protocol processing module) can uniformly process data of various protocols.

[0054] Step 2, implement the protocol adapter layer: on top of the data interface layer designed in step 1, design the protocol adapter layer. Each protocol adapter module in the protocol adapter layer is responsible for converting the data of a specific protocol into the data format defined by the data interface layer, and encapsulating it into a unified data packet for transmission.

[0055] In the embodiment of the present invention, each protocol adapter module implements a standard interface, including data parsing and encapsulation methods, to achieve rapid adaptation and expansion of new protocols.

[0056] Step 3: Implement the protocol manager: Design a protocol manager to manage and schedule various protocol adapter modules. The protocol manager is responsible for dynamically loading and unloading various protocol adapter modules as needed, and distributing the received data to the corresponding protocol adapter modules for processing.

[0057] The protocol manager is also responsible for maintaining the status information of each protocol adapter module, including connection status, priority, etc., and dynamically adjusting the working status of the protocol adapter module according to factors such as network environment and system load.

[0058] Step 4: Implement protocol extensibility design: In order to achieve protocol extensibility, a flexible plug-in mechanism is designed, and the communication protocol parser is designed as an independent protocol parser plug-in. Each protocol parser plug-in corresponds to a specific communication protocol, including protocol parsing rules, data format, verification method, etc. This design enables the system to be easily expanded to support new communication protocols without modifying the core code of the system.

[0059] When the system is running, the required protocol parser plug-in is obtained from the predefined plug-in directory or the cloud through the dynamic loading function, and dynamically loaded into the memory. This process can be achieved through the dynamic link library loading mechanism provided by the operating system. For example: under the Linux system, the dlopen() function can be used to dynamically load the shared library. The loaded protocol parser plug-in will interact with other modules of the system to realize the parsing and processing of data packets.

[0060] Each protocol adapter module implements a standard plug-in interface, including initialization, start, stop and destroy methods. Users can write custom protocol parser plug-ins as needed and load them into the system for use.

[0061] A preferred implementation method is that the embodiment of the present invention designs a plug-in management module to implement the management of the protocol parser plug-in, and the implementation scheme covers the directory structure, interface specifications, custom loader and plug-in manager of the protocol parser plug-in.

[0062] In the plugin management module, all protocol parser plugins are stored in a predefined plugin directory, and each protocol parser plugin is an independent module. The directory structure is as follows:

[0063] / plugins /

[0064] plugin1.py

[0065] plugin2.py ...

[0067] Each protocol parser plugin defines a standard interface PluginInterface, which all protocol parser plugins must implement. The interface defines the life cycle methods of the protocol parser plugin:

[0068] a) initialize(self): Initialize the plugin.

[0069] b)start(self): Start the plugin.

[0070] c)stop(self): Stop the plugin.

[0071] d)destroy(self): destroy the plugin.

[0072] Customized plug-in module loader (Loader class), supports searching for specified protocol parser plug-in modules from the plug-in directory; calls create_module(spec) function to create and initialize module objects; supports calling exec_module(spec) to execute protocol logic in the protocol parser plug-in (including protocol parsing, packet assembly, sending and receiving interfaces, etc.).

[0073] The custom plug-in manager (PluginManager class) is responsible for managing the dynamically running protocol parser plug-in instance object pool, including the initialization, start, stop and destruction operations of the protocol parser plug-in instance objects.

[0074] By dynamically loading the protocol parser plug-in, the protocol parser plug-in can be added and removed at runtime, and the system has high flexibility and scalability. Each protocol parser plug-in is an independent module, which reduces the coupling between modules and improves the reliability and maintainability of the system.

[0075] 2) Protocol identification module: used to identify the communication protocol used by the data packet, based on the protocol-specific start identifier, to determine the communication protocol type of the data packet.

[0076] In the embodiment of the present invention, the protocol identification module uses a feature identification method to perform protocol identification, and the specific method is to identify the form of the message header. The message header is a part of the data packet, which usually contains information about the data packet type, source address, destination address, etc. Different communication protocols have different message header formats and features. The following lists some common communication protocol message header formats and their differences:

[0077] a) Modbus RTU / TCP: RTU format: includes fields such as slave address, function code, data field and CRC checksum. TCP format: uses a TCP-based communication method, including TCP header and Modbus data packet, where the TCP header contains information such as source port and destination port, while the Modbus data packet contains fields such as function code, data field and CRC checksum.

[0078] b) HTTP / HTTPS: The HTTP message header includes the request line, request header, and message body. The request line contains information such as the request method, URL, and HTTP version. HTTPS adds SSL / TLS encryption to HTTP, so the message header will contain SSL / TLS handshake information, such as ClientHello.

[0079] c) OPCUA: The OPCUA message header format is complex, including the message header, message body and security header. The message header contains information such as message type and message size, and the security header contains security-related information such as encryption algorithm and key length.

[0080] d) DLT645: The DLT645 message header contains the start character, address field, control code and data field, among which the address field and control code are used to identify the type and function of the data packet.

[0081] Specifically, the implementation of the protocol identification module includes the following steps:

[0082] Step 1: Feature extraction: The starting identifier can be extracted by reading the first few bytes of the data packet to obtain the features, and the protocol type information can be extracted by parsing the header field of the data packet.

[0083] Step 2, feature matching: Use string matching and regular expression matching methods to build a feature library for each communication protocol, which contains the feature information of the communication protocol. After receiving the data packet, match the features extracted in step 1 with the features in the feature library to determine the protocol type used by the data packet and obtain the feature matching result.

[0084] Step 3: Output recognition results: According to the feature matching results, determine the communication protocol used by the data packet, and output the recognition results to the communication protocol processing module for processing. If the match fails or the protocol type cannot be determined, a default unknown protocol type or error prompt is output.

[0085] Step 4: Update the protocol feature library (automatic crawling mechanism): Due to the continuous evolution and update of communication protocols, the protocol feature library needs to be updated regularly to ensure the accuracy and real-time performance of recognition. The present invention designs an automatic crawling update mechanism to regularly obtain the latest protocol feature information from the authoritative protocol standard library or the protocol manufacturer's website and update it to the local feature library.

[0086] A preferred implementation is to use Python language, combined with requests (for sending HTTP requests), BeautifulSoup (for parsing HTML documents) and schedule (for setting scheduled tasks) libraries to implement regular collection and update of communication protocol feature information, specifically including the following steps:

[0087] Step 401, define and initialize a list URLS containing target URLs, where the URLs include authoritative standard protocol libraries and protocol vendor website links, such as IETF (Internet Engineering Task Force), IEEE (Institute of Electrical and Electronics Engineers), ISO (International Organization for Standardization), IEC (International Electrotechnical Commission), Modbus Organization, OPC Foundation, ZigbeeAlliance, etc.

[0088] Step 402: declare and implement the fetch_protocol_info(url) function, access the given URL through the requests library and issue an HTTP GET request to obtain response information.

[0089] Step 403: declare and implement the parse_protocol_page(html_content) function, parse the HTML response body through the BeatifulSoup library and extract target information, such as parameters such as protocol header features.

[0090] Step 404: declare and implement the save_protocol_info(protocols) function, and store the protocol extracted in step 403 and its corresponding header feature value into the local file protocols.json.

[0091] Step 405: declare and implement the update_protocols() function, which traverses the URLS list and calls the fetch_protocol_info(url), parse_protocol_page(html_content) and parse_protocol_page(html_content) interfaces one by one to complete the feature value update operation of the entire protocol list.

[0092] Step 406: Start the main loop. In the main loop, call the schedule library to set the scheduled task, for example:

[0093] schedule.every().day.at("00:00").do(update_protocols)

[0094] This statement means that the update_protocols interface is called once at 0:00 a.m. every day to update the characteristic values ​​of the protocol list. At the same time, the schedule.run_pending() function is repeatedly executed in the loop body to check the triggering of the scheduled task in real time.

[0095] 3) Dynamic configuration module: used to dynamically configure system parameters and priority strategies, and realize adaptive adjustment and optimization of system parameters according to external environment and user needs.

[0096] Specifically, the implementation of the dynamic configuration module includes the following steps:

[0097] Step 1: Determine the configuration items: First, determine the configuration items that need to be prioritized. These configuration items include communication protocol parameters, data processing rules, network connection settings, etc.

[0098] Step 2: Priority definition: Define the priority range for each configuration item. Priorities can be divided into multiple levels, such as high, medium, and low. For each level, clarify its priority order, that is, high-level configuration items have higher priority than low-level configuration items.

[0099] Step 3: Priority adjustment strategy: Automatically adjust the priority of configuration items based on factors such as system load, network conditions, and user needs. For example, when network bandwidth is limited, the priority of data processing rules can be lowered to ensure the stability of the communication protocol. Administrators or users can also be allowed to manually adjust the priority of configuration items to cope with temporary special circumstances or changes in demand.

[0100] Step 4: Persistence of configuration items: Ensure that the priority settings of configuration items can be persisted to prevent loss of priority settings when the system is restarted or the configuration file is lost. Save the priority settings to a configuration file, database, or other persistent storage medium, and load and apply them when the system starts.

[0101] 4) Control logic module: used to implement the control logic and functions of the system, including data processing, communication control, error handling and other functions.

[0102] Specifically, the implementation of the control logic module includes the following steps:

[0103] Step 1: Functional division: Divide the control logic module into multiple sub-modules including a data processing sub-module, a communication control sub-module, and an error handling sub-module. Each sub-module is responsible for implementing a specific control function.

[0104] Step 2, data processing submodule implementation: The data processing submodule is responsible for processing and parsing the received data. According to the recognition result of the protocol recognition module, the data is distributed to the corresponding data processing submodule for processing. The data processing submodule can be designed according to specific business needs, such as data parsing, data conversion, data storage, etc.

[0105] Step 3, communication control submodule implementation: The communication control submodule is responsible for managing and controlling the communication with external devices. According to the configuration information of the dynamic configuration module, it establishes a communication connection with the external device and monitors the communication status in real time. The communication mode supports serial communication, network communication, etc., and provides a unified interface for the data processing module to use.

[0106] Step 4: Implementation of the error handling submodule: The error handling submodule is responsible for monitoring errors and abnormal conditions during system operation, and handling and recovering according to predefined strategies. It implements functions such as error logging, alarm notification, and automatic restart to ensure the stability and reliability of the system.

Claims

1. An intelligent gateway system, It is characterized in that It includes a communication protocol processing module, a protocol identification module, a dynamic configuration module and a control logic module, wherein: The communication protocol processing module is used to process the received data packets and distribute the data packets to the corresponding data processing submodules in the control logic module for processing according to the identification results of the protocol identification module. Its implementation includes the following steps: Step 101, implement a universal data interface layer: design a universal data interface layer to unify the data formats of different protocols. The data interface layer defines a universal data structure and operation method, so that the control logic module can uniformly process data of various protocols; Step 102, implement the protocol adapter layer: on the data interface layer designed in step 101, design the protocol adapter layer, each protocol adapter module in the protocol adapter layer is responsible for converting the data of a specific protocol into the data format defined by the data interface layer, and encapsulating it into a unified data packet for transmission; Step 103, implement the protocol manager: design a protocol manager for managing and scheduling various protocol adapter modules. The protocol manager is responsible for dynamically loading and unloading various protocol adapter modules as needed, and distributing the received data to the corresponding protocol adapter modules for processing; the protocol manager is also used to maintain the status information of each protocol adapter module and dynamically adjust the working status of the protocol adapter module; Step 104, implement protocol extensibility design: design the communication protocol parser as an independent protocol parser plug-in, each protocol parser plug-in corresponds to a specific communication protocol, and when the system is running, the required protocol parser plug-in is obtained from the predefined plug-in directory or the cloud through the dynamic loading function, and dynamically loaded into the memory, and the loaded protocol parser plug-in interacts with other modules of the system to implement parsing and processing of data packets; each protocol adapter module implements a standard plug-in interface, and the user writes a customized protocol parser plug-in as needed and loads it into the system for use; The protocol identification module is used to identify the communication protocol used by the data packet, based on the protocol-specific start identifier, to determine the communication protocol type of the data packet; The dynamic configuration module is used to dynamically configure system parameters and priority strategies, and realize adaptive adjustment and optimization of system parameters according to the external environment and user needs; The control logic module is used to implement the control logic and functions of the system, including a data processing submodule, a communication control submodule and an error handling submodule.

2. An intelligent gateway system as claimed in claim 1, It is characterized in that In step 102, each of the protocol adapter modules implements a standard interface, including data parsing and encapsulation methods, to achieve rapid adaptation and expansion of new protocols.

3. An intelligent gateway system as claimed in claim 1, It is characterized in that In step 104, the management of the protocol parser plug-in is implemented through the plug-in management module, and the implementation scheme covers the directory structure, interface specification, custom plug-in module loader and plug-in manager of the protocol parser plug-in: In the plug-in management module, all protocol parser plug-ins are stored in a predefined plug-in directory. Each protocol parser plug-in is an independent module. Each protocol parser plug-in defines a standard interface, which all protocol parser plug-ins must implement. Customize the plugin module loader to support searching for the specified protocol parser plugin module from the plugin directory; call the create_module(spec) function to create and initialize the module object; support calling exec_module(spec) to execute the protocol logic in the protocol parser plugin; A custom plug-in manager is responsible for managing the dynamically running protocol parser plug-in instance object pool.

4. An intelligent gateway system as claimed in claim 1, It is characterized in that The implementation of the protocol identification module includes the following steps: Step 201, feature extraction: extract the start identifier by reading the first few bytes of the data packet to obtain the feature, and extract the protocol type information by parsing the header field of the data packet; Step 202, feature matching: a feature library is established for each communication protocol through string matching and regular expression matching methods, which contains feature information of the communication protocol. After receiving the data packet, the features extracted in step 201 are matched with the features in the feature library to determine the protocol type used by the data packet and obtain the feature matching result; Step 203, outputting the recognition result: according to the feature matching result, the communication protocol used by the data packet is determined, and the recognition result is output to the communication protocol processing module for processing. If the match fails or the protocol type cannot be determined, a default unknown protocol type or an error prompt is output; Step 204, protocol feature library update: adopt an automatic crawling update mechanism to regularly obtain the latest protocol feature information from the protocol standard library or the protocol manufacturer's website, and update it to the local feature library.

5. An intelligent gateway system as claimed in claim 4, It is characterized in that In step 204, the following steps are used to implement regular collection and update of the communication protocol feature information in the feature library: Step 2041, define and initialize a list URLS containing target URLs, where the URLs include authoritative standard protocol libraries and protocol vendor website links; Step 2042: declare and implement the fetch_protocol_info(url) function, access the given URL through the requests library and issue an HTTP GET request to obtain response information; Step 2043: declare and implement the parse_protocol_page(html_content) function, parse the HTML response body and extract the target information through the BeatifulSoup library; Step 2044: declare and implement the save_protocol_info(protocols) function, and store the protocol extracted in step 2043 and its corresponding header feature value into the local file protocols.json; Step 2045, declare and implement the update_protocols() function, which is used to traverse the URLS list and call the fetch_protocol_info(url), parse_protocol_page(html_content) and parse_protocol_page(html_content) interfaces one by one to complete the feature value update operation of the entire protocol list; Step 2046, start the main loop, and in the main loop, call the schedule library to set the scheduled task.

6. An intelligent gateway system as claimed in claim 1, It is characterized in that The implementation of the dynamic configuration module includes the following steps: Step 301, determine configuration items: determine configuration items that need to be prioritized; Step 302: Priority definition: define the priority range of each configuration item, and for each level, clarify its priority order; Step 303: Priority adjustment strategy: automatically adjust the priority of the configuration item, or allow the administrator or user to manually adjust the priority of the configuration item to cope with temporary special circumstances or demand changes; Step 304, configuration item persistence: ensure that the priority setting of the configuration item can be persisted, save the priority setting to a persistent storage medium, and load and apply it when the system starts.

7. An intelligent gateway system as claimed in claim 1, It is characterized in that The data processing submodule is responsible for processing and parsing the received data: according to the identification result of the protocol identification module, the data is distributed to the corresponding data processing submodule for processing, and the data processing submodule is designed according to specific business requirements.

8. An intelligent gateway system as claimed in claim 1, It is characterized in that The communication control submodule is used to manage and control the communication with the external device: according to the configuration information of the dynamic configuration module, establish the communication connection with the external device and monitor the communication status in real time.

9. An intelligent gateway system as claimed in claim 1, It is characterized in that The error handling submodule is used to monitor errors and abnormal conditions during system operation, and to handle and recover them according to predefined strategies.

Citation Information

Cited By

  • Peripheral adaptation system based on dynamic plug-in loading mechanism

    CN119396496A

  • Unified control system and method supporting multiple industrial control protocols, and medium

    CN119556659A

  • Ship communication method and system based on message bus

    CN119814819A

  • Internet of Things protocol management scheme supporting hot plug extension

    CN120075103A

  • Intelligent terminal multi-protocol adaptive communication system

    CN122204977A