A low-code method for building IoT scenario models

Building an IoT scenario model through low code, using edge controllers to collect and parse terminal device data, and collaborate with the cloud, solves the problem of message lag and excessive burden on the IoT platform when processing large amounts of device data, and achieves efficient data Handle and secure and reliable equipment control.

CN116743597BActive Publication Date: 2024-11-22NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310822784.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-06
Publication Date
2024-11-22
Estimated Expiration
2043-07-06

AI Technical Summary

Technical Problem

The existing IoT platforms have problems of message lag and excessive burden on the cloud when processing large amounts of terminal equipment data, making it difficult to efficiently collect and control data.

Method used

Using low-code to build an IoT scenario model, collect and parse terminal device data through edge controllers, and forward the processed data to the cloud. At the same time, design the interface between the cloud control model and the scene model to realize the coordination between the edge and the cloud, and realize the cloud Long distance control and edge close-range loop control.

Benefits of technology

It improves data processing efficiency, reduces the burden on the cloud, ensures the safe and reliable operation status of scenario equipment, and is suitable for multi-variable and multi-controller distributed monitoring systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116743597B_ABST
    Figure CN116743597B_ABST
Patent Text Reader

Abstract

The present invention provides a method for constructing an Internet of Things scene model with low code, which relates to the field of edge computing and Internet of Things technology. The construction method includes the following steps: Step 1: Constructing a cloud scene model; Step 2: Edge-cloud collaboration of the scene model; Step 3: The cloud control model determines the target scene and forwards the control information to the scene model. This application uses low code to construct an Internet of Things scene model, which is suitable for a multi-variable, multi-controller distributed monitoring system. The edge controller collects the terminal devices connected to each node and performs parsing processing, and then forwards the processed data to the cloud. At the same time, the cloud can also issue task instructions to command the edge controller to perform related actions to achieve collaboration between the edge and the cloud. In addition, an interface between the control model and the scene model is designed to achieve remote control of the scene operation on the cloud and close-range loop control of the scene on the edge, ensuring that the scene equipment is in a safe and reliable working state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of edge computing and Internet of Things technologies, and in particular to a method for building an Internet of Things scenario model with low code. Background Art

[0002] With the development of IoT technology, many terminal devices are connected to the cloud IoT platform through communication protocols. The IoT platform registers the terminal devices, monitors the device operation data in real time, and can also remotely control the terminal devices. However, many actual scenarios currently involve a large number of terminal devices. The IoT platform must not only collect and analyze the terminal devices, but also control some devices, which undoubtedly increases the burden of cloud-based device data processing, and there will also be other problems such as message lag. With the rapid development of science and technology, edge computing technology has made breakthroughs, and edge controllers have begun to be gradually integrated into various industries. It is located between the IoT platform and the terminal devices, collecting a large amount of device operation data and analyzing the data, and then forwarding it to the cloud, which greatly improves data processing efficiency and reduces the load on the cloud. Summary of the invention

[0003] The purpose of the present invention is to solve the technical problems of the Internet of Things in the prior art.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] A method for building an Internet of Things scenario model with low code, characterized by comprising the following steps:

[0006] Step 1: Build a cloud scene model

[0007] Step 2: Edge-Cloud Collaboration of Scene Model

[0008] Step 3: The cloud control model determines the target scenario and forwards the control information to the scenario model.

[0009] Preferably, the step one comprises the following steps:

[0010] S100: Building a scenario model: creating an IoT product in the cloud server and configuring the basic attributes of the product and the basic functions of product editing;

[0011] S110: Create product and register device: register IoT terminal devices in the cloud server, configure basic properties of the device and basic functions of device editing;

[0012] S120: Configuring scenario description and device deployment: Based on a specific scenario, multiple distributed terminal devices are equipped, and the interaction between the devices promotes a simple overview of the scenario operation of the IoT scenario. The scenario management unit also includes the deployment of the scenario required devices, that is, the necessary terminal devices are required to realize the scenario operation;

[0013] S130: Configuring scene variables: The variable mapping unit in the cloud server configures scene variables, and customizes scene variables based on the target scene.

[0014] Preferably, the basic attributes of the product in S100 include product name, node type, gateway protocol, and authentication method; the basic functions of product editing include product adding, modifying, deleting, and querying functions; the basic functions of product editing also include restrictions on product editing.

[0015] Preferably, the basic attributes of the device in S110 include the product name, device name, and device communication Topic, and the basic functions of device editing include device adding, modifying, deleting, and querying functions and restriction conditions for device editing.

[0016] Preferably, the S120 scenario variables include variable name, variable type, node ID, Topic, and key; wherein the variable name is mainly device attributes and environmental factors, the variable type is allowed to be any form of integer, floating point, character, and frame data, the node ID determines the access location of the terminal device at the edge, the Topic is the topic subscribed and published when the device communicates through the service proxy broker, and the key is the key in the JSON data format obtained from the communication Topic.

[0017] Preferably, the specific steps of S2 are as follows:

[0018] S200: Collect terminal device data at the node:

[0019] S210: The service agent broker obtains and temporarily stores device data by subscribing to the Topic;

[0020] S220: The parser subscribes to the Topic and the broker publishes the Topic, and the parser obtains the device data;

[0021] S230: The parser parses the device metadata according to the custom parsing operation;

[0022] S240: The time series database stores and updates the parsed device data in real time;

[0023] S250: Edge collaborator reads the database and uploads the time series data to Cloud collaborator;

[0024] S260: Edge collaborator conveys information to other cloud modules such as scene models.

[0025] Preferably, the data model for data analysis shown below is constructed for configuration data calculation and data filtering in S230, including the following steps:

[0026] S231: The device must be online to report data. Let i be any positive integer, D be the set of all devices in the target scenario, and d i is the i-th device in set D, S i For device d i The online status of the device di is specified, and S i =1, when device d i When offline, S i =0;

[0027] S232: The Payload obtained by the parser subscribing to the Topic is in JSON format. Each key and value of the device metadata is in a one-to-one relationship. Let i and j be any positive integers, k ij For subscribing devices i The topic gets the jth key in the Payload, considering k ij The data expression types may be inconsistent (such as input quantity and output quantity). ij Filter the data when ij For subscribing devices i The jth value in the Payload obtained from the topic, then the actual value of the data can be deduced to be f(k ij )=v ij S i ;

[0028] S233: According to actual needs, the configuration value operation of data analysis can be customized. Let C be the configuration value operation of data analysis. For example, when the operation is gain, C=1, and when the operation is bit selection, C=0. The gain is to multiply the actual value by the power of 10 to amplify or reduce the actual value for output. The bit selection is to convert the decimal number into a binary number, and any bit from the low bit to the high bit represents a certain input variable. At the same time, it is stipulated that each bit can only correspond to one input variable. The input variable is either 0 or 1. By default, '0' indicates that the switch is in the on state, and '1' indicates that the switch is in the off state.

[0029] S234: In complex scenarios, considering the diversity of device switch variables, a decimal number composed of multiple device switch states is obtained and converted into a binary number during parsing. Let s be any positive integer, O i(x) is the conversion of the decimal number x to binary, starting from the lowest bit, the value of the i-th bit, then for any decimal number x, the corresponding binary number has the value

[0030] That is, when O s When (x) = 0, When O s When (x) = 1,

[0031] S235: Based on step B44, k ij When k is the input quantity, after the bit operation, the name of the sth bit is customized. ij ∈ input quantity, f(k ij ) into binary, the names of the bits can be derived The corresponding relationship with the place value is

[0032] S236: Operate and k according to the configuration value ij Data expression type, derive the function expression of data analysis, when C = and k ij ∈ output, g(C, k ij , p)=10 p , when C0= and k ij ∈ input quantity, Where p is an arbitrary integer;

[0033] S237: After parsing by the parser, derive the value corresponding to each variable name. Let r be any positive integer, V r is the name of the rth variable in the target scenario. r , k ij ∈ output and V r =k ij When F(V r , C, k ij , p) = f(k ij )g(C,k ij , p), when V r , k ij ∈Input and When F(V r , C, k ij , p) = g(C, k ij , p).

[0034] Preferably, the specific steps of step three are as follows:

[0035] S300: The cloud control model determines the target scene and forwards the control information to the scene model;

[0036] S310: The scene variables in the cloud scene model obtain values, and the Cloud collaborator sends the scene variable control information to the Edge collaborator;

[0037] S320: The Edge collaborator stores the variable control information in the time series database, and the parser reads the database to obtain the variable control information;

[0038] S330: The service agent broker obtains variable control information from the parser through Topic communication and then forwards it to the terminal device;

[0039] S340: The terminal device identifies the variable control information and makes corresponding actions and data adjustments;

[0040] S350: The data during the operation of the terminal device is fed back to the parser through the service broker;

[0041] S360: The parser parses the metadata of the device operation and then uploads it to the edge controller scene model

[0042] S370: The scene model of the edge controller transmits the variable data to the control model of the edge controller through the scene identifier;

[0043] S380: The control model determines whether the scene variable value meets the trigger condition and decides whether to recalculate and output the control variable value;

[0044] S390: The control variable value passes through the edge controller's scene model, parser, and broker in sequence. The terminal device subscribes to the Topic to obtain data. The device makes corresponding switch actions and analog value adjustments by identifying the data information.

[0045] Preferably, in 300, the control process of the cloud server control model includes the following steps:

[0046] S301: Design a control panel in the control model, remotely control the device action through the control panel, and set multiple controls on the control panel, such as switches, indicator lights, text boxes, input boxes and other controls;

[0047] S302: Configure the properties of the control. The on state of the switch control is represented by '0', and the off state is represented by '1'. The input box represents the input value of the device data. The text box represents the control property field and is consistent with the variable name of the scene model. The button is used to specify the start and stop control of the scene control model.

[0048] S303: Select the target scene from the drop-down box, and press the start button of the target scene to control the running of the target scene;

[0049] S304: Set the device switch to the on state to control the operation of the device;

[0050] S305: The indicator light control can observe the switch status of the equipment during operation, and the input box displays the equipment analog data.

[0051] Preferably, the execution process of the edge expander control model in S380 includes the following steps:

[0052] S381: The control model of the edge controller receives the JSON data format of the scene variable transmitted by the scene model. Since the scene variable name is equal to the control variable name, the control model indexes the control variable name according to the JSON data format to obtain the corresponding control variable value;

[0053] S382: The control variable value is substituted into the trigger, and the trigger determines the alarm information according to the threshold range;

[0054] S383: If the trigger judgment result is a safe state, execute step S385; if it is another alarm state, execute step S940;

[0055] S384: The conditional operator recalculates the control variable value according to the algorithm rules, outputs a new control variable value, substitutes it into the trigger again, and executes step S383;

[0056] S385: The actuator outputs the control variable value and sends it to the scene model.

[0057] The present application provides a method for low-code construction of IoT scene models, which adopts low-code construction of IoT scene models and is suitable for multi-variable, multi-controller distributed monitoring systems. The edge controller collects the terminal devices connected to each node and performs analysis and processing, and then forwards the processed data to the cloud. At the same time, the cloud can also issue task instructions to command the edge controller to perform related actions to achieve edge and cloud collaboration. In addition, an interface between the control model and the scene model is designed to realize long-distance control of scene operation on the cloud and short-distance loop control of the scene on the edge, ensuring that the scene equipment is in a safe and reliable working state. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 A flowchart of the steps of constructing a scene model in one embodiment of the present invention;

[0059] Figure 2 A flowchart of the collaboration between a cloud server and an edge controller in one embodiment of the present invention;

[0060] Figure 3 A flow chart of data interaction between a control model and a scene model in one embodiment of the present invention;

[0061] Figure 4 A control flow chart of an edge controller control model in one embodiment of the present invention;

[0062] Figure 5 This is a simplified structural diagram of an Internet of Things scenario model in one embodiment of the present invention.

[0063] Legend:

[0064] 1. First node; 2. Second node; 3. Nth node; 4. Broker; 5. Parser; 6. Backend model editor; 7. Edge control end time series data; 8. Edge control end scenario model; 9. Edge control end control model; 10. Edge collaborator; 11. Cloud collaborator; 12. Cloud scenario model;

[0065] 13. Cloud control model; 14. Cloud time series data; 15. API. DETAILED DESCRIPTION

[0066] The present invention is further described in detail below in conjunction with specific embodiments.

[0067] A method for building an IoT scenario model with low code, comprising the following steps:

[0068] Step 1: Build a cloud scene model:

[0069] In one embodiment, see Figure 1 , including the following steps:

[0070] S100: build scene model;

[0071] Specifically, in one implementation, firstly, an IoT product is created on a cloud server, and basic attributes of the product and basic functions of product editing are configured.

[0072] In one embodiment, the basic attributes of the product include other key attributes such as product name, node type, gateway protocol, authentication method, etc.; the basic functions of product editing include product addition, modification, deletion and query functions, and in one embodiment, the basic functions of product editing include restrictions on product editing, the restrictions on product editing include that the product name follows the principle of uniqueness, that is, the names of different products cannot be the same, and the restrictions on product editing also include that after a certain IoT product is successfully created, its authentication method cannot be changed. That is, the basic functions of product editing require the uniqueness of the product name, and the authentication method of the created product cannot be changed.

[0073] S110: Create product and register device;

[0074] In one implementation, the IoT terminal device is registered in the cloud server, and basic properties of the device and basic functions of device editing are configured.

[0075] In one embodiment, the basic attributes of the device include other key attributes such as the product name, device name, device communication topic, etc. The basic functions of the device editing include the functions of adding, modifying, deleting and querying the device; in one embodiment, the basic functions of the device editing include the restriction conditions of the device editing, and the restriction conditions of the device editing include the principle of the order of products and devices, that is, first select the created product, and then register the relevant terminal devices under the product. The product and the device can meet a one-to-one or one-to-many relationship. The restriction conditions of the device editing also include the principle that the device name follows the uniqueness, that is, the device names under the same product cannot be the same. That is, the editing requires the uniqueness of the device name, and the device can only be registered under the created product, and multiple devices can be registered for one product.

[0076] S120: Configure scenario description and device deployment;

[0077] Specifically, it is a brief overview of a scenario based on a specific scenario equipped with multiple distributed terminal devices, in which the interaction between the devices enables the operation of the IoT scenario. The scenario management unit also includes the deployment of scenario-required devices, that is, the necessary terminal devices are required to realize the operation of the scenario.

[0078] For example, the scenario is described as a campus fire alarm scenario, and the device deployment for the campus fire alarm scenario requires registration of cameras, temperature sensors, sound and light alarms, and other terminal devices.

[0079] S130: configure scene variables;

[0080] Specifically, in one embodiment, a variable mapping unit in the cloud server configures scene variables, and based on the target scenario, the scene variables are customized, and the scene variables include variable name, variable type, node ID, Topic, and key; wherein the variable name is mainly device attributes and environmental factors, the variable type is allowed to be integer, floating point, character, frame data and other data types, the node ID determines the access location of the terminal device at the edge, the Topic is the topic subscribed and published when the device communicates through the service proxy broker, and the key is the key in the JSON data format obtained from the communication Topic.

[0081] Referring to the standard of the cloud variable mapping unit, the variable mapping unit of the workpiece model is also implemented in the edge controller.

[0082] Step 2: Edge-cloud collaboration of scene model:

[0083] See also Figure 2, the steps of edge-cloud collaboration are as follows:

[0084] S200: Collect terminal device data at the node:

[0085] Specifically, in one implementation, in a target scenario, the edge node is connected to the terminal device required for the scenario, each edge node supports access to one device, and the other end of the edge node is connected to a service broker;

[0086] S210: The service agent broker obtains and temporarily stores device data by subscribing to the Topic;

[0087] In one embodiment, the broker supports at least one device communication access protocol;

[0088] S220: The parser subscribes to the Topic and the broker publishes the Topic, and the parser obtains the device data;

[0089] Specifically, in one implementation, the resolver sends a subscription request to the broker, and then the broker publishes the Topic to the resolver.

[0090] S230: The parser parses the device metadata according to the custom parsing operation;

[0091] In one embodiment, the parser configures source nodes, configures data calculation and data filtering.

[0092] The source node is used to use the metadata reported by the device through the object model communication Topic as the data source for parsing;

[0093] The configuration data calculation and data filtering, after completing the source node configuration of data parsing, configure the fields and expressions of the source node data, and add a filter for data filtering at the same time; in one embodiment, for the configuration data calculation and data filtering, a mathematical model for data parsing can be constructed, including the following steps:

[0094] S231: The device must be online to report data. Let i be any positive integer, D be the set of all devices in the target scenario, and d i is the i-th device in set D, S i For device d i The online status of the device is specified when the device d i When online, S i =1, when device d i When offline, S i =0;

[0095] S232: The Payload obtained by the parser subscribing to the Topic is in JSON format. Each key and value of the device metadata is in a one-to-one relationship. Let i and j be any positive integers, k ij For subscribing devices i The topic gets the jth key in the Payload, considering k ij The data expression types may be inconsistent (such as input quantity and output quantity). ij Filter the data when ij For subscribing devices i The jth value in the Payload obtained from the topic, then the actual value of the data can be deduced to be f(k ij )=v ij S i ;

[0096] S233: According to actual needs, the configuration value operation of data analysis can be customized. Let C be the configuration value operation of data analysis. For example, when the operation is gain, C=1, and when the operation is bit selection, C=0. The gain is to multiply the actual value by the power of 10 to amplify or reduce the actual value for output. The bit selection is to convert the decimal number into a binary number, and any bit from the low bit to the high bit represents a certain input variable. At the same time, it is stipulated that each bit can only correspond to one input variable. The input variable is either 0 or 1. By default, '0' indicates that the switch is in the on state, and '1' indicates that the switch is in the off state.

[0097] S234: In complex scenarios, considering the diversity of device switch variables, a decimal number composed of multiple device switch states is obtained and converted into a binary number during parsing. Let s be any positive integer, O i (x) is the conversion of the decimal number x to binary, starting from the lowest bit, the value of the i-th bit, then for any decimal number x, the corresponding binary number has the value

[0098] That is, when O s When (x) = 0, When O s When (x) = 1,

[0099] S235: Based on step B44, k ij When k is the input quantity, after the bit operation, the name of the sth bit is customized. ij ∈ input quantity, f(k ij ) into binary, the names of the bits can be derived The corresponding relationship with the place value is

[0100] S236: Operate and k according to the configuration value ij Data expression type, derive the function expression of data analysis, when C = 1 and k ij ∈ output, g(C, k ij , p)=10 p , when C=0 and k ij ∈ input quantity, Where p is an arbitrary integer;

[0101] S237: After parsing by the parser, derive the value corresponding to each variable name. Let r be any positive integer, V r is the name of the rth variable in the target scenario. r , k ij ∈ output and V r =k ij When F(V r , C, k ij , p) = f(k ij )g(C,k ij , p), when V r , k ij ∈Input and When F(V r , C, k ij , p) = g(C, k ij , p).

[0102] S240: The time series database stores and updates the parsed device data in real time:

[0103] In one embodiment, a local database is configured at the edge cloud controller, a time series data table is established in the local database to store the parsed values ​​output by the parser, and multiple attribute fields are created in the real-time data table, which are required to be named according to the key of the parsed value;

[0104] S250: Edge collaborator reads the database and uploads time series data to Cloud collaborator:

[0105] In one embodiment, a Cloud collaborator is configured on a cloud server, an Edge collaborator is configured on an edge controller, an edge-cloud communication interface is configured between the Cloud collaborator and the Edge collaborator, and a connection is established through IP address matching. The Edge collaborator monitors the dynamics of the local database, obtains time series data, and uploads it to the Cloud collaborator through the edge-cloud communication interface.

[0106] S260: Edge collaborator conveys information to other cloud modules such as scene models.

[0107] In one embodiment, the Cloud collaborator receives device data reported by the edge and forwards it to other modules of the cloud server, such as the scene model and data analysis. The scene variables of the variable mapping unit in the scene model obtain values, and the data analysis module visualizes the device data in the form of charts to monitor the reported time series data in real time.

[0108] Step 3: Please refer to Figure 3 ,The interface design steps between the scene model and the control model are as follows:

[0109] S300: The cloud control model determines the target scene and forwards the control information to the scene model;

[0110] In one embodiment, a scene identifier is configured in the cloud server to specify a target scene, and the control model sends control information to the scene model according to the scene identifier. The control information is represented by a JSON data format, where the key represents the control variable name and the value represents the control variable value;

[0111] Specifically, in one embodiment, in S300, the control process of the cloud server control model includes the following steps:

[0112] S301: Design a control panel in the control model, remotely control the device action through the control panel, and set multiple controls on the control panel, such as switches, indicator lights, text boxes, input boxes and other controls;

[0113] S302: Configure the properties of the control. The on state of the switch control is represented by '0', and the off state is represented by '1'. The input box represents the input value of the device data. The text box represents the control property field and is consistent with the variable name of the scene model. The button is used to specify the start and stop control of the scene control model.

[0114] S303: Select the target scene from the drop-down box, and press the start button of the target scene to control the running of the target scene;

[0115] S304: Set the device switch to the on state to control the operation of the device;

[0116] S305: The indicator light control can observe the switch status of the equipment during operation, and the input box displays the equipment analog data.

[0117] S310: The scene variables in the cloud scene model obtain values, and the Cloud collaborator sends the scene variable control information to the Edge collaborator;

[0118] Specifically, in one implementation, after the scene model receives the message, the scene variable obtains the corresponding variable value, the Cloud collaborator monitors the event of the scene model, and sends it to the Edge collaborator of the edge controller;

[0119] S320: The Edge collaborator stores the variable control information in the time series database, and the parser reads the database to obtain the variable control information;

[0120] S330: The service agent broker obtains variable control information from the parser through Topic communication and then forwards it to the terminal device;

[0121] S340: The terminal device identifies the variable control information and makes corresponding actions and data adjustments;

[0122] In one embodiment, the terminal device subscribes to the Topic to obtain the JSON data format, and identifies the data as switch actions and analog inputs;

[0123] S350: The data during the operation of the terminal device is fed back to the parser through the service broker;

[0124] S360: The parser parses the metadata of the device operation and then uploads it to the edge controller scene model

[0125] S370: The scene model of the edge controller transmits the variable data to the control model of the edge controller through the scene identifier;

[0126] In one implementation, a control model and a scenario model of an edge controller are constructed in a backend model editor, a scenario identifier is configured, which represents special data accompanying the scenario terminal device when reporting data, and the scenario model uploads the parsed data to a specified control model according to the scenario identifier;

[0127] S380: The control model determines whether the scene variable value meets the trigger condition and decides whether to recalculate and output the control variable value;

[0128] In one implementation, a trigger, a conditional operator, and an executor are configured in the control model of the edge controller, a control variable with the same name as the variable in the scene model is configured in the control model, a trigger condition is formulated in the trigger, an operation rule is configured in the conditional operator, the executor outputs the data, and then the control model determines whether the scene variable value meets the trigger condition to decide whether to recalculate and output the control variable value;

[0129] In the S380, if Figure 4 The execution process of the edge expander control model shown includes the following steps:

[0130] S381: The control model of the edge controller receives the JSON data format of the scene variable transmitted by the scene model. Since the scene variable name is equal to the control variable name, the control model indexes the control variable name according to the JSON data format to obtain the corresponding control variable value;

[0131] S382: The control variable value is substituted into the trigger, and the trigger determines the alarm information according to the threshold range;

[0132] S383: If the trigger judgment result is a safe state, execute step S385; if it is another alarm state, execute step S384;

[0133] S384: The conditional operator recalculates the control variable value according to the algorithm rules, outputs a new control variable value, substitutes it into the trigger again, and executes step S383;

[0134] S385: The actuator outputs the control variable value and sends it to the scene model.

[0135] S390: The control variable value is transmitted to the terminal device again through the scene model, parser, and broker of the edge controller, and the device takes relevant actions according to the control information;

[0136] In one embodiment, the control variable value passes through the scene model, parser, and broker of the edge controller in sequence, the terminal device subscribes to the Topic to obtain data, and the device makes corresponding switching actions and analog value adjustments by identifying the data information.

[0137] After the above steps are completed, step S350 is performed again.

[0138] The present application also provides an IoT scenario model, which is constructed using the above method and applied to an IoT monitoring system with a "cloud-edge-end" architecture. The model is suitable for a multi-variable, multi-controller distributed IoT monitoring system or a digital twin system. The IoT scenario model includes a cloud server, an edge controller, and a scenario i.

[0139] See also Figure 5 The cloud server configures the product management unit, device management unit, scene management unit and variable mapping unit of the cloud scene model 12 in the Internet of Things through the application interface API15; the variable mapping unit of the edge control end scene model 8 is configured with reference to the variable mapping unit of the cloud scene model 12.

[0140] Among them, the product management unit is used to create IoT products, the device management unit is used to register IoT terminal devices, the scene management unit is used to describe the scene, and the variable mapping unit is used to define the attributes of the scene variables.

[0141] In one embodiment, a Cloud collaborator 11 is configured in the cloud server, and an Edge collaborator 10 is configured in the edge controller. An edge-cloud communication interface is configured between the Cloud collaborator 11 and the Edge collaborator 10. The edge-cloud communication interface is connected based on the IP address matching of the Cloud collaborator 11 and the Edge collaborator 10. The Edge collaborator 10 monitors the information transmitted by other modules of the edge controller and uploads it to the Cloud collaborator 11. The Cloud collaborator 11 monitors the information transmitted by other modules of the cloud server and sends it to the Edge collaborator 10, thereby realizing data interaction between the cloud and the edge.

[0142] In one embodiment, see Figure 1 The edge controller is configured with a service agent broker 4 and a parser 5. The broker 4 supports at least one device communication protocol. The broker 4 obtains the metadata of the device operation by reading the terminal device communication protocol and identifying the authentication information of the device. The metadata is parsed by the parser 5 of the edge controller. The parser 5 performs edge computing at a location close to the data source. The edge computing includes configuring the source node, configuring data calculation and data filtering.

[0143] The edge controller is also configured with a local database, which creates a data timing data table. The attribute fields of the timing data table are named after the variable names of the edge control end scene model 8. When the field key of the parsed value matches the attribute field of the timing data table, the value corresponding to the field key of the parsed value is used as the numerical value corresponding to the attribute field of the timing data table. This data is called the edge control end timing data 7. The Edge collaborator 10 uploads the timing data to the Cloud collaborator 11 through the edge-cloud communication interface. The Cloud collaborator 11 then forwards the message to the data analysis module of the cloud server. The data analysis module monitors the reported cloud timing data 14 in real time in the form of charts.

[0144] In one embodiment, the edge controller constructs the edge control model and edge scenario model of the edge controller through the backend model editor 6. The edge control model controls the specified edge scenario model through the scenario identifier. The scenario identifier is a special data attached when the terminal device reports data, which is used to determine the specified scenario in which the device is located. The edge control model consists of three parts: a trigger, a conditional operator, and an actuator. The edge control model includes a control variable with the same name as the variable name in the edge scenario model. The trigger refers to the conditional operator that triggers the control variable value to recalculate the control variable value when the value of the control variable exceeds the threshold range. The conditional operator refers to performing multiple algorithm operations on the control variable value, and finally giving a safe and reliable control variable value to keep it within the threshold range. The actuator forwards the control variable value recalculated by the conditional operator to the edge scenario model. The variable information of the edge scenario model is sent to the parser 5. The parser 5 publishes the control information Topic through the service agent broker 4. The scene device subscribes to the Topic and identifies the action state and input data that need to be changed and performs related actions.

[0145] Among them, the edge control end control model 9 is equivalent to an automatic control device, which is used to process the alarm information generated by the running equipment. The cloud control model 13 is equivalent to a manual control device, which is used to issue tasks to the scene equipment that is not running. The cloud control model 13 remotely controls the equipment action through the control panel.

[0146] The cloud control model 13 converts the operation information on the control panel into a data structure similar to 'key:value' and forwards it to the cloud scene model 12. The Cloud collaborator 11 monitors the event changes of the cloud scene model 12, and sends the event attributes to the Edge collaborator 10 through edge-cloud collaboration. The Edge collaborator 10 stores the data in the local database. The parser 5 reads the data information in the database and publishes the control information Topic through the service agent broker 4. The scene device subscribes to the Topic and identifies the action status and input data that need to be changed and takes relevant actions. In a certain scenario, there are a first node 1, a second node 2, ..., an nth node 3. Feedback data of device operation is collected at the nodes and uploaded to a parser 5 through a broker 4. The feedback data passes through the parser 5, the edge control end scenario model 8, and then to the edge control end control model 9. The feedback data is finally converted into a data structure recognizable by the edge control end control model 9. The edge control end control model 9 determines whether the conditions for the trigger action are met based on the control variable values ​​in the data structure to determine whether the edge control end control model 9 is running. The output information of the control model is published to the broker 4 through the scenario model and the parser 5. The scenario device subscribes to the Topic and identifies the action status and input data that need to be changed and takes relevant actions to keep the device in a safe and stable working state.

[0147] The five modules of terminal device, broker 4, parser 5, edge control end scenario model 8, and edge control end control model 9 realize the collection, analysis, and diagnosis of device data from bottom to top, and then realize the control of device data from top to bottom, repeating the cycle continuously, allowing the edge controller to process a large amount of device data, reducing the burden of data processing on the cloud.

Claims

1. A method for building an IoT scenario model with low code, characterized in that: The following steps are involved: Step 1: Build a cloud scene model; Step 2: Edge-cloud collaboration of the scene model; the specific steps are as follows: S200: collecting terminal device data at the node; S210: The service agent broker obtains and temporarily stores device data by subscribing to the Topic; S220: The parser subscribes to the Topic and the broker publishes the Topic, and the parser obtains the device data; S230: The parser parses the device metadata according to the custom parsing operation; In S230, for configuration data calculation and data filtering, a data model for data parsing as shown below is constructed, including the following steps: S231: The device must be online to report data. Let i be any positive integer, D be the set of all devices in the target scenario, and d i is the i-th device in set D, S i For device d i Online status, then S232: The parser obtains Payload by subscribing to Topic through the broker. The Payload is presented in JSON data format. The Payload is bound to the mapping relationship between key and value. Let i and j be any positive integers, and specify k ij Subscribe the device d through the broker for the resolver i The topic gets the jth key in the Payload, v ij Subscribe the device d through the broker for the resolver i The jth value in the Payload obtained from the topic, then the value corresponding to the key is f(k ij )=v ij S i , according to the variable action type, the k ij It can be divided into switch variables and digital variables. The switch variables are further divided into switch input and switch output, and the digital variables are further divided into digital input and digital output. A variable filter is constructed. The variable filter can select k according to the variable action type. ij Filtering is performed to facilitate the next step S233 to confirm the object type of the configuration value operation; S233: Customize the configuration value operation of data parsing according to the actual scenario requirements. The configuration value operation is a logical processing of the original value. C is specified as the configuration value operation variable of data parsing. When the configuration value operation is gain, C=1; when the configuration value operation is bit-scaling, C=0. The gain is to operate a digital variable, that is, to multiply the actual value by a power of 10 to amplify or reduce the actual value for output. The bit-scaling is to operate a switch variable, that is, to convert a decimal number into a binary number, and any bit from the low bit to the high bit represents one of the switch variables. At the same time, it is specified that each bit can only correspond to one switch variable. The value range of the switch variable is 0 or 1. By default, '0' indicates that the switch is in the on state, and '1' indicates that the switch is in the off state. S234: In complex scenarios, considering the diversity of device switches, if the subscribed data contains a decimal number composed of multiple switch states of the device, the decimal number is converted into a binary number during the parsing process; define O i (x) is a bit value in a binary number. Its specific meaning is: the decimal number x is first converted into a binary number, and then the value of the i-th bit is determined starting from the rightmost bit and in order from right to left; then for any decimal number x, the corresponding binary number has the bit value Where s is any positive integer; S235: Based on step S234, specify For when k ij When it is a switch type variable, the variable name of the sth position after the bit operation, then when k ij When it is a switch type variable, the decimal number f(k ij ) is converted into a binary number, and then the variable name of the sth position is derived. The corresponding relationship with the place value is S236: Define V as the set of all variables in the scenario, that is, And k ij ∈ digital variable, select the two configuration value operations of gain and position, and combine k ij The variable action type starts parsing the device metadata obtained by subscription and constructs a function expression for data parsing Where p is an arbitrary integer; S237: For the device metadata obtained by the parser, after the data parsing in S236, finally obtain the variable V under the scene device r The corresponding true value is Where r is any positive integer, V r is the name of the rth variable in the target scenario; S240: The time series database stores and updates the parsed device data in real time; S250: Edge collaborator reads the database and uploads the time series data to Cloud collaborator; S260: Edge coordinator conveys information to the scene model and other cloud modules; Step 3: The cloud control model determines the target scenario and forwards the control information to the scenario model.

2. The method for constructing an IoT scenario model with low code according to claim 1 is characterized in that: The step one includes the following steps: S100: Building a scenario model: creating an IoT product in the cloud server and configuring the basic attributes of the product and the basic functions of product editing; S110: Create product and register device: register IoT terminal devices in the cloud server, configure basic properties of the device and basic functions of device editing; S120: Configuring scenario description and device deployment: Based on a specific scenario, multiple distributed terminal devices are equipped, and the interaction between the devices summarizes the scenario of the operation of the IoT scenario. The scenario management unit also includes the necessary terminal devices required to realize the scenario operation; S130: Configuring scene variables: The variable mapping unit in the cloud server configures scene variables, and customizes scene variables based on the target scene.

3. The method for constructing an IoT scenario model with low code according to claim 2 is characterized in that: The basic attributes of the product in S100 include product name, node type, gateway protocol, and authentication method; the basic functions of product editing include product adding, modifying, deleting, and querying functions; the basic functions of product editing also include restrictions on product editing.

4. The method for constructing an IoT scenario model with low code according to claim 2 is characterized in that: The basic attributes of the device in S110 include the product name, device name, and device communication topic. The basic functions of device editing include adding, modifying, deleting, and querying functions of the device and restrictions on device editing.

5. The method for constructing an IoT scenario model with low code according to claim 2 is characterized in that: The S120 scenario variables include variable name, variable type, node ID, Topic, and key; wherein the variable name is mainly device attributes and environmental factors, the variable type is allowed to be any form of integer, floating point, character, and frame data, the node ID determines the access location of the terminal device at the edge, the Topic is the topic subscribed and published when the device communicates through the service agent broker, and the key is the key in the JSON data format obtained from the communication Topic.

6. The method for constructing an IoT scenario model with low code according to claim 1, characterized in that: The specific steps of step three are as follows: S300: The cloud control model determines the target scene and forwards the control information to the scene model; S310: The scene variables in the cloud scene model obtain values, and the Cloud collaborator sends the scene variable control information to the Edge collaborator; S320: The Edge collaborator stores the variable control information in the time series database, and the parser reads the database to obtain the variable control information; S330: The service agent broker obtains variable control information from the parser through Topic communication and then forwards it to the terminal device; S340: The terminal device identifies the variable control information and makes corresponding actions and data adjustments; S350: The data during the operation of the terminal device is fed back to the parser through the service broker; S360: The parser parses the metadata of the device operation and then uploads it to the edge controller scenario model; S370: The scene model of the edge controller transmits the variable data to the control model of the edge controller through the scene identifier; S380: The control model determines whether the scene variable value meets the trigger condition and decides whether to recalculate and output the control variable value; S390: The control variable value passes through the edge controller's scene model, parser, and broker in sequence. The terminal device subscribes to the Topic to obtain data. The device makes corresponding switch actions and analog value adjustments by identifying the data information.

7. The method for constructing an IoT scenario model with low code according to claim 6 is characterized in that: In S300, the control process of the cloud server control model includes the following steps: S301: designing a control panel in the control model, remotely controlling the device action through the control panel, and setting a plurality of controls on the control panel, wherein the controls include a switch, an indicator light, a text box, and an input box; S302: Configure the properties of the control. The on state of the switch control is represented by '0', and the off state is represented by '1'. The input box represents the input value of the device data. The text box represents the control property field and is consistent with the variable name of the scene model. The button is used to specify the start and stop control of the scene control model. S303: Select the target scene from the drop-down box, and press the start button of the target scene to control the running of the target scene; S304: Set the device switch to the on state to control the operation of the device; S305: The indicator light control can observe the switch status of the equipment during operation, and the input box displays the equipment analog data.

8. The method for constructing an IoT scenario model with low code according to claim 7 is characterized in that: The execution process of the edge expander control model in S380 includes the following steps: S381: The control model of the edge controller receives the JSON data format of the scene variable transmitted by the scene model. Since the scene variable name is equal to the control variable name, the control model indexes the control variable name according to the JSON data format to obtain the corresponding control variable value; S382: The control variable value is substituted into the trigger, and the trigger determines the alarm information according to the threshold range; S383: If the trigger judgment result is a safe state, execute step S385; if it is another alarm state, execute step S940; S384: The conditional operator recalculates the control variable value according to the algorithm rules, outputs a new control variable value, substitutes it into the trigger again, and executes step S383; S385: The actuator outputs the control variable value and sends it to the scene model.