Internet of Things equipment linkage method and system
By dynamically selecting and configuring the linkage models and examples of IoT devices, the problem that ordinary users cannot dynamically adjust the linkage logic of IoT devices is solved, and the linkage logic control of IoT devices can be automatically run without professional programming capabilities.
Patent Information
- Application Number
- CN202411681415.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-07
AI Technical Summary
In industrial IoT application scenarios, changing the working state of the on-site IoT devices requires linkage logic program operations based on business logic requirements and data collected on-site. However, the existing technology requires users to have high programming capabilities, and ordinary users cannot dynamically adjust the linkage logic operation scheme.
Provides an IoT device linkage method and system. By obtaining the linkage model list and linkage instance list of IoT devices, dynamically selecting the linkage model corresponding to the business logic requirements, generating and configuring linkage instances, issuing configuration information to the IoT device, and realizing automatic operation logic control.
The linkage instances of IoT devices can be dynamically configured without the need for users to have professional programming capabilities, reducing the difficulty of users configuring IoT linkage logic and realizing automatic operation logic control.
Smart Images

Figure CN119583343A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a method and system for linking Internet of Things devices. Background Art
[0002] In industrial Internet of Things application scenarios, the change of working status of on-site Internet of Things devices needs to be combined with business logic requirements (such as process control flow) and the linkage logic program operation is performed based on the data collected on-site to control the device to change its working status.
[0003] Among them, linkage logic operations are usually written into IoT control devices by professional technicians using professional tools on site through programming. On-site debugging and maintenance require the debuggers to have high programming skills, and ordinary users cannot dynamically adjust the linkage logic operation scheme according to the on-site conditions. Therefore, there is an urgent need for an IoT device linkage method that can dynamically configure the linkage instance associated with the IoT device without the user having professional programming skills, and reduce the difficulty of users dynamically configuring the linkage logic according to the on-site conditions. Summary of the invention
[0004] The present application provides an Internet of Things device linkage method and system, which can enable users to dynamically configure linkage instances associated with the Internet of Things devices according to on-site conditions, thereby reducing the difficulty of users configuring the Internet of Things device linkage logic.
[0005] In a first aspect, the present application provides an IoT device linkage method, which is applied to a configuration system, and the method includes:
[0006] Acquire a linkage model list and a linkage instance list corresponding to an IoT device, wherein the linkage model list includes at least one linkage model, and the linkage instance list includes a linkage instance corresponding to at least one linkage model; and the IoT device pre-sets at least one linkage model;
[0007] Acquire a linkage model corresponding to the business logic requirements of the Internet of Things device from the linkage model list;
[0008] Based on the linkage instance list, generating a linkage instance corresponding to the linkage model;
[0009] Configure the configuration items in the linkage instance to obtain configuration information;
[0010] In response to an update instruction for updating the configuration information of the linkage instance, the update instruction and the configuration information of the linkage instance are issued to the Internet of Things device so that the Internet of Things device updates the configuration information of the linkage instance.
[0011] Optionally, the method further comprises:
[0012] In response to a deletion instruction for deleting the configuration information of the linkage instance, the deletion instruction and the configuration information of the linkage instance are sent to the Internet of Things device so that the Internet of Things device deletes the linkage instance.
[0013] Optionally, the method further comprises:
[0014] Identify linkage logic requirements in at least one application scenario of the IoT device;
[0015] According to the linkage logic requirements, respectively write at least one linkage model corresponding to at least one application scenario;
[0016] Obtaining the linkage logic task corresponding to the IoT device;
[0017] At least one of the linkage models is written into the linkage logic task.
[0018] Optionally, the method further comprises:
[0019] Sending a connection request to the IoT device;
[0020] After successfully connecting to the IoT device, an acquisition request is sent to the IoT device, where the acquisition request is used to acquire the linkage model list and the linkage instance list corresponding to the IoT device.
[0021] Optionally, the configuration item includes a selection variable, and the selection variable includes an internal input variable and an internal output variable; and configuring the configuration item in the linkage instance to obtain configuration information includes:
[0022] The internal input variables and the internal output variables in the linkage instance are configured with a linkage model name, a linkage instance name, an allocation method and a variable description, wherein the allocation method includes an automatic allocation method or a manual allocation method.
[0023] Optionally, the configuration item includes a selection variable, the selection variable includes an external input variable and an external output variable, and the configuring the configuration item in the linkage instance and obtaining the configuration information includes:
[0024] The device type, device number and device point are configured for the external input variable and the external output variable in the linkage instance.
[0025] In a second aspect, an embodiment of the present application further provides a method for linking IoT devices, which is applied to IoT devices, and the method includes:
[0026] Receive an acquisition request sent by the configuration system, the acquisition request is used to acquire a linkage model list and a linkage instance list, the linkage model list includes at least one linkage model; the Internet of Things device presets at least the one linkage model; the linkage instance list includes a linkage instance corresponding to at least one linkage model;
[0027] Reporting the linkage model list and the linkage instance list;
[0028] Receiving an update instruction issued by the configuration system and the configuration information of the linkage instance, wherein the update instruction is used to instruct to update the configuration information of the linkage instance;
[0029] Update the configuration information of the linkage instance.
[0030] Optionally, the method further comprises:
[0031] Parse the configuration information of the linkage instance, and obtain the unified data address of the selected variable through the IoT device point table;
[0032] The data address of the selection variable in the configuration information of the linkage instance is updated according to the unified data address.
[0033] Optionally, the method further comprises:
[0034] Acquire a linkage logic task corresponding to the IoT device; the linkage logic task includes at least one linkage model;
[0035] Traversing the linkage model in the linkage logic task;
[0036] Querying configuration information of the linkage model;
[0037] If the linkage model does not have configuration information, returning to execute the linkage model in the traversal linkage logic task;
[0038] If the linkage model has configuration information, obtaining a linkage instance in the linkage model, where the linkage instance is a configured and enabled linkage instance;
[0039] When there are valid variables in the configuration information of the linkage instance, the business logic program in the linkage model is executed to obtain a logic operation result; the business logic program is written and generated by calling the logic operation module in the Internet of Things device based on the business logic requirements of the application scenario of the Internet of Things device;
[0040] The internal variable output value and the external variable output value are processed and output according to the logic operation result, and the process of traversing the linkage models in the linkage logic task is returned to be executed until the last linkage model in the linkage logic task is obtained.
[0041] In a third aspect, an embodiment of the present application further provides an Internet of Things device linkage system, the Internet of Things device linkage system comprising: a configuration system and an Internet of Things device;
[0042] The Internet of Things device is used to receive an acquisition request sent by the configuration system, the acquisition request is used to acquire a linkage model list and a linkage instance list, the linkage model list includes at least one linkage model; the Internet of Things device presets at least one linkage model; the linkage instance list includes a linkage instance corresponding to at least one linkage model;
[0043] The IoT device is further used to report the linkage model list and the linkage instance list;
[0044] The configuration system is used to obtain the linkage model list and the linkage instance list corresponding to the Internet of Things device;
[0045] The configuration system is further used to obtain a linkage model corresponding to the business logic requirements of the Internet of Things device from the linkage model list;
[0046] The configuration system is further used to generate a linkage instance corresponding to the linkage model based on the linkage instance list;
[0047] The configuration system is further used to configure the configuration items in the linkage instance and obtain configuration information;
[0048] The configuration system is further configured to respond to an update instruction for updating the configuration information of the linkage instance and send the update instruction and the configuration information of the linkage instance to the Internet of Things device;
[0049] The IoT device is further configured to receive the update instruction and the configuration information of the linkage instance issued by the configuration system;
[0050] The Internet of Things device is also used to update the configuration information of the linkage instance.
[0051] It can be seen that this application has the following beneficial effects:
[0052] The present application provides a method and system for the linkage of Internet of Things devices. In the method, a linkage model list and a linkage instance list corresponding to the Internet of Things device are obtained, the linkage model list includes at least one linkage model, and the linkage instance list includes a linkage instance corresponding to at least one linkage model; a linkage model corresponding to the business logic requirements of the Internet of Things device is obtained from the linkage model list; a linkage instance corresponding to the linkage model is generated based on the linkage instance list; configuration items in the linkage instance are configured to obtain configuration information; in response to an update instruction for updating the configuration information of the linkage instance, an update instruction and the configuration information of the linkage instance are issued to the Internet of Things device so that the Internet of Things device updates the configuration information of the linkage instance. In this way, a linkage model can be dynamically selected according to the on-site selection and use situation, and a linkage instance corresponding to the selected linkage model can be configured. After the configuration is completed, the configuration information is issued to the Internet of Things device so that the Internet of Things device updates the configuration information of the linkage instance and realizes automatic operation logic control. In the whole process, the user does not need to master professional programming skills to complete the business logic configuration required by the on-site Internet of Things device, which reduces the difficulty of the user configuring the Internet of Things linkage logic. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0054] Figure 1 A schematic diagram of the structure of an Internet of Things device linkage system 100 provided in an embodiment of the present application;
[0055] Figure 2 This is a flow chart of a method for linking IoT devices in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of the structure of the linkage logic tasks and linkage model provided in the embodiment of the present application;
[0057] Figure 4 A schematic diagram of a linkage model list and a linkage instance list provided in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of a tunnel lighting segmented control linkage model provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of the lighting and fan linkage model of the integrated pipe gallery provided in the embodiment of the present application;
[0060] Figure 7 A schematic diagram of a linkage example provided in an embodiment of the present application;
[0061] Figure 8 A flow chart of the IoT device execution linkage model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0063] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It is understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In addition, it should be noted that, for ease of description, only the parts related to the present application are shown in the accompanying drawings, not all structures.
[0064] At present, the linkage logic operation of IoT devices is usually written into the IoT control device by professional technicians using professional tools on site through programming. On-site debugging and maintenance require the debuggers to have high programming skills, and ordinary users cannot dynamically adjust the linkage logic operation scheme according to the on-site conditions. Therefore, there is an urgent need for an IoT device linkage method that can dynamically configure the linkage instance associated with the IoT device without the user having professional programming skills, and reduce the difficulty of users dynamically configuring the linkage logic according to the on-site conditions.
[0065] Based on this, an embodiment of the present application provides an Internet of Things device linkage method and system, in which a linkage model list and a linkage instance list corresponding to the Internet of Things device are obtained, the linkage model list includes at least one linkage model, and the linkage instance list includes a linkage instance corresponding to the at least one linkage model; the linkage model corresponding to the business logic requirement of the Internet of Things device is obtained from the linkage model list; based on the linkage instance list, a linkage instance corresponding to the linkage model is generated; the configuration items in the linkage instance are configured to obtain configuration information; in response to an update instruction for updating the configuration information of the linkage instance, the update instruction and the configuration information of the linkage instance are issued to the Internet of Things device, so that the Internet of Things device updates the configuration information of the linkage instance.
[0066] In this way, users can dynamically select a linkage model based on on-site usage and configure a linkage instance corresponding to the selected linkage model. After configuration is complete, the configuration information can be sent to the IoT device so that the IoT device can update the configuration information of the linkage instance and realize automatic operation logic control. During the entire process, users do not need to master professional programming skills to complete the business logic configuration required by on-site IoT devices, reducing the difficulty of users configuring IoT linkage logic.
[0067] To facilitate understanding of the specific implementation of the IoT device linkage method provided in the embodiment of the present application, the following will be described in conjunction with the accompanying drawings.
[0068] It should be noted that the subject implementing the method for linking the IoT devices may be the IoT device linking device provided in the embodiment of the present application, or may be carried in an electronic device or a functional module of an electronic device. The electronic device in the embodiment of the present application may be any device capable of implementing the method for linking the IoT devices in the embodiment of the present application, for example, an IoT device linking system.
[0069] The Internet of Things device linkage system may be, for example, an Internet of Things device linkage system 100, such as Figure 1 As shown, the IoT device linkage system 100 includes an IoT device 101 and a configuration system 102;
[0070] The Internet of Things device 101 is used to receive an acquisition request sent by the configuration system, the acquisition request is used to acquire a linkage model list and a linkage instance list, the linkage model list includes at least one linkage model; the Internet of Things device presets at least one linkage model; the linkage instance list includes a linkage instance corresponding to at least one linkage model;
[0071] The Internet of Things device 101 is further used to report the linkage model list and the linkage instance list;
[0072] The configuration system 102 is used to obtain the linkage model list and the linkage instance list corresponding to the IoT device;
[0073] The configuration system 102 is further used to obtain a linkage model corresponding to the business logic requirements of the Internet of Things device from the linkage model list;
[0074] The configuration system 102 is further used to generate a linkage instance corresponding to the linkage model based on the linkage instance list;
[0075] The configuration system 102 is also used to configure the configuration items in the linkage instance and obtain configuration information;
[0076] The configuration system 102 is further configured to respond to an update instruction for updating the configuration information of the linkage instance and send the update instruction and the configuration information of the linkage instance to the IoT device.
[0077] The IoT device 101 is further configured to receive the update instruction and the configuration information of the linkage instance issued by the configuration system;
[0078] The Internet of Things device 102 is also used to update the configuration information of the linkage instance.
[0079] In this way, in the embodiment of the present application, the linkage model required for each application scenario is preset in the Internet of Things device 102. The user does not need to have professional programming skills. The user only needs to select an applicable linkage model according to on-site needs through the configuration system 101, and configure the information of the linkage instance in the linkage model. After the configuration is completed, it is sent to the Internet of Things device 101. The Internet of Things device 101 automatically runs the linkage logic control according to the user configuration information, thereby realizing the linkage of Internet of Things devices.
[0080] See also Figure 2 , Figure 2 A flowchart of an Internet of Things device linkage method provided in an embodiment of the present application.
[0081] In the embodiment of the present application, for example, the following steps may be included:
[0082] S11, the IoT device 101 receives an acquisition request sent by the configuration system 102, where the acquisition request is used to acquire a linkage model list and a linkage instance list.
[0083] Among them, the linkage model list includes at least one linkage model; the Internet of Things device presets at least one linkage model; and the linkage instance list includes linkage instances corresponding to at least one linkage model.
[0084] It should be noted that the configuration system may be, for example, a browser or configuration software, through which the linkage model of the IoT device may be configured.
[0085] In a possible implementation, before S11, the method provided in the embodiment of the present application may further include:
[0086] S20, the configuration system 102 sends a connection request to the IoT device 101.
[0087] That is to say, after the configuration system is successfully connected to the IoT device, the configuration system sends an acquisition request to the IoT device, and the acquisition request is used to obtain the linkage model list and linkage instance list corresponding to the IoT device.
[0088] S12, the IoT device 101 reports a linkage model list and a linkage instance list.
[0089] S21, the configuration system 102 obtains a linkage model list and a linkage instance list corresponding to the IoT device 101.
[0090] It should be noted that the linkage model in the IoT device is pre-set in the linkage device model based on the linkage logic requirements.
[0091] Then, the method provided in the embodiment of the present application may further include:
[0092] Identify the linkage logic requirements of IoT devices in at least one application scenario;
[0093] According to the linkage logic requirements, write at least one linkage model corresponding to at least one application scenario;
[0094] Get the linkage logic tasks corresponding to IoT devices;
[0095] At least one linkage model is written into the linkage logic task.
[0096] See also Figure 3 , which is a structural diagram of a linkage logic task and a structural diagram of a linkage model provided in an embodiment of the present application. Among them, predefined variables are defined in the linkage model. It should be noted that the linkage model in the embodiment of the present application belongs to a preset program and is not directly associated with specific variables when writing a program. Therefore, predefined variables are set in the linkage model. The predefined variables include internal input variables, internal output variables, external input variables and external output variables, and the preset logic operation module in the Internet of Things device is called, and the business logic control requirements of the application scenario are written into a business logic program according to the predefined variables.
[0097] It should be noted that the internal input variables can be assigned an initial value at one time during initialization. The initial value is derived from the general requirements of the application scenario and the requirements of the standard specifications. The internal output variables, external input variables and external output variables are not assigned specific values. The internal input variables and external input variables are all read from the data reading and writing module in the IoT device after the configuration parsing module in the IoT device parses the configuration information. The output values of the internal output variables and the output values of the external output variables are assigned by the execution results of the linkage model. After the output values of the internal output variables and the external output variables change, the configuration parsing module parses the user configuration information and outputs them to the outside through the data reading and writing module.
[0098] The linkage configuration task and the input / output task are associated with the linkage logic task. The input / output task is used to collect data and output results. The linkage configuration task is used to provide a linkage logic configuration interface and receive configuration information. The input / output task includes external input and internal input, a uniformly coded data pool, and external output and internal output. The linkage logic task includes linkage model 1, linkage model 2…linkage model n. The linkage configuration task includes linkage instance 1, linkage instance 2…linkage instance n.
[0099] In a possible implementation, after obtaining the linkage model list and the linkage instance list, the configuration system displays the linkage model list and the linkage instance list, the model description of each linkage model, and the variable list of each linkage model.
[0100] See also Figure 4 , Figure 4 A schematic diagram of the linkage model list and linkage instance list provided in this application.
[0101] Among them, the linkage model list includes tunnel lighting segment control linkage model, corridor fan lighting linkage model and human body sensing linkage model, and the linkage instance list includes comprehensive cavern 01, LD1-2, LD1-3, LD2-1 and LD3-1.
[0102] See also Figure 5 , Figure 5 This is a schematic diagram of the tunnel lighting segmented control linkage model provided in this application.
[0103] For the tunnel lighting segmented control linkage model, the applicable scenarios are railway tunnel lighting scenarios and highway tunnel lighting scenarios. The linkage description is that after the linkage is enabled, when any button is pressed (button state = 1), the device will act (control point = 1); the linkage logic diagram of the tunnel lighting segmented control linkage model is displayed; the variable list is displayed, and the variable list includes the internal input variable list, the internal output variable list, the external input variable list, and the external output variable list.
[0104] See also Figure 6 , Figure 6 Schematic diagram of the integrated pipeline corridor lighting and fan linkage model provided in this application.
[0105] For the integrated pipe gallery lighting and fan linkage model, it is applicable to the integrated pipe gallery scenario. The linkage description is that after the linkage is enabled, when any gas sensor in the partition has abnormal data and the fan and lighting are in the off state, the fan and lighting are turned on. When all gas sensors return to normal and the fan and lighting are in the running state, the fan and lighting are turned off. When the pipe gallery is in a normal state and the timing is enabled, the fan is turned on and off according to the set time. Display the variable list, which includes the internal input variable list, the internal output variable list, the external input variable list, and the external output variable list.
[0106] S22 , the configuration system obtains a linkage model corresponding to the business logic requirements of the Internet of Things device 101 from the linkage model list.
[0107] In the embodiment of the present application, the linkage model suitable for the current business logic requirements can be selected by configuring the system, and a linkage instance can be generated, and the corresponding input and output points are assigned to each variable. Point identifiers are added to the input and output points of the IoT devices, and the unified data address allocation can be automatic or manual, forming a total table of IoT device points.
[0108] S23, the configuration system generates a linkage instance corresponding to the linkage model based on the linkage instance list.
[0109] S24, configuring the configuration items in the linkage instance and obtaining configuration information.
[0110] It should be noted that the configuration items may include linkage instance number, remarks and selection variables.
[0111] For details, please refer to Figure 7 , Figure 7 A schematic diagram of the linkage instance LD1-3 provided in an embodiment of the present application.
[0112] In a possible implementation, the selected variables include internal input variables and internal output variables, and S24 may include: configuring a linkage model name, a linkage instance name, an allocation method, and a variable description for the internal input variables and the internal output variables in the linkage instance, where the allocation method includes an automatic allocation method or a manual allocation method.
[0113] It should be noted that there are two ways to allocate internal input variables and internal output variables, one is automatic allocation and the other is manual allocation.
[0114] When allocating automatically, you do not need to select a specific variable. Each linkage instance independently generates configuration information for internal input variables and internal output variables. When allocating manually, you need to select an existing variable.
[0115] The design difference between automatic allocation and manual allocation is that in automatic allocation, each linkage instance has its own internal input variables and internal output variables, and each internal input variable needs to be independently assigned. When the operating conditions of some linkage instances are different, configuration management can be better performed. However, when there are many linkage instances and the operating conditions of the linkage instances are the same, generating independent variables for assignment will increase the workload and is not easy to manage. At this time, you can switch to manual allocation and manually select a common internal input variable as the operating condition of the linkage instance.
[0116] For example, four linkage instances are generated based on the same linkage model. The conditions for enabling the linkage of these four linkage instances should be controlled according to the actual on-site needs of the IoT devices connected to these four linkage instances. This means that whether these four linkage instances enable the linkage does not follow the same conditions. At this time, the internal input variables of these four linkage instances should be automatically allocated to generate independent internal input variables for each linkage instance.
[0117] For example, 40 linkage instances are generated based on the same linkage model. These 40 linkage instances can be enabled and disabled at the same time. At this time, these 40 linkage instances can choose the automatic allocation method to generate independent internal input variables, but when enabling or disabling, the 40 variables need to be assigned. If the manual allocation method is selected, a common internal input variable can be selected. Only by controlling this common internal input variable, the 40 linkage instances can be adjusted to be enabled.
[0118] In a possible implementation, the selected variables include external input variables and external output variables, and S24 may include: configuring device types, device numbers, and device locations for the external input variables and external output variables in the linkage instance.
[0119] In the application embodiment, the linkage instance is configured on the newly generated linkage instance page. The configuration items include the linkage instance number, remarks, selection variables, etc. After the configuration is completed, the configuration is updated. The configuration system sends configuration information and update instructions to the IoT device. The address allocation module in the IoT device allocates a unified data address and executes the linkage logic task.
[0120] S25 , the configuration system 102 sends the update instruction and the configuration information of the linkage instance to the IoT device 101 in response to the update instruction for updating the configuration information of the linkage instance, so that the IoT device updates the configuration information of the linkage instance.
[0121] In the embodiment of the present application, after the user completes the linkage instance configuration, for example, the user can send the linkage instance configuration information to the IoT device through the "update configuration" interface of the configuration system. For details, please refer to Figure 7 .
[0122] In the specific implementation process, each linkage instance configuration information is recorded and issued in JSON format. The configuration information may include the linkage model name, linkage instance name, the allocation mode (pattern) of internal input variables, and the variable type, instance number, variable description, data address and real-time value of each variable; the allocation mode (pattern) of internal output variables, and the variable type, instance number, variable description, data address and real-time value of each variable; the device type, device number, device point, data address and real-time value of external input variables; the device type, device number, device point, data address and real-time value of external output variables. The data address and real-time value are temporarily set to "NULL".
[0123] JSON format data may include, for example:
[0124] {
[0125]
[0126]
[0127] In a possible implementation, the embodiment of the present application may further include S26, in response to a deletion instruction to delete the configuration information of the linkage instance, sending the deletion instruction and the configuration information of the linkage instance to the Internet of Things device so that the Internet of Things device deletes the linkage instance.
[0128] In the embodiment of the present application, when the linkage instance is no longer needed, information on deleting the linkage instance is sent to the IoT device, for example, through the "delete" interface of the configuration system.
[0129] In a possible implementation, after the linkage model is run, the variable values associated with the configured linkage instance can be periodically obtained. The method provided in the embodiment of the present application further includes:
[0130] Regularly obtain the variables and variable values corresponding to the linkage instances of the configured equipment points;
[0131] The linkage instances, variables and variable values are displayed accordingly.
[0132] In the embodiment of the present application, the configuration system may periodically obtain the variable values associated with the configured linkage instance; and display the associated variable values on the page of the linkage instance.
[0133] As an example, IoT devices report real-time values of internal output variables to the configuration system.
[0134] For example, the running code may include:
[0135] "inner_output_var":{
[0136] “Pattern”:”manual”,
[0137] "Var1":{
[0138] "type": "internal output",
[0139] "NO": "LD1_3",
[0140] “Point”: “Linkage execution result”,
[0141] "addr":15005,
[0142] “value”: “2024-9-24 15::32:31 Manual button K90017_SD turns off lighting = 1, triggering linkage lighting 1ZM-01, lighting 2ZM-02 turns on lighting”
[0143] }
[0144] }
[0145] S13, the IoT device receives the update instruction and the configuration information of the linkage instance issued by the configuration system 102.
[0146] The update instruction is used to instruct to update the configuration information of the linkage instance.
[0147] S14, the IoT device 101 updates the configuration information of the linkage instance.
[0148] In a possible implementation, S14 provided in the embodiment of the present application may include: parsing the configuration information of the linkage instance, obtaining a unified data address of the selected variable through the IoT device point summary table; and updating the data address of the selected variable in the configuration information of the linkage instance according to the unified data address.
[0149] In an embodiment of the present application, the address resolution module in the IoT device receives the configuration information of the linkage instance issued by the "Update Configuration" interface of the configuration system. The address resolution module reads the configuration information in JSON format, resolves the unified data address of the corresponding variable, and updates the unified data address to the configuration information of the linkage instance.
[0150] In the specific implementation process, there are two parsing methods: internal input variable, internal output variable parsing method and external input variable, external output variable parsing method.
[0151] Among them, the internal input variables and internal output variables are analyzed in the following way:
[0152] First, read the allocation pattern of internal input variables and internal output variables;
[0153] When the allocation mode is auto, the address resolution module obtains the remaining unallocated internal input variables and internal output variable addresses in the IoT point table, selects the remaining unallocated unified data address according to the data type of the internal input variables and internal output variables, and adds the unified data address to the "addr" of the corresponding variable of the configuration information of the linkage instance.
[0154] When the allocation method is manual, the address resolution module reads the "type", "NO", and "point" information of the internal input variables and internal output variables in the configuration information in turn, and reads the unified data address of the point matching the variable information from the IoT device point table, and adds the unified data address to the "addr" of the corresponding variable in the configuration information of the linkage instance.
[0155] For example, the running code may include:
[0156] "inner_output_var":{
[0157] “Pattern”:”manual”,
[0158] "Var1":{
[0159] "type": "internal output",
[0160] "NO": "LD1_3",
[0161] “Point”: “Linkage execution result”,
[0162] "addr":15005,
[0163] "value": NULL
[0164] }
[0165] }
[0166] Among them, the external input variables and external output variables are analyzed in the following ways:
[0167] The address parsing module reads the "type", "NO", and "point" information of the external input variables and external output variables in the configuration information in turn, and reads the unified data address of the point matching the variable information from the IoT device point table, and adds the unified data address to the "addr" of the corresponding variable of the configuration information of the linkage instance, such as:
[0168] "Var1":{
[0169] "type":"lighting",
[0170] "NO": "ZM_01",
[0171] "point": "Turn off lighting",
[0172] "addr": "00001",
[0173] "value": NULL
[0174] }
[0175] In a possible implementation, the address destruction module in the IoT device receives the configuration information of the linkage instance sent by the "deletion" interface of the configuration system, and the address destruction module completes the release of the automatically allocated unified data address, the deletion of the corresponding linkage instance and the configuration information according to the sent configuration information.
[0176] Among them, the configuration information of the linkage instance sent down includes at least the linkage model name and the linkage instance name. The address destruction module queries the allocation method of internal input variables and internal output variables according to the above configuration information. If the allocation method is "auto", all information of the corresponding variables in the IoT device point table is cleared, including at least the variable type, the instance number to which it belongs, the variable description and the unified data address.
[0177] In a possible implementation, after the association between the IoT device and the configuration information of the linkage instance is completed, the IoT device executes the associated linkage model.
[0178] Then, based on the above embodiment, the method provided in the embodiment of the present application may further include:
[0179] S31, obtaining a linkage logic task corresponding to an IoT device; the linkage logic task includes at least one linkage model.
[0180] S32, traversing the linkage model in the linkage logic task.
[0181] S33, query the configuration information of the linkage model.
[0182] S34: If the linkage model does not have configuration information, return to the linkage model in the linkage logic task of traversing the linkage model.
[0183] S35: If the linkage model has configuration information, obtain a linkage instance in the linkage model, where the linkage instance is a linkage instance that has been configured and enabled.
[0184] In a possible implementation, S35 may include:
[0185] Traverse the linkage instances in the linkage model;
[0186] Determine whether the configuration information of the linkage instance is valid;
[0187] If there are valid variables in the configuration information of the linkage instance, the business logic program in the linkage model is executed, and the linkage instance in the linkage model is returned and executed to traverse until the last linkage instance is obtained;
[0188] If there is no valid variable in the configuration information of the linkage instance, return to execute the linkage instances in the traversal linkage model until the last linkage instance is obtained.
[0189] S36, when there are valid variables in the configuration information of the linkage instance, the business logic program in the linkage model is executed to obtain a logic operation result.
[0190] The business logic program is written and generated by calling the logic operation module in the IoT device based on the business logic requirements of the IoT device application scenario. The logic operation module includes various logic operations and conditional judgment functions.
[0191] S37, processing the internal variable output value and the external variable output value according to the logic operation result and outputting them, returning to execute the linkage model in the traversal linkage logic task until the last linkage model in the linkage logic task is obtained.
[0192] In order to facilitate understanding of the specific implementation of the linkage model executed by the IoT device in the embodiment of the present application, the following is a description of how the IoT device in the present application executes the linkage model after association: Figure 8 , which is a flow chart of the IoT device executing the linkage model in the embodiment of the present application.
[0193] 1. After the IoT device enters the linkage logic task, it executes the linkage models in the linkage logic task in sequence.
[0194] 2. Determine whether there is configuration information for the linkage model.
[0195] 3. If there is no configuration information for the linkage model, determine whether there is the next linkage model: if so, enter the next logic program and repeat step 2 to query the configuration information; if not, end the linkage logic task.
[0196] 4. If the linkage model has configuration information, read the number of linkage instances that have been configured and enabled in the linkage model, and use the number as the number of linkage model cycles.
[0197] 5. When the loop is executed, the configuration information of the first linkage instance is read first, and the variable values are read according to the configuration information. By reading the variable values, it is determined whether each variable in the configuration information is valid.
[0198] In the specific implementation process, whether each variable in the configuration information is valid is judged according to preset conditions; the preset conditions include: the unified data address in the configuration information does not exist or the unified data address access error; a numerical value matching the variable type can be obtained through the configuration information; the variable value is not empty or the variable value is out of range; if at least one of the above preset conditions exists, the variable is judged to be invalid.
[0199] 6. If the variable is valid, the logical operation in the linkage model is executed, and the internal and external variable output values are processed according to the logical operation results. After the internal and external variable output values are output through the physical interface of the Internet of Things terminal, it indicates that the execution of this linkage instance is completed. The execution of the next linkage instance or the execution of the next linkage program is determined based on the number of executions + 1 ≥ the number of loops.
[0200] 7. If the variable is invalid, the execution count is increased by 1 and the configuration information of the next linkage instance is read, and the execution returns to 5.
[0201] In this way, through the embodiment of the present application, the IoT device executes the linkage model in sequence after entering the linkage logic task. The user does not need to master professional programming skills, and the IoT device can automatically run the linkage logic control according to the user configuration information, thereby reducing the difficulty for the user to dynamically configure the linkage logic according to the on-site conditions.
[0202] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0203] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only schematic, in which the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the goals of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0204] The above is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. It should be noted that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the present application, and these improvements and modifications should also be regarded as the protection scope of the present application.
Claims
1. A method for linking IoT devices, characterized in that: Applied to a configuration system, the method comprises: Acquire a linkage model list and a linkage instance list corresponding to an IoT device, wherein the linkage model list includes at least one linkage model, and the linkage instance list includes a linkage instance corresponding to at least one linkage model; and the IoT device pre-sets at least one linkage model; Acquire a linkage model corresponding to the business logic requirements of the Internet of Things device from the linkage model list; Based on the linkage instance list, generating a linkage instance corresponding to the linkage model; Configure the configuration items in the linkage instance to obtain configuration information; In response to an update instruction for updating the configuration information of the linkage instance, the update instruction and the configuration information of the linkage instance are issued to the Internet of Things device so that the Internet of Things device updates the configuration information of the linkage instance.
2. The method according to claim 1, characterized in that The method further comprises: In response to a deletion instruction for deleting the configuration information of the linkage instance, the deletion instruction and the configuration information of the linkage instance are sent to the Internet of Things device so that the Internet of Things device deletes the linkage instance.
3. The method according to claim 1, characterized in that The method further comprises: Identify linkage logic requirements in at least one application scenario of the IoT device; According to the linkage logic requirements, respectively write at least one linkage model corresponding to at least one application scenario; Obtaining the linkage logic task corresponding to the IoT device; At least one of the linkage models is written into the linkage logic task.
4. The method according to claim 1, characterized in that The method further comprises: Sending a connection request to the IoT device; After successfully connecting to the IoT device, an acquisition request is sent to the IoT device, where the acquisition request is used to acquire the linkage model list and the linkage instance list corresponding to the IoT device.
5. The method according to claim 1, characterized in that The configuration item includes a selection variable, and the selection variable includes an internal input variable and an internal output variable; the configuration item in the linkage instance is configured to obtain configuration information, including: The internal input variables and the internal output variables in the linkage instance are configured with a linkage model name, a linkage instance name, an allocation method and a variable description, wherein the allocation method includes an automatic allocation method or a manual allocation method.
6. The method according to claim 1, characterized in that The configuration item includes a selection variable, the selection variable includes an external input variable and an external output variable, and the configuration item in the linkage instance is configured to obtain configuration information, including: The device type, device number and device point are configured for the external input variable and the external output variable in the linkage instance.
7. A method for linking IoT devices, characterized in that: Applied to an IoT device, the method comprises: Receive an acquisition request sent by the configuration system, the acquisition request is used to acquire a linkage model list and a linkage instance list, the linkage model list includes at least one linkage model; the Internet of Things device presets at least the one linkage model; the linkage instance list includes a linkage instance corresponding to at least one linkage model; Reporting the linkage model list and the linkage instance list; Receiving an update instruction issued by the configuration system and the configuration information of the linkage instance, wherein the update instruction is used to instruct to update the configuration information of the linkage instance; Update the configuration information of the linkage instance.
8. The method according to claim 7, characterized in that The updating of the configuration information of the linkage instance includes: Parse the configuration information of the linkage instance, and obtain the unified data address of the selected variable through the IoT device point table; The data address of the selection variable in the configuration information of the linkage instance is updated according to the unified data address.
9. The method according to claim 7, characterized in that: The method further comprises: Acquire a linkage logic task corresponding to the IoT device; the linkage logic task includes at least one linkage model; Traversing the linkage model in the linkage logic task; Querying configuration information of the linkage model; If the linkage model does not have configuration information, returning to execute the linkage model in the traversal linkage logic task; If the linkage model has configuration information, obtaining a linkage instance in the linkage model, where the linkage instance is a configured and enabled linkage instance; When there are valid variables in the configuration information of the linkage instance, the business logic program in the linkage model is executed to obtain a logic operation result; the business logic program is written and generated by calling the logic operation module in the Internet of Things device based on the business logic requirements of the application scenario of the Internet of Things device; The internal variable output value and the external variable output value are processed and output according to the logic operation result, and the execution of traversing the linkage models in the linkage logic task is returned until the last linkage model in the linkage logic task is obtained.
10. An Internet of Things device linkage system, characterized in that: The IoT device linkage system comprises: a configuration system and IoT devices; The IoT device is configured to receive an acquisition request sent by the configuration system, wherein the acquisition request is used to acquire a linkage model list and a linkage instance list, wherein the linkage model list includes at least one linkage model; the IoT device presets at least one linkage model; and the linkage instance list includes linkage instances corresponding to at least one linkage model; The IoT device is further used to report the linkage model list and the linkage instance list; The configuration system is used to obtain the linkage model list and the linkage instance list corresponding to the Internet of Things device; The configuration system is further used to obtain a linkage model corresponding to the business logic requirements of the Internet of Things device from the linkage model list; The configuration system is further used to generate a linkage instance corresponding to the linkage model based on the linkage instance list; The configuration system is further used to configure the configuration items in the linkage instance and obtain configuration information; The configuration system is further configured to respond to an update instruction for updating the configuration information of the linkage instance and send the update instruction and the configuration information of the linkage instance to the Internet of Things device; The IoT device is further configured to receive the update instruction and the configuration information of the linkage instance issued by the configuration system; The Internet of Things device is also used to update the configuration information of the linkage instance.