An internet of things transparent transmission command automatic generation method, system, device and medium

By using metadata management and command template mechanisms, the cloud platform and device protocols are decoupled, user interfaces are dynamically generated, and abstract operation commands are constructed. This solves the problem of tight coupling between the cloud platform and the underlying device protocols, improves the system's scalability and maintenance efficiency, and achieves efficient and reliable command execution.

CN122226604APending Publication Date: 2026-06-16JIANGSU ANKEREI MICROGRID RES INST CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU ANKEREI MICROGRID RES INST CO LTD
Filing Date
2026-03-16
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

In existing IoT technologies, the cloud platform and the underlying device protocols are tightly coupled, resulting in high development costs, poor scalability, and an inability to fully utilize the edge computing capabilities of the gateway. Furthermore, protocol changes require modifications to the cloud platform code, which reduces the maintainability and flexibility of the system.

Method used

By adopting a metadata management and command template mechanism, the cloud platform defines a metadata set and generates command templates, dynamically generates a user interface, constructs abstract operation commands, and the gateway device parses and converts them into underlying instructions, thereby decoupling the cloud platform from the device protocol.

Benefits of technology

It reduces development costs, improves system scalability and maintenance efficiency, enhances command response speed and reliability, and supports automated interface generation and flexible adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122226604A_ABST
    Figure CN122226604A_ABST
Patent Text Reader

Abstract

The application discloses an Internet of Things (IoT) transparent command automatic generation method, system, device and medium, and aims to solve the problems of high development cost and high coupling degree caused by various device protocols of an existing platform. The method comprises the following steps: metadata management, defining metadata for a device, wherein the metadata comprises a parameter identifier, a register address, a data type and a read-write attribute; command template creation, selecting a plurality of parameter objects to be combined into a template and being associated with a unique identifier; dynamic interface generation, automatically generating an operation interface by a cloud platform according to the command template; abstract command construction, associating a command identifier with a user input value to generate an abstract command independent of a protocol; issuing and analyzing, after a gateway receives a command, searching for local metadata according to a parameter identifier, and converting the command into a bottom-layer instruction conforming to a device protocol; execution and feedback, sending an instruction to a device by the gateway and returning a result. The application realizes deep decoupling of a cloud platform and a protocol through metadata driving, and improves the system scalability and the automation level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT) technology, and specifically to a method, system, device, and medium for automatically generating IoT transparent transmission commands. Background Technology

[0002] With the rapid development and widespread application of IoT technology, a large number of smart devices from different manufacturers and models need to be connected to a unified cloud management platform to achieve centralized monitoring and remote control. In practical applications, the cloud platform needs to issue commands to the devices to complete various remote operations. However, existing technical solutions generally suffer from the following technical problems in practical applications: First, protocol adaptation is complex and development costs are high. IoT devices employ diverse underlying communication protocols, and even when using the same protocol, differences exist in register mapping and data parsing between devices. In the existing architecture, the cloud platform must handle the protocol processing logic. Whenever a new model or third-party device is connected, developers need to manually write code based on the device's technical manual to encapsulate binary messages conforming to specific protocol specifications, resulting in long development cycles and high costs.

[0003] Second, the system architecture suffers from high coupling and poor scalability. In existing technologies, cloud platforms often excessively bear the burden of parsing underlying communication protocols and assembling messages, failing to focus on business logic and data analysis, and neglecting to fully utilize the edge computing capabilities of gateways, resulting in an unbalanced situation of "heavy platform, light gateway." The tight coupling between cloud platforms and device protocols means that protocol changes require modification and redeployment of the cloud platform code, reducing system maintainability and flexibility.

[0004] Therefore, there is an urgent need for a new technical solution to decouple the cloud platform from the underlying device protocols and automatically generate device control commands, so as to reduce development costs and improve system maintainability and flexibility. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a method, system, device and medium for automatic generation of IoT transparent transmission commands based on register configuration.

[0006] To achieve the above objectives, the first aspect of the present invention adopts the following technical solution: A method for automatically generating IoT transparent transmission commands includes the following steps: S1. Metadata Management: On the cloud platform side, a set of metadata is defined and maintained for IoT devices, and a collection frequency is configured for at least one parameter object in the metadata set. The metadata set is generated based on the device's meter reading template or register address table and contains metadata for several parameter objects. The metadata includes parameter identifier, register address, data type, and read / write attributes. The metadata set supports dynamically adding new parameter objects according to device access requirements.

[0007] The parameter identifier is a name or code that uniquely identifies the parameter; the register address is the physical or logical address of the parameter object in the device's internal memory; the data type is the data format of the parameter value, including Boolean, integer, floating-point, and its bitmask or bit offset information; the read / write attribute is used to define the access permissions of the parameter object, including "read-only" and "read-write" attributes.

[0008] S2. Command Template Creation: In response to user operation, select metadata combinations of several parameter objects from the metadata set to construct a command template, and define a unique command identifier for the command template; Specifically, the command templates are divided into control command templates and query command templates for parameter objects with different read / write attributes. The control command templates are used to modify device parameter configurations and control operation, and therefore only contain parameter objects with "read / write" attributes, thus avoiding unauthorized write operations to read-only parameters from the source. The query command templates are used to read and query device operation data and configuration parameters, and therefore also include parameter objects with "read-only" attributes, meeting the business needs of monitoring the full parameter status of the device.

[0009] S3. Dynamic User Interface Generation: When the operation corresponding to the command template needs to be executed, the cloud platform parses the command template and dynamically generates a user operation interface; for control command templates, an interface containing input controls is generated; for query command templates, an interface containing data display controls is generated.

[0010] S4. Abstract command construction: The cloud platform receives parameter values ​​and / or selected parameter objects input by the user on the user operation interface, and associates and combines the command identifier with the parameter values ​​and / or selected parameter objects input by the user to construct an abstract operation command independent of the communication protocol. S5. Command Issuance and Parsing Execution: The cloud platform issues the abstract operation command to the gateway device; the gateway device receives and parses the abstract operation command, and according to the parameter identifier in the operation command, searches for the corresponding register address, data type, read / write attribute and conversion rule in the device metadata obtained locally or from the cloud platform, and converts the abstract operation command into one or more underlying specific instructions that conform to the target device communication protocol. S6. Instruction Execution and Result Feedback: The gateway device sends the underlying specific instructions to the target IoT device and performs read and / or write operations. After all instructions have been executed, the final execution result is fed back to the cloud platform.

[0011] Furthermore, in step S2, the construction of the command template specifically includes the following sub-steps: S21. Define the name of the command template and the unique command identifier corresponding to the template; S22. Select several parameter objects required to perform the target operation from the metadata set; wherein, in the control command template, the read and write attributes of the selected parameter objects are all "read and write"; in the query command template, the read and write attributes of the selected parameter objects also include "read only"; S23. The cloud platform saves the set of parameter objects selected by the user as a command template, and configures one or more of the following for each parameter object in the command template: alias, input prompt information, and preset constraints; the preset constraints include numerical range, enumerated options, or default values; in the dynamic user interface generation step, the generated input controls are restricted according to the constraints.

[0012] Furthermore, the data types include Boolean, integer, and floating-point types; in step S3, the cloud platform dynamically renders and generates user interface controls based on the data type of the parameter object, preset constraints, and the type of the command template. Specifically, for control-type command templates, generate interfaces containing input controls: generate switch or checkbox controls for Boolean parameter objects, generate text input boxes with maximum and minimum value limits for integer and floating-point parameter objects, and generate drop-down lists or radio buttons for enumerated options; For query command templates, an interface with data display controls is generated to meet the display requirements of device operating status and real-time data collection. This process does not require hard-coding for each command, and realizes the automatic generation of user interface.

[0013] Furthermore, in step S4, the abstract operation command is a JSON format message, which includes a command type identifier, target device address information, and a parameter list; the abstract operation command includes a write command and a read command, wherein the parameter list of the write command includes a parameter identifier and its parameter value, and the parameter list of the read command at least includes a parameter identifier.

[0014] Specifically, the read command calls the corresponding query command template based on the business requirements triggered by the user interface, and integrates and generates the command with the corresponding parameter metadata information; similarly, the write command calls the corresponding control command template based on the business requirements triggered by the user interface, and integrates and generates the command with the corresponding parameter metadata.

[0015] Furthermore, the generation method also includes an automatic data acquisition step: the command template controls the generation of periodic acquisition scheduling instructions based on the acquisition frequency configured by the parameter object in the metadata set, and the abstract operation command is encapsulated based on the periodic acquisition scheduling instructions to generate a read command; after receiving and parsing the read command, the gateway device periodically generates underlying data reading instructions that conform to the communication protocol specifications of the target IoT device according to the pre-configured acquisition frequency, completes communication interaction with the target IoT device through the underlying data reading instructions and performs data reading operations, and actively reports the acquired device data results to the cloud platform.

[0016] Furthermore, in step S5, when it is detected that the register addresses corresponding to several parameter objects contained in the command template are physically discontinuous, the gateway device is responsible for decomposing and packaging the single abstract operation command into multiple independent underlying specific instructions, and managing the sequential or concurrent issuance, retransmission, and acknowledgment logic of these instructions.

[0017] The second aspect of the present invention provides an automatic generation system for IoT transparent transmission commands, including a metadata management module, a command template configuration module, a dynamic interface generation module, an abstract command construction module, an automatic acquisition and scheduling module deployed on a cloud platform, and a gateway execution module deployed on a gateway device; The metadata management module is used to store and manage metadata sets of several IoT devices, and to configure the collection frequency for at least one parameter object in the metadata set; the metadata set includes metadata of several parameter objects, and the metadata includes parameter identifier, register address, data type and read / write attributes; The command template configuration module is used to respond to user selections and the collection frequency of parameter objects, extract at least one parameter object from the metadata set, and create and store a command template with a unique command identifier; wherein, the command template includes a control command template and a query command template, the control command template only extracts parameter objects with a read / write attribute of "read and write", and the query command template also extracts parameter objects with a read / write attribute of "read only"; The dynamic interface generation module is used to parse the metadata and preset constraints of the parameter objects contained in the command template and dynamically generate a user interface; for control command templates, it generates a user interface containing input controls; for query command templates, it generates a user interface containing data display controls. The abstract command construction module is used to receive parameter values ​​and / or selected parameter objects input by the user on the user operation interface, and combine them with command templates to construct abstract operation commands independent of the communication protocol. The abstract operation command is a JSON format message containing a command type identifier, target device address information, and a parameter list. The command type identifier is used to distinguish between write and read operations, and read and write commands are generated accordingly. The parameter list of the write command contains parameter identifiers and their corresponding values, and the parameter list of the read command contains at least parameter identifiers.

[0018] Specifically, the read command is generated by the abstract command construction module based on the business requirements corresponding to the query-type trigger request initiated by the user through the user operation interface, matching and calling the corresponding query command template, and integrating the specific information of the target parameter object's metadata. The write command is generated by the abstract command construction module based on the business requirements corresponding to the control class trigger request initiated by the user through the user operation interface, matching and calling the corresponding control command template, and combining the specific information of the target parameter object's metadata to complete the standardized integration. The gateway execution module is used to receive and parse abstract operation commands, look up the corresponding register address, data type and conversion rules according to the parameter identifier in the command, convert the abstract operation commands into underlying specific instructions that conform to the target device communication protocol, send the underlying specific instructions to the target IoT device and perform read operations and / or read-write operations, and report the execution results to the cloud platform. The automatic data acquisition and scheduling module is communicatively connected to the command template configuration module and the abstract command construction module. It is used to send read commands to the gateway execution module through the abstract command construction module according to the acquisition frequency configured by the parameter object. The gateway execution module periodically generates underlying read instructions and performs data reading operations to report the acquired data to the cloud platform.

[0019] Specifically, the metadata management module synchronizes a pre-configured metadata set containing the collection frequency to the command template configuration module. The command template configuration module generates periodic collection scheduling instructions based on the collection frequency configured in the parameter objects within the metadata set and pushes them to the automatic collection scheduling module. The automatic collection scheduling module then issues periodic collection scheduling instructions to the abstract command construction module. The abstract command construction module encapsulates these periodic collection scheduling instructions to generate standardized read commands and issues them to the gateway execution module. The gateway execution module, after parsing the command in conjunction with the target device communication protocol metadata synchronized by the metadata management module, periodically generates underlying data read instructions conforming to the target IoT device communication protocol according to the preset collection frequency and executes the data read operation. The acquired device data is actively reported by the gateway execution module to the data storage module for persistent storage, and then synchronized by the data storage module to the data display module to achieve the visualization of the collected data.

[0020] Furthermore, the gateway execution module also includes an instruction decomposition and packet assembly unit. This unit is used to decompose the abstract operation command into multiple independent underlying specific instructions when it detects that the multiple register addresses involved in the abstract operation command are not continuous, and to manage the sending, retransmission and acknowledgment of the underlying specific instructions.

[0021] Furthermore, the system also includes a command log module, a data storage module, and a data display module deployed on a cloud platform; The command log module is used to record the content, parameter values, execution results returned by the gateway execution module, and timestamp of each abstract operation command, for auditing and traceability. The data storage module communicates with the gateway execution module and the metadata management module. It receives and stores real-time and historical data collected by the gateway device, and supports multi-dimensional conditional queries and trend analysis calculations of historical monitoring data. At the same time, the data storage module provides a standardized read-only query interface, which supports the data display module to query historical monitoring data by multi-dimensional conditions such as device identifier, parameter identifier, time range, and collection type, as well as trend analysis and statistical calculations of corresponding time-series data, providing unified and compliant data support for upper-layer business modules.

[0022] The data display module is deployed at the front-end application layer of the cloud platform, working in conjunction with the data storage module and the dynamic interface generation module. When a user needs to view device monitoring data, the data display module first obtains the pre-generated user interface structure and the mapping relationship between controls and parameter identifiers from the dynamic interface generation module. Then, based on the device and parameter range selected by the user, it initiates a data query request to the data storage module. The data display module supports retrieving two types of data from the data storage module: real-time collected data returned by the user-triggered read command and historical collected data records from the gateway device, used for historical data tracing and trend analysis. After acquiring the data, the data display module renders the data into the corresponding controls according to the interface structure, realizing the visual display of the collected data. The display formats include, but are not limited to, numerical labels, dashboards, line graphs, bar charts, etc., with the specific format determined by the data type of the parameters and preset display rules, providing users with real-time monitoring of device status and historical data tracing capabilities.

[0023] A third aspect of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method as described in any of the first aspects.

[0024] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the program instructions are executed, the method described in any one of the first aspects is implemented.

[0025] The advantages and beneficial effects of this invention are as follows: 1. Decoupling and Enhanced Scalability: This patent decouples the cloud platform and device protocols by pushing protocol parsing down to the gateway. When connecting new devices, only metadata and templates need to be configured, eliminating the need for repeated development, reducing labor costs and shortening the delivery cycle. At the same time, it clarifies the responsibilities of the cloud platform for business logic and the gateway for protocol conversion. The modular design reduces system coupling, significantly improves scalability and maintenance efficiency, and facilitates subsequent iteration and maintenance.

[0026] 2. Enhanced execution efficiency and reliability: For multi-register operations, abstract commands are issued through a single cloud-network interaction, avoiding multiple network round trips; the gateway completes instruction decomposition and execution locally, ensuring the atomicity of operations, reducing the risk of failure due to network fluctuations, and improving command response speed and execution reliability.

[0027] 3. High degree of automation and flexible adaptation: The dynamic interface generation mechanism based on metadata enables the operation interface to automatically adapt to the template without the need for front-end customization; the standardized metadata model covers common control scenarios, while supporting extended interfaces to be compatible with special operations, taking into account both automation efficiency and special business adaptation needs. Attached Figure Description

[0028] Figure 1 This is a flowchart illustrating the automatic generation method for IoT transparent transmission commands according to the present invention. Figure 2 This is a logical structure diagram of the metadata management module of the present invention; Figure 3 This is a flowchart of the command template configuration module of the present invention; Figure 4 This is a schematic diagram of a pop-up interface of a dynamic interface generation module provided in an embodiment of the present invention; Figure 5 This is a flowchart of the abstract command construction module of the present invention; Figure 6 This is a schematic diagram of the structure of the IoT transparent transmission command automatic generation system of the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0030] Example 1: like Figure 1 As shown, this embodiment provides a method for automatically generating IoT transparent transmission commands. It includes multiple IoT devices, an IoT gateway, and an IoT cloud platform. The multiple IoT devices are connected to the IoT gateway via an RS485 bus, and the gateway is then connected to the cloud platform via a 4G network. The communication protocol for IoT device a is Modbus RTU. According to the device manual of IoT device a, its relevant registers are defined as follows: Register address 40001: Switch status, 0 for off, 1 for on; data type is single coil / bit.

[0031] Register address 40100: Set temperature, data type is 16-bit unsigned integer, actual value is register value divided by 10.

[0032] The automatic generation method specifically includes the following steps: S1. Metadata Management: such as Figure 2 As shown, on the cloud platform side, a metadata set is defined and maintained for IoT device a, and a collection frequency is configured for at least one parameter object in the metadata set. The metadata set is generated based on the device's meter reading template or register address table and contains metadata for several parameter objects. The metadata of the parameter objects includes at least parameter identifier, register address, data type, and read / write attributes. In this embodiment, the metadata entries related to this embodiment are as follows: { "param":"SwitchSta1", "name":"Switch Status", "registerAddress":"40001", "dataType":"BIT", / / Abstracted as a boolean type "access":"ReadWrite" }, { "param":"Temp1", "name":"Set Temperature", "registerAddress":"40100", "dataType":"DECIMAL", / / Abstracted as a decimal number with one decimal place. "precision":1, "access":"ReadWrite" } S2. Command Template Creation: (e.g., ...) Figure 3 As shown, in this embodiment, to meet the remote control requirements of the air conditioner, multiple parameter objects are selected from the metadata set and combined to construct a command template, and a unique command identifier is associated with the template; in this embodiment, the command template is a control command template; the creation of the control command template specifically includes the following sub-steps: S21. Define the command template as "Air Conditioner Start / Stop and Temperature Adjustment", and set a unique command identifier "AirConditionControl" for the template, establishing the association between the identifier and the command template; S22. Select two parameter objects from the metadata set required to perform the target operation. Their parameter identifiers are "SwitchSta1" and "Temp1" respectively. The read and write properties of these two parameter objects are both "ReadWrite". S23. The cloud platform saves the two selected parameter object sets as a command template and allows the user to configure aliases for the parameter identifiers "SwitchSta1" and "Temp1", respectively, setting them to "Switch Status" and "Temp Temperature"; at the same time, it configures preset constraints for the enumeration options of the parameter identifier "SwitchSta1", with selectable values ​​of "On" and "Off"; and sets preset constraints for the parameter identifier "Temp1" with a value range of 15 to 30. In this embodiment, the preset constraint conditions include at least one of the following: numerical range, enumeration options, or default values.

[0033] S3. Dynamic User Interface Generation: When it is necessary to execute the operation corresponding to the command template, the operation and maintenance personnel select the target device, namely IoT device a, on the device monitoring page of the cloud platform, and click the operation menu of the device. The menu displays all available command templates associated with the device, including the "Air Conditioner Start / Stop and Temperature Adjustment" option created in step S2.

[0034] In response to the user's selection of the command template, the cloud platform triggers dynamic interface generation logic. The platform first reads the command template definition identified as "AirConditionControl," parsing it to reveal that the template contains two parameter objects, identified as "SwitchSta1" and "Temp1," respectively. Subsequently, the platform obtains the metadata corresponding to these two parameter objects, as well as the input methods and constraints configured in step S23. Based on this information, it dynamically renders and generates a user interface for data input, automatically adapting the corresponding input controls for each parameter object.

[0035] Specifically, such as Figure 4 As shown in this embodiment, for the "Set Temperature" parameter object with parameter identifier "Temp1", because it is configured with a numerical range constraint, the system generates a numeric input box and automatically sets its minimum input value to 15 and its maximum value to 30. The user will be restricted by this range when inputting. For the "Switch Status" parameter object with parameter identifier "SwitchSta1", because it is configured with an enumeration option constraint, the system generates a drop-down list, which is dynamically filled with predefined enumeration options for the user to select from "On" and "Off".

[0036] Preferably, in this embodiment, the maintenance personnel turn the switch to "on", enter "23" in the input box, and then click "confirm and issue".

[0037] S4. Abstract Command Construction: After the operations and maintenance personnel complete the parameter settings on the user operation interface generated in step S3, they click the "Confirm Issuance" button. The front-end page encapsulates the user-input parameter information into JSON format data and submits it to the cloud platform backend. The cloud platform backend constructs the following JSON format abstract command: POST / exchange / cmd_template / execute { "code":"AirConditionControl", "sn":"SN-001", / / Target gateway SN "addr":"3_1", / / Address 1 of the air conditioner under serial port 3 of the gateway "cmd":"TEMPLATE_WRITE", "params":[ {"param":"SwitchSta1","value":true}, {"param":"Temp1","value":23} ] } S5. Command Issuance and Parsing Execution: After the abstract command is constructed, the cloud platform publishes the abstract operation command to the topic "indicate / server / ABC_ProductKey / SN-001" through the MQTT message queue protocol. The gateway device subscribes to the topic and receives the above abstract operation command. S6. Command Execution and Result Feedback: The gateway device sends the underlying specific commands to the target IoT device and performs read / write operations. After all commands have been executed, the final execution result is published to the reply topic `indicate / dev / ABC_ProductKey / SN-001`. { "msgid":..., "method":"operate", "sn":"SN-001", "res":1, / / 1 indicates success "timestamp":... } After receiving this message, the cloud platform updates the command execution log and displays a message to the operations and maintenance personnel on the front-end interface indicating "Command successfully issued." This concludes a complete, automated, cross-protocol command issuance process. As can be seen from this example, the cloud platform does not involve any details of the Modbus protocol throughout the entire process; both development and operations personnel operate at an abstract, business-oriented level. The system's decoupling, automation, and efficiency are fully demonstrated.

[0038] Example 2: Based on Embodiment 1 above, this embodiment further elaborates on the internal processing mechanism of the gateway device after receiving the abstract operation command, focusing on how the gateway achieves atomicity guarantee for multi-register operations through local parsing, parameter mapping, instruction decomposition and packet assembly, and response processing.

[0039] After receiving the command, the gateway device's execution module initiates the processing flow, which includes the following sub-steps: S51, Command parsing: The gateway device receives and parses the abstract operation command, and learns that it needs to perform a write operation defined by the "AirConditionControl" template on the device with address "3_1".

[0040] S52. Parameter Mapping and Value Conversion: The gateway device traverses the "params" array; queries the locally cached device metadata based on the parameter identifier to obtain the corresponding register address, data type, and conversion rule, and converts the service parameter value into a device-recognizable raw register value accordingly. For {"param":"SwitchSta1","value":true}, the gateway queries the metadata and finds that its corresponding register address is 40001 and the data type is BIT. According to the conversion rules of BIT type, the parameter value true is mapped to the value 1 required by the Modbus protocol; For "param":"Temp1","value":23, the gateway queries the metadata and finds that its corresponding register address is 40100, the data type is DECIMAL, and the precision is 1. Based on the precision requirements, the gateway converts the service value 23 into the raw register value required by the device: 23 × 10 = 230; S53, Instruction Decomposition and Packet Assembly: After parameter mapping is completed, the gateway's instruction decomposition and packet assembly unit analyzes the register addresses involved in this operation. The analysis reveals that register address 40001 corresponding to parameter identifier "SwitchSta1" and register address 40100 corresponding to parameter identifier "Temp1" are physically discontinuous. Therefore, two independent Modbus instructions are generated: First instruction: Write address 40001 and value 1 to IoT device a.

[0041] Second instruction: Write address 40100 and value 230 to IoT device a.

[0042] S54. The gateway device sends these two Modbus RTU messages to IoT device a sequentially via the RS485 bus and waits for their respective responses.

[0043] S55. After receiving successful responses to both commands, the gateway determines that the entire business operation is successful.

[0044] Example 3: Based on the above embodiments, this embodiment further elaborates on the result feedback mechanism after the gateway device completes the execution of the command, as well as the cloud platform's recording and tracing process of the command execution log.

[0045] In this embodiment, after successfully receiving and parsing the abstract operation command, the gateway device automatically decomposes it into two specific low-level instructions conforming to the Modbus protocol, and sequentially sends them to the target air conditioning device via the RS485 bus. Upon confirmation of instruction response, both instructions have been successfully executed, and the status of the target IoT device has been updated as expected: air conditioning on, temperature set to 23°C. Subsequently, the gateway enters the result feedback process, which specifically includes the following steps: S61. Command Issuance and Response Processing: The gateway device sends specific underlying commands to the target IoT device through the RS485 bus interface (serial port 3 in this embodiment) and manages the entire command execution process. Sequential command delivery control: The gateway strictly adheres to the dependencies between commands, employing a sequential delivery strategy. It first sends the first command for the write switch state and then enters a waiting-for-response state. The gateway will not send a second command until it receives a successful response to the first command. This mechanism ensures that the logical order of command execution aligns with business intent. Figure 1 To.

[0046] Timeout retransmission mechanism: The gateway sets an independent response timeout timer for each command, with the timeout period preset based on the fieldbus communication status. If no valid response is received from the device before the timer expires, the gateway automatically triggers the retransmission mechanism. In this embodiment, the retransmission strategy is configured with a maximum of 3 retransmissions, with the retransmission interval increasing progressively to avoid network congestion. The gateway also records the occurrence time and number of retransmissions for subsequent fault diagnosis.

[0047] Response Confirmation and Verification: Upon receiving a response message from the device, the gateway first performs integrity verification on the message, including CRC checksum verification and message format checking. If the verification passes, the gateway parses the message content to confirm the command execution status. If an abnormal response is received, such as an invalid address or invalid data value, the gateway immediately determines that the current command execution has failed and terminates the sending of subsequent commands.

[0048] S62. Execution Result Determination: After receiving successful responses to both commands, the gateway determines that the entire business operation is successful and proceeds to the next result feedback process. If either command fails to execute or fails to complete after a timeout and retransmission, the gateway will determine that the operation has failed and record the reason for the failure.

[0049] S63. The gateway device summarizes the issuance and execution status of the abstract operation command, and returns a confirmation message to the cloud platform containing the issued content, parameter values, execution status, timestamp and execution result data. The cloud platform updates the command execution log according to the confirmation message and notifies the user of the execution result.

[0050] Example 4: like Figure 6As shown, based on the above embodiments, this embodiment provides an IoT transparent transmission command automatic generation system, including a metadata management module, a command template configuration module, a dynamic interface generation module, an abstract command construction module, an automatic collection and scheduling module deployed on a cloud platform, and a gateway execution module deployed on a gateway device; The metadata management module is used to store and manage metadata sets of several IoT devices, and to configure the collection frequency for at least one parameter object in the metadata set; the metadata set includes metadata of several parameter objects, and the metadata includes parameter identifier, register address, data type and read / write attributes; This module employs a structured data model to create an independent metadata archive for each IoT device model. The metadata management module supports CRUD operations on metadata and can respond to metadata query requests from other modules. It is also responsible for synchronizing device metadata to the corresponding gateway device for local caching, ensuring the gateway can quickly obtain the necessary transformation rules when executing commands.

[0051] The command template configuration module is used to respond to user selection, extract at least one parameter object from the metadata set, create and store a command template with a unique command identifier; wherein, the command template includes a control command template and a query command template, the control command template extracts only parameter objects with a read / write attribute of "read and write", and the query command template also extracts parameter objects with a read / write attribute of "read only"; The dynamic interface generation module is used to parse the metadata and preset constraints of the parameter objects contained in the command template and dynamically generate a user interface; for control command templates, it generates a user interface containing input controls; for query command templates, it generates a user interface containing data display controls. The abstract command construction module is used to receive parameter values ​​and / or selected parameter objects input by the user on the user interface, and combine them with command templates to construct abstract operation commands independent of the communication protocol. The abstract operation command is a JSON format message containing a command type identifier, target device address information, and a parameter list. The command type identifier is used to distinguish between write and read operations, and read and write commands are generated accordingly. The parameter list of the write command contains parameter identifiers and their corresponding values, and the parameter list of the read command contains at least parameter identifiers.

[0052] The gateway execution module is used to receive and parse abstract operation commands, look up the corresponding register address, data type and conversion rules according to the parameter identifier in the command, convert the abstract operation commands into underlying specific instructions that conform to the target device communication protocol, send the underlying specific instructions to the target IoT device and perform read operations and / or read-write operations, and report the execution results to the cloud platform. The automatic data acquisition and scheduling module is communicatively connected to the command template configuration module and the abstract command construction module. It is used to periodically send read commands to the gateway execution module through the abstract command construction module according to the acquisition frequency configured by the parameter object. The gateway device receives and parses the read command, matches the register address, data type and communication protocol information of the corresponding parameter in the metadata set according to the identifier of the parameter to be acquired carried in the read command, generates a low-level read instruction that conforms to the communication protocol of the target IoT device, executes the data reading operation of the corresponding device register, and actively reports the reading result to the cloud platform.

[0053] As a further optimization of the gateway execution module, the module also includes an instruction decomposition and packet assembly unit. This unit automatically splits a single abstract operation command into multiple independent underlying concrete instructions when it detects that the multiple register addresses involved in the abstract operation command are discontinuous. It then manages the sending, retransmission, and acknowledgment of these instructions in a unified manner. Specifically, this unit implements a discontinuous address detection function, analyzing the register addresses corresponding to each parameter object to determine whether the operation can be completed with a single protocol instruction; it implements an intelligent splitting function, splitting the abstract command into multiple independent instructions conforming to the device protocol based on the detection results; it implements an atomicity guarantee function, uniformly managing the split instructions to ensure that a success result is returned to the cloud platform only after all underlying concrete instructions have been successfully executed; if any instruction fails, the entire operation is deemed a failure; and it implements an interaction optimization function, enabling the cloud platform and gateway to complete complex multi-register operations with a single interaction through the above splitting mechanism, effectively avoiding the uncertainty and delay caused by multiple public network communications.

[0054] Preferably, the system further includes a command log module, a data storage module, and a data display module deployed on a cloud platform; The command log module records the complete execution trajectory of each abstract operation command. This module records at least the following: the issued content, i.e., the complete content of the abstract operation command, including command identifier, target device, parameter list, etc.; the parameter values, i.e., the original parameter values ​​input by the user; the execution result, i.e., the operation result returned by the gateway, including success or failure status; and the timestamp, i.e., the time when the command was issued and completed. The command log module provides the system with complete auditing and traceability capabilities. Operation and maintenance personnel can quickly locate problems and analyze operation history through the logs, ensuring the maintainability and compliance of the system. The data storage module communicates with the gateway execution module and the metadata management module. It receives and stores real-time and historical data collected by the gateway device, and supports multi-dimensional conditional queries and trend analysis calculations of historical monitoring data. At the same time, the data storage module provides a standardized read-only query interface, which supports the data display module to query historical monitoring data by multi-dimensional conditions such as device identifier, parameter identifier, time range, and collection type, as well as trend analysis and statistical calculations of corresponding time-series data, providing unified and compliant data support for upper-layer business modules.

[0055] The data display module is deployed at the front-end application layer of the cloud platform, working in conjunction with the data storage module and the dynamic interface generation module. When a user needs to view device monitoring data, the data display module first obtains the pre-generated user interface structure and the mapping relationship between controls and parameter identifiers from the dynamic interface generation module. Then, based on the device and parameter range selected by the user, it initiates a data query request to the data storage module. The data display module supports retrieving two types of data from the data storage module: real-time collected data returned by the user-triggered read command and historical collected data records from the gateway device, used for historical data tracing and trend analysis. After acquiring the data, the data display module renders the data into the corresponding controls according to the interface structure, realizing the visual display of the collected data. The display formats include, but are not limited to, numerical labels, dashboards, line graphs, bar charts, etc., with the specific format determined by the data type of the parameters and preset display rules, providing users with real-time monitoring of device status and historical data tracing capabilities.

[0056] The present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the automatic generation method for IoT transparent transmission commands as described in the above embodiments.

[0057] The present invention also provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed to implement the method for automatically generating IoT transparent transmission commands as described in the above embodiments.

[0058] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for automatically generating IoT transparent transmission commands, characterized in that, Includes the following steps: S1. Metadata Management: On the cloud platform side, a set of metadata is defined and maintained for IoT devices, and a collection frequency is configured for at least one parameter object in the metadata set; the metadata set contains metadata of several parameter objects, and the metadata includes parameter identifier, register address, data type and read / write attributes; S2. Command Template Creation: In response to user operation, select metadata combinations of several parameter objects from the metadata set to construct a command template, and define a command identifier for the command template; S3. Dynamic User Interface Generation: When the operation corresponding to the command template needs to be executed, the cloud platform parses the command template and dynamically generates a user interface. S4. Abstract command construction: The cloud platform receives parameter values ​​and / or selected parameter objects input by the user on the user operation interface, and associates and combines the command identifier with the parameter values ​​and / or selected parameter objects input by the user to construct an abstract operation command independent of the communication protocol. S5. Command Issuance and Parsing Execution: The cloud platform issues the abstract operation command to the gateway device; The gateway device receives and parses the abstract operation command. Based on the parameter identifier in the operation command, it searches for the corresponding register address, data type, read / write attribute and conversion rule in the device metadata obtained locally or from the cloud platform, and converts the abstract operation command into one or more underlying specific instructions that conform to the target device communication protocol. S6. Instruction Execution and Result Feedback: The gateway device sends the underlying specific instructions to the target IoT device and performs read and / or write operations. After all instructions have been executed, the final execution result is fed back to the cloud platform.

2. The generation method according to claim 1, characterized in that, In step S2, the construction of the command template specifically includes the following sub-steps: S21. Define the name of the command template and the unique command identifier corresponding to the template; S22. Select several parameter objects required to perform the target operation from the metadata collection; S23. The cloud platform saves the set of parameter objects selected by the user as a command template, and configures one or more of the following for each parameter object in the command template: alias, input prompt information, and preset constraints.

3. The generation method according to claim 1, characterized in that, In step S4, the abstract operation command is a JSON format message, which includes a command type identifier, target device address information, and a parameter list. The abstract operation command includes a write command and a read command, wherein the parameter list of the write command includes a parameter identifier and its parameter value, and the parameter list of the read command at least includes a parameter identifier.

4. The generation method according to claim 3, characterized in that, It also includes an automatic data acquisition step: the command template generates a periodic acquisition scheduling instruction based on the acquisition frequency configured in the parameter object in the metadata set, and encapsulates and generates a read command based on the periodic acquisition scheduling instruction; after receiving and parsing the read command, the gateway device periodically generates a low-level data reading instruction that conforms to the communication protocol specification of the target IoT device according to the pre-configured acquisition frequency, completes communication interaction with the target IoT device through the low-level data reading instruction and performs data reading operation, and actively reports the acquired device data results to the cloud platform.

5. The generation method according to claim 1, characterized in that, In step S5, when it is detected that the register addresses corresponding to several parameter objects contained in the command template are physically discontinuous, the gateway device is responsible for decomposing and packaging the single abstract operation command into multiple independent underlying specific instructions, and managing the sequential or concurrent issuance, retransmission and acknowledgment logic of these instructions.

6. An automatic command generation system for IoT transparent transmission, characterized in that, It includes a metadata management module, a command template configuration module, a dynamic interface generation module, an abstract command construction module, and an automatic data collection and scheduling module deployed on a cloud platform, as well as a gateway execution module deployed on a gateway device; The metadata management module is used to store and manage a metadata set of several IoT devices, and to configure the collection frequency for at least one parameter object in the metadata set; the metadata set includes metadata of several parameter objects. The command template configuration module is used to respond to user selection, extract at least one parameter object from the metadata set, and create and store a command template with a unique command identifier. The dynamic interface generation module is used to parse the metadata of the parameter objects contained in the command template and dynamically generate a user interface. The abstract command construction module is used to receive parameter values ​​and / or selected parameter objects input by the user on the user interface, and combine them with command templates to construct abstract operation commands that are independent of the communication protocol. The gateway execution module is used to receive and parse abstract operation commands, complete the protocol conversion and execution of abstract operation commands into specific instructions at the device's underlying layer, and report the execution results to the cloud platform. The automatic data acquisition and scheduling module is used to send read commands to the gateway execution module through the abstract command construction module according to the acquisition frequency configured by the parameter object. The gateway execution module periodically generates underlying read instructions and performs data reading operations, and reports the acquired data to the cloud platform.

7. The generation system according to claim 6, characterized in that, The gateway execution module further includes an instruction decomposition and packet assembly unit. The unit is used to decompose the abstract operation command into multiple independent underlying specific instructions when it detects that the multiple register addresses involved in the abstract operation command are not continuous, and to manage the sending, retransmission and acknowledgment of the underlying specific instructions.

8. The generation system according to claim 6, characterized in that, The system also includes a command log module, a data storage module, and a data display module deployed on a cloud platform; The command log module is used to record the content of each abstract operation command, parameter values, execution results returned by the gateway execution module, and timestamp; The data storage module is used to store the collected data reported by the gateway execution module; The data display module is used to retrieve the collected data from the target device from the data storage module of the cloud platform, and render the user interface to visually display the collected data.

9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method as described in any one of claims 1-5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program instructions are executed, the method described in any one of claims 1-5 is implemented.