Multi-device heterogeneous protocol operation method and system based on Internet of Things platform
Through the combination of protocol parsing engine, dynamic object model library and rule mapping engine, the problem of protocol heterogeneous and static object model configuration in the Internet of Things platform is solved, flexible communication and efficient interoperability between devices are achieved, and the scalability and maintainability of the system are improved.
Patent Information
- Application Number
- CN202510698158.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-26
AI Technical Summary
IoT platforms face problems with protocol heterogeneity, increased complexity caused by static object model configuration, and poor interoperability between devices. The existing solutions have defects such as solidification of protocol adaptation logic and inability to dynamically load new protocol resolvers.
The protocol analysis engine is used for dynamic analysis, a dynamic material model library and rule mapping engine is built, and the plug-in architecture is realized through the Java SPI mechanism, and multi-version material model and Groovy scripted rule mapping is supported, so as to realize the two-way conversion of device protocol and material model layer information and data interoperability.
It realizes flexible expansion and interoperability of communication protocols between IoT devices and platforms, improves development efficiency, reduces operation and maintenance costs, supports dynamic access of multiple devices and multiple protocols, improves the scalability and maintainability of the system, and simplifies the configuration process of the object model.
Smart Images

Figure CN120547251A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things device management, and in particular to an operating method and system for a multi-device heterogeneous protocol based on an Internet of Things platform. Background Art
[0002] With the rapid development of IoT technology, the types of devices connected to the platform are becoming more diverse, covering different fields such as industrial sensors, smart home devices, and in-vehicle terminals. These devices often use proprietary protocols or some standard protocols (such as MQTT, CoAP, Modbus, HTTP, etc.), resulting in the following challenges when the platform communicates with these devices: 1. Protocol heterogeneity: Devices from different manufacturers vary in protocol formats and data encoding methods (e.g., binary, JSON, and XML). In addition to structural encoding differences, devices may choose transmission protocols based on different network characteristics (e.g., CoAP or LoRa for low-power devices, MQTT for high-reliability scenarios). Furthermore, device manufacturers' differing encryption strategies lead to fragmented security mechanisms.
[0003] 2. Static object model configuration: The IoT platform pre-configures object models for a limited number of device types. Device attributes, commands, and events are defined through object model configuration. Static object model configuration requires maintaining independent parsing code for each device model. As device protocols change with firmware upgrades, the number of supported protocol versions increases, significantly increasing system complexity and leading to a "protocol adaptation explosion" problem.
[0004] 3. Point-to-Point Adapters: A separate communication module must be developed for each device, resulting in low code reuse and inefficient platform iteration. Developers must implement modules for uplink data parsing and downlink command generation for each device type, leading to issues such as unpredictable code quality and response delays. Existing IoT platforms typically address heterogeneity by using "protocol conversion middleware" or "device SDK components," but these platforms suffer from rigid protocol adaptation logic, an inability to dynamically load new protocol parsers, and poor interoperability between devices. Summary of the Invention
[0005] In view of this, the object of the present invention is to provide a method and system for operating a multi-device heterogeneous protocol based on an Internet of Things platform to solve the problems pointed out in the above background technology.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is: The method for operating a multi-device heterogeneous protocol based on an Internet of Things platform includes the following steps: S1. Dynamically parse heterogeneous protocols through a protocol parsing engine, which includes an uplink protocol decoder and a downlink protocol encoder to achieve bidirectional conversion between device protocols and object model layer information; S2. Build a dynamic object model library that supports version management and dynamically binds the appropriate object model based on the device model and protocol version. S3. Use the rule mapping engine to map the intermediate data after protocol parsing to the attributes, services and events of the object model through scripted rules to achieve data interoperability between heterogeneous devices.
[0007] Furthermore, the protocol parsing engine is implemented based on the Java SPI mechanism, specifically including: Define unified interface abstract protocol encoding and decoding operations, including connection, message receiving, message sending, decoding and encoding methods; Write implementation classes for different protocols and encapsulate them as plug-ins, and dynamically load protocol parsing components through ServiceLoader.
[0008] Furthermore, the uplink protocol decoder in step S1 is used to decode MQTT, CoAP or HTTP protocol data into intermediate information, and the downlink protocol encoder is used to encode the object model instruction into device-specific protocol data.
[0009] Furthermore, the construction of the dynamic object model library includes: Maintain multiple versions of object models for similar devices and support dynamic expansion and version updates of object models; Dynamically bind the device model to the object model version based on the device functional requirements.
[0010] Furthermore, the rule mapping engine is implemented based on Groovy scripts, specifically including: Define attribute mapping, service mapping, and event mapping logic through Groovy scripts; Use GroovyClassLoader to dynamically load scripts and compile them into executable classes, supporting real-time updates of scripts.
[0011] Furthermore, the rule mapping engine performs attribute mapping and event mapping when uplinking data, and performs service mapping when downlinking instructions.
[0012] Furthermore, it also includes the hot update steps of the protocol plug-in: Dynamically load or unload protocol parsing plug-ins without interrupting system operation.
[0013] Furthermore, the object model is bound to the device protocol version and automatically matches the latest object model version when the device protocol is updated.
[0014] A multi-device heterogeneous protocol operating system based on an Internet of Things platform includes a processor and a memory, wherein the memory stores a program or instruction. When the program or instruction is executed by the processor, the following steps are implemented: S1. Dynamically parse heterogeneous protocols through a protocol parsing engine, which includes an uplink protocol decoder and a downlink protocol encoder to achieve bidirectional conversion between device protocols and object model layer information; S2. Build a dynamic object model library that supports version management and dynamically binds the appropriate object model based on the device model and protocol version. S3. Use the rule mapping engine to map the intermediate data after protocol parsing to the attributes, services and events of the object model through scripted rules to achieve data interoperability between heterogeneous devices.
[0015] The beneficial effects of the present invention are: The present invention provides a method and system for operating heterogeneous protocols across multiple devices on an Internet of Things (IoT) platform. This system dynamically parses heterogeneous protocols using a protocol parsing engine, which includes an upstream protocol decoder and a downstream protocol encoder, enabling bidirectional conversion between device protocols and object model layer information. A dynamic object model library is constructed, which supports versioning and dynamically binds adapted object models based on device models and protocol versions. A rule mapping engine uses scripted rules to map intermediate data from protocol parsing to object model attributes, services, and events, enabling data interoperability between heterogeneous devices. By constructing a parsing and adaptation framework comprised of a "protocol parsing engine + dynamic object model library + rule mapping engine," this system enables flexible expansion and interoperability of communication protocols between IoT devices and the platform, improving development efficiency and reducing operation and maintenance costs. It supports dynamic access to multiple devices and multiple protocols, lowering the barrier to entry. A plug-in architecture enables dynamic loading, unloading, and hot updates of protocol parsing, improving system scalability and maintainability. The dynamic object model library supports versioning and dynamically binds adapted object models based on different device models and functional requirements. This simplifies the physical model configuration process and eliminates the "protocol adaptation explosion" problem associated with static physical model configuration. The rule mapping engine uses Groovy scripts to implement bidirectional data conversion between heterogeneous protocols and physical models, opening up data exchange links between multi-protocol devices and improving inter-device collaboration. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Shown is a flowchart of the steps of the method for operating a multi-device heterogeneous protocol based on an Internet of Things platform of the present invention; Figure 2 FIG2 is a block diagram of a system for operating a multi-device heterogeneous protocol based on an Internet of Things platform according to the present invention; Figure 3 Shown is a schematic diagram of the system architecture of the heterogeneous protocol dynamic configuration and parsing of the present invention; Figure 4 Shown is a diagram of the dynamic object model configuration process of the present invention; Figure 5 The figure shows the overall flow chart of the dynamic parsing and interoperation of heterogeneous protocols of the present invention; Description of Figure Numbers: 1-Processor; 2-Memory. DETAILED DESCRIPTION
[0017] The present invention will be further described below with reference to the accompanying drawings and specific embodiments: like Figure 1 As shown, the method for operating a multi-device heterogeneous protocol based on an Internet of Things platform provided by the present invention includes the following steps: S1. Dynamically parse heterogeneous protocols through a protocol parsing engine, which includes an uplink protocol decoder and a downlink protocol encoder to achieve bidirectional conversion between device protocols and object model layer information; S2. Build a dynamic object model library that supports version management and dynamically binds the appropriate object model based on the device model and protocol version. S3. Use the rule mapping engine to map the intermediate data after protocol parsing to the attributes, services and events of the object model through scripted rules to achieve data interoperability between heterogeneous devices.
[0018] From the above description, it can be seen that the present invention has the following beneficial effects: The present invention provides a method for operating heterogeneous protocols across multiple devices on an Internet of Things (IoT) platform. This method dynamically parses heterogeneous protocols using a protocol parsing engine, which includes an upstream protocol decoder and a downstream protocol encoder, enabling bidirectional conversion between device protocols and object model layer information. A dynamic object model library is constructed, which supports versioning and dynamically binds adapted object models based on device models and protocol versions. A rule mapping engine uses scripted rules to map intermediate data from protocol parsing to object model attributes, services, and events, enabling data interoperability between heterogeneous devices. By constructing a parsing and adaptation framework comprised of a "protocol parsing engine + dynamic object model library + rule mapping engine," this method enables flexible expansion and interoperability of communication protocols between IoT devices and the platform, improving development efficiency and reducing operation and maintenance costs. It supports dynamic access to multiple devices and multiple protocols, lowering the barrier to entry. A plug-in architecture enables dynamic loading, unloading, and hot updates of protocol parsing, improving system scalability and maintainability. The dynamic object model library supports versioning and dynamically binds adapted object models based on different device models and functional requirements. This simplifies the physical model configuration process and eliminates the "protocol adaptation explosion" problem associated with static physical model configuration. The rule mapping engine uses Groovy scripts to implement bidirectional data conversion between heterogeneous protocols and physical models, opening up data exchange links between multi-protocol devices and improving inter-device collaboration.
[0019] Furthermore, the protocol parsing engine is implemented based on the Java SPI mechanism, specifically including: Define unified interface abstract protocol encoding and decoding operations, including connection, message receiving, message sending, decoding and encoding methods; Write implementation classes for different protocols and encapsulate them as plug-ins, and dynamically load protocol parsing components through ServiceLoader.
[0020] From the above description, we can see that through such encapsulation, at the implementation level, we only need to call a unified interface without having to worry about the parsing details of the underlying protocol.
[0021] Furthermore, the uplink protocol decoder in step S1 is used to decode MQTT, CoAP or HTTP protocol data into intermediate information, and the downlink protocol encoder is used to encode the object model instruction into device-specific protocol data.
[0022] From the above description, it can be seen that the protocol parsing engine is composed of an uplink protocol decoder and a downlink protocol encoder.
[0023] Furthermore, the construction of the dynamic object model library includes: Maintain multiple versions of object models for similar devices and support dynamic expansion and version updates of object models; Dynamically bind the device model to the object model version based on the device functional requirements.
[0024] As can be seen from the above description, managing different versions ensures the flexibility and scalability of object models for this type of product, allowing object models to be updated based on different product requirements and functions. When a new product model (such as a smart access control system) needs to be integrated into the system, the corresponding object model version can be found in the standard model library. Through a dynamic binding mechanism, the smart access control system is bound to the object model version that best suits its functionality. As the object model version in the standard model library is updated, the dynamic binding module can flexibly adjust the binding relationship with each product model, ensuring that the product always uses the latest and most appropriate object model version.
[0025] Furthermore, the rule mapping engine is implemented based on Groovy scripts, specifically including: Define attribute mapping, service mapping, and event mapping logic through Groovy scripts; Use GroovyClassLoader to dynamically load scripts and compile them into executable classes, supporting real-time updates of scripts.
[0026] From the above description, it can be seen that the rule mapping engine setting is implemented.
[0027] Furthermore, the rule mapping engine performs attribute mapping and event mapping when uplinking data, and performs service mapping when downlinking instructions.
[0028] From the above description, it can be seen that regular mapping of bidirectional data of devices is achieved.
[0029] Furthermore, it also includes the hot update steps of the protocol plug-in: Dynamically load or unload protocol parsing plug-ins without interrupting system operation.
[0030] From the above description, it can be seen that the hot update of the protocol plug-in is achieved through the above steps.
[0031] Furthermore, the object model is bound to the device protocol version and automatically matches the latest object model version when the device protocol is updated.
[0032] From the above description, it can be seen that when the device protocol is updated, the latest object model version is automatically matched.
[0033] See Figure 2 The present invention also provides an operating system for a multi-device heterogeneous protocol based on an Internet of Things platform, comprising a processor 1 and a memory 2, wherein the memory 2 stores a program or instruction, and when the program or instruction is executed by the processor 1, the following steps are implemented: S1. Dynamically parse heterogeneous protocols through a protocol parsing engine, which includes an uplink protocol decoder and a downlink protocol encoder to achieve bidirectional conversion between device protocols and object model layer information; S2. Build a dynamic object model library that supports version management and dynamically binds the appropriate object model based on the device model and protocol version. S3. Use the rule mapping engine to map the intermediate data after protocol parsing to the attributes, services and events of the object model through scripted rules to achieve data interoperability between heterogeneous devices.
[0034] From the above description, it can be seen that the present invention has the following beneficial effects: The present invention provides a multi-device heterogeneous protocol operation system based on an Internet of Things (IoT) platform. This system dynamically parses heterogeneous protocols using a protocol parsing engine, which includes an upstream protocol decoder and a downstream protocol encoder, enabling bidirectional conversion between device protocols and object model layer information. A dynamic object model library is constructed, which supports versioning and dynamically binds adapted object models based on device models and protocol versions. A rule mapping engine uses scripted rules to map intermediate data after protocol parsing to object model attributes, services, and events, enabling data interoperability between heterogeneous devices. By constructing a parsing and adaptation framework comprised of a "protocol parsing engine + dynamic object model library + rule mapping engine," this system enables flexible expansion and interoperability of communication protocols between IoT devices and the platform, improving development efficiency and reducing operation and maintenance costs. It supports dynamic access to multiple devices and multiple protocols, lowering the barrier to entry. A plug-in architecture enables dynamic loading, unloading, and hot updates of protocol parsing, improving system scalability and maintainability. The dynamic object model library supports versioning and dynamically binds adapted object models based on different device models and functional requirements. This simplifies the physical model configuration process and eliminates the "protocol adaptation explosion" problem associated with static physical model configuration. The rule mapping engine uses Groovy scripts to implement bidirectional data conversion between heterogeneous protocols and physical models, opening up data exchange links between multi-protocol devices and improving inter-device collaboration.
[0035] When the program or instruction is executed by the processor 1, the following steps are implemented: the protocol parsing engine is implemented based on the Java SPI mechanism, specifically including: Define unified interface abstract protocol encoding and decoding operations, including connection, message receiving, message sending, decoding and encoding methods; Write implementation classes for different protocols and encapsulate them as plug-ins, and dynamically load protocol parsing components through ServiceLoader.
[0036] From the above description, we can see that through such encapsulation, at the implementation level, we only need to call a unified interface without having to worry about the parsing details of the underlying protocol.
[0037] When the program or instruction is executed by the processor 1, the following steps are implemented: in step S1, the uplink protocol decoder is used to decode MQTT, CoAP or HTTP protocol data into intermediate information, and the downlink protocol encoder is used to encode the object model instruction into device-specific protocol data.
[0038] From the above description, it can be seen that the protocol parsing engine is composed of an uplink protocol decoder and a downlink protocol encoder.
[0039] When the program or instruction is executed by the processor 1, the following steps are implemented: the construction of the dynamic object model library includes: Maintain multiple versions of object models for similar devices and support dynamic expansion and version updates of object models; Dynamically bind the device model to the object model version based on the device functional requirements.
[0040] As can be seen from the above description, managing different versions ensures the flexibility and scalability of object models for this type of product, allowing object models to be updated based on different product requirements and functions. When a new product model (such as a smart access control system) needs to be integrated into the system, the corresponding object model version can be found in the standard model library. Through a dynamic binding mechanism, the smart access control system is bound to the object model version that best suits its functionality. As the object model version in the standard model library is updated, the dynamic binding module can flexibly adjust the binding relationship with each product model, ensuring that the product always uses the latest and most appropriate object model version.
[0041] When the program or instruction is executed by the processor 1, the following steps are implemented: the rule mapping engine is implemented based on a Groovy script, specifically including: Define attribute mapping, service mapping, and event mapping logic through Groovy scripts; Use GroovyClassLoader to dynamically load scripts and compile them into executable classes, supporting real-time updates of scripts.
[0042] From the above description, it can be seen that the rule mapping engine setting is implemented.
[0043] When the program or instruction is executed by the processor 1, the following steps are implemented: the rule mapping engine performs attribute mapping and event mapping when uploading data, and performs service mapping when downloading instructions.
[0044] From the above description, it can be seen that regular mapping of bidirectional data of devices is achieved.
[0045] When the program or instruction is executed by the processor 1, the following steps are implemented: a hot update step of the protocol plug-in is also included: Dynamically load or unload protocol parsing plug-ins without interrupting system operation.
[0046] From the above description, it can be seen that the hot update of the protocol plug-in is achieved through the above steps.
[0047] When the program or instruction is executed by the processor 1 , the following steps are implemented: the object model is bound to the device protocol version, and automatically matches the latest object model version when the device protocol is updated.
[0048] From the above description, it can be seen that the latest physical model version is automatically matched when the device protocol is updated. The following lists several preferred embodiments or application examples to help those skilled in the art better understand the technical content of the present invention and the technical contribution made by the present invention relative to the prior art: Preferred embodiment one: In order to solve the problems of heterogeneous protocols, dynamic adaptation of object models, and cross-protocol device interoperability in the multi-device collaboration scenario of the Internet of Things, a three-in-one adaptation and parsing framework of "protocol parsing engine + dynamic object model library + rule mapping engine" is proposed.
[0049] Based on the Java SPI mechanism, heterogeneous protocol differences are shielded. The upstream decoder converts protocol data such as MQTT and CoAP into intermediate information, while the downstream encoder reverse-encodes object model instructions into device-specific protocols. Dynamically loading the SPI enables plug-in protocol expansion. A version management system for standardized object models is established, maintaining multiple versions of object models for similar devices. When new devices are connected, the object model is dynamically bound based on functional requirements. A rule mapping engine, based on Groovy dynamic scripting, is constructed to flexibly map information parsed from heterogeneous protocols to the attributes, services, and events represented by the device's object model, enabling dynamic adjustment of logic and intelligent device control.
[0050] It should be noted that: The protocol parsing engine, through a plug-in architecture, supports dynamic loading, unloading, and hot updates of protocol codecs. At the same time, it uses the Java SPI (Service Provider Interface) to unify the abstract interface at the software implementation level, shielding protocol differences and dynamically loading the implementation class of a specific protocol at runtime.
[0051] The Thing Model is a digital abstraction of a device on the platform. Compared to traditional Thing Models, which are mostly static, predefined templates, the Dynamic Thing Model is driven by metadata and extended by versioning, enabling flexible adaptation and supporting the dynamic addition and removal of device attributes and commands. Thing Models are also bound to device models and protocol versions, ensuring flexible adaptation to device changes and cross-vendor compatibility.
[0052] The rule mapping engine is designed to enable bidirectional conversion between heterogeneous device data formats and platform device object models. It implements dynamic data flow through declarative rules and scripted extensions, supporting complex logic such as conditional branching and function calls.
[0053] like Figure 1 as well as Figures 3 to 5 As shown, the method for operating a multi-device heterogeneous protocol based on an Internet of Things platform provided by the present invention includes the following steps: S1. Dynamically parse heterogeneous protocols through a protocol parsing engine, which includes an uplink protocol decoder and a downlink protocol encoder to achieve bidirectional conversion between device protocols and object model layer information; In this embodiment, the protocol parsing engine is implemented based on the Java SPI mechanism, specifically including: Define unified interface abstract protocol encoding and decoding operations, including connection, message receiving, message sending, decoding and encoding methods; Write implementation classes for different protocols and encapsulate them as plug-ins, and dynamically load protocol parsing components through ServiceLoader.
[0054] In step S1 , the uplink protocol decoder is used to decode MQTT, CoAP or HTTP protocol data into intermediate information, and the downlink protocol encoder is used to encode object model instructions into device-specific protocol data.
[0055] Specifically, in this embodiment, to address the problem of protocol heterogeneity, the protocol parsing engine includes two parts: an uplink protocol decoder and a downlink protocol encoder.
[0056] Uplink protocol decoder: Responsible for decoding the protocols (such as MQTT protocol, CoAP protocol, etc.) sent by different devices and converting them into information that can be understood by the object model layer.
[0057] Downlink protocol encoder: Responsible for encoding the information generated by the object model layer into a device-specific protocol so that the information can be sent to different devices.
[0058] In the implementation of the protocol parsing engine, the Java SPI (Service Provider Interface) unified abstract interface is used to shield the core process of protocol differentiation.
[0059] Define a unified interface, abstract the operations of the protocol, and declare methods common to all protocols, including the connect method, the receive method, the send method, the decoder, and the encoder.
[0060] Write implementation classes for different protocols (e.g., MQTT, CoAP, Http), with each class implementing the common methods of the protocol. Package the implementation Java classes into a jar and submit it to the platform server.
[0061] Implement dynamic loading of protocols at runtime, dynamically scan and load the implementation list of protocol parsing operations through ServiceLoader, and select the corresponding parsing implementation based on the connected device or context.
[0062] Through such encapsulation, at the implementation level, you only need to call a unified interface without having to worry about the parsing details of the underlying protocol.
[0063] S2. Build a dynamic object model library that supports version management and dynamically binds the appropriate object model based on the device model and protocol version. The construction of the dynamic object model library includes: Maintain multiple versions of object models for similar devices and support dynamic expansion and version updates of object models; Dynamically bind the device model to the object model version based on the device functional requirements.
[0064] Specifically, the implementation process of the dynamic object model mainly includes the following aspects: 1. Version management of standard model library The standard model library enables unified management of object models for similar products of different manufacturers and models, including their different versions. For example, access control devices may include standalone access control versions, versions with intercom, and other versions. Managing different versions ensures the flexibility and scalability of object models for these products, allowing object models to be updated based on different product requirements and functions.
[0065] 2. Dynamic binding of object models to specific product models When a new product model (such as a smart access control system) needs to be integrated into the system, the corresponding object model version can be found in the standard model library. Through a dynamic binding mechanism, the smart access control system is bound to the object model version that best suits its functionality. For example, if a smart access control system has an intercom function, the "Intercom Version" access control object model should be selected. After dynamic binding, the relevant functions in the object model, such as the door control service and credential service, are automatically adapted to the product model, achieving seamless functional integration.
[0066] 3. Object model expansion and maintenance When the object model version in the standard model library is updated, the dynamic binding module can flexibly adjust the binding relationship with each product model to ensure that the product always uses the latest and most suitable object model version.
[0067] S3. Use the rule mapping engine to map the intermediate data after protocol parsing to the attributes, services and events of the object model through scripted rules to achieve data interoperability between heterogeneous devices.
[0068] The rule mapping engine is implemented based on Groovy scripts, specifically including: Define attribute mapping, service mapping, and event mapping logic through Groovy scripts; Use GroovyClassLoader to dynamically load scripts and compile them into executable classes, supporting real-time updates of scripts.
[0069] In addition, the rule mapping engine performs attribute mapping and event mapping when uplinking data, and performs service mapping when downlinking instructions.
[0070] Specifically, the conversion logic of IoT device message data is defined through Groovy scripts, and the intermediate data obtained by the protocol parsing engine is dynamically mapped to the attributes, services, and events of the object model.
[0071] Attribute mapping: extract data and assign values to object model attributes.
[0072] Service mapping: Generates device control commands based on platform instruction logic.
[0073] Event mapping: Determine the event type of intermediate data, extract the data and assign it to the object model event record.
[0074] The Groovy language scripts are stored in the platform database, supporting real-time updates of Groovy scripts. The platform dynamically loads the scripts through GroovyClassLoader and compiles them into executable classes.
[0075] Bidirectional device data mapping rules: When transmitting data upstream, the Groovy rule engine maps the intermediate information after protocol parsing to the object model's attributes and events for platform services. When transmitting instructions downstream, the Groovy rule engine converts the service commands in the object model into device-specific instructions, which are then converted into the device's corresponding protocol requests via the protocol encoder.
[0076] The above steps also include the hot update steps of the protocol plug-in: Dynamically load or unload protocol parsing plug-ins without interrupting system operation.
[0077] Furthermore, the object model is bound to the device protocol version, automatically matching the latest object model version when the device protocol is updated. By building a parsing and adaptation framework consisting of a "protocol parsing engine + dynamic object model library + rule mapping engine," this technical solution enables flexible expansion and interoperability of communication protocols between IoT devices and platforms, improving development efficiency and reducing operation and maintenance costs.
[0078] It supports dynamic access to multiple devices and multiple protocols, lowering the access threshold. Through a plug-in architecture, it enables dynamic loading, unloading, and hot updates of protocol parsing, improving the scalability and maintainability of the system.
[0079] The dynamic object model library supports versioning and can dynamically bind adapted object models based on different device models and functional requirements. This simplifies the object model configuration process and eliminates the "protocol adaptation explosion" problem caused by static object model configuration.
[0080] The rule mapping engine uses Groovy scripts to implement bidirectional data conversion between heterogeneous protocols and object models, opening up data interaction links between multi-protocol devices and improving the collaborative working capabilities between devices.
[0081] Preferred embodiment 2: See Figures 2 to 5 The present invention also provides an operating system for a multi-device heterogeneous protocol based on an Internet of Things platform, comprising a processor 1 and a memory 2, wherein the memory 2 stores a program or instruction, and when the program or instruction is executed by the processor 1, the following steps are implemented: S1. Dynamically parse heterogeneous protocols through a protocol parsing engine, which includes an uplink protocol decoder and a downlink protocol encoder to achieve bidirectional conversion between device protocols and object model layer information; S2. Build a dynamic object model library that supports version management and dynamically binds the appropriate object model based on the device model and protocol version. S3. Use the rule mapping engine to map the intermediate data after protocol parsing to the attributes, services and events of the object model through scripted rules to achieve data interoperability between heterogeneous devices.
[0082] When the program or instruction is executed by the processor 1, the following steps are implemented: the protocol parsing engine is implemented based on the Java SPI mechanism, specifically including: Define unified interface abstract protocol encoding and decoding operations, including connection, message receiving, message sending, decoding and encoding methods; Write implementation classes for different protocols and encapsulate them as plug-ins, and dynamically load protocol parsing components through ServiceLoader.
[0083] When the program or instruction is executed by the processor 1, the following steps are implemented: in step S1, the uplink protocol decoder is used to decode MQTT, CoAP or HTTP protocol data into intermediate information, and the downlink protocol encoder is used to encode the object model instruction into device-specific protocol data.
[0084] When the program or instruction is executed by the processor 1, the following steps are implemented: the construction of the dynamic object model library includes: Maintain multiple versions of object models for similar devices and support dynamic expansion and version updates of object models; Dynamically bind the device model to the object model version based on the device functional requirements.
[0085] When the program or instruction is executed by the processor 1, the following steps are implemented: the rule mapping engine is implemented based on a Groovy script, specifically including: Define attribute mapping, service mapping, and event mapping logic through Groovy scripts; Use GroovyClassLoader to dynamically load scripts and compile them into executable classes, supporting real-time updates of scripts.
[0086] When the program or instruction is executed by the processor 1, the following steps are implemented: the rule mapping engine performs attribute mapping and event mapping when uploading data, and performs service mapping when downloading instructions.
[0087] When the program or instruction is executed by the processor 1, the following steps are implemented: a hot update step of the protocol plug-in is also included: Dynamically load or unload protocol parsing plug-ins without interrupting system operation.
[0088] When the program or instruction is executed by the processor 1 , the following steps are implemented: the object model is bound to the device protocol version, and automatically matches the latest object model version when the device protocol is updated.
[0089] The present invention has been described with reference to the above embodiments and accompanying drawings. However, the above embodiments are merely exemplary embodiments of the present invention. It should be noted that the disclosed embodiments do not limit the scope of the present invention. On the contrary, modifications and equivalents falling within the spirit and scope of the claims are intended to be within the scope of the present invention.
Claims
1. A method for operating a multi-device heterogeneous protocol based on an Internet of Things platform, characterized in that: The following steps are involved: S1. Dynamically parse heterogeneous protocols through a protocol parsing engine, which includes an uplink protocol decoder and a downlink protocol encoder to achieve bidirectional conversion between device protocols and object model layer information; S2. Build a dynamic object model library that supports version management and dynamically binds the appropriate object model based on the device model and protocol version. S3. Use the rule mapping engine to map the intermediate data after protocol parsing to the attributes, services and events of the object model through scripted rules to achieve data interoperability between heterogeneous devices.
2. The method for operating a multi-device heterogeneous protocol based on an Internet of Things platform according to claim 1, characterized in that: The protocol parsing engine is implemented based on the Java SPI mechanism, specifically including: Define unified interface abstract protocol encoding and decoding operations, including connection, message receiving, message sending, decoding and encoding methods; Write implementation classes for different protocols and encapsulate them as plug-ins, and dynamically load protocol parsing components through ServiceLoader.
3. The method for operating a multi-device heterogeneous protocol based on an Internet of Things platform according to claim 1, characterized in that: In step S1 , the uplink protocol decoder is used to decode MQTT, CoAP or HTTP protocol data into intermediate information, and the downlink protocol encoder is used to encode object model instructions into device-specific protocol data.
4. The method for operating a multi-device heterogeneous protocol based on an Internet of Things platform according to claim 1, characterized in that: The construction of the dynamic object model library includes: Maintain multiple versions of object models for similar devices and support dynamic expansion and version updates of object models; Dynamically bind the device model to the object model version based on the device functional requirements.
5. The method for operating a multi-device heterogeneous protocol based on an Internet of Things platform according to claim 1, characterized in that: The rule mapping engine is implemented based on Groovy scripts, specifically including: Define attribute mapping, service mapping, and event mapping logic through Groovy scripts; Use GroovyClassLoader to dynamically load scripts and compile them into executable classes, supporting real-time updates of scripts.
6. The method for operating a multi-device heterogeneous protocol based on an Internet of Things platform according to claim 5, characterized in that: The rule mapping engine performs attribute mapping and event mapping when uploading data, and performs service mapping when downloading instructions.
7. The method for operating a multi-device heterogeneous protocol based on an Internet of Things platform according to claim 1, characterized in that: It also includes hot update steps for protocol plugins: Dynamically load or unload protocol parsing plug-ins without interrupting system operation.
8. The method for operating a multi-device heterogeneous protocol based on an Internet of Things platform according to claim 1, characterized in that: The object model is bound to the device protocol version and automatically matches the latest object model version when the device protocol is updated.
9. The operating system of multi-device heterogeneous protocols based on the Internet of Things platform is characterized by: The system comprises a processor and a memory, wherein the memory stores a program or instruction, and when the program or instruction is executed by the processor, the following steps are implemented: S1. Dynamically parse heterogeneous protocols through a protocol parsing engine, which includes an uplink protocol decoder and a downlink protocol encoder to achieve bidirectional conversion between device protocols and object model layer information; S2. Build a dynamic object model library that supports version management and dynamically binds the appropriate object model based on the device model and protocol version. S3. Use the rule mapping engine to map the intermediate data after protocol parsing to the attributes, services and events of the object model through scripted rules to achieve data interoperability between heterogeneous devices.
Citation Information
Cited By
System for protocol adaptation and unified access of multi-source heterogeneous industrial equipment
CN121691487A