Cross-platform Internet of Things configuration method

Through a cross-platform IoT configuration method based on Angular and fabric.js, combined with a multi-protocol communication point table, the ease-of-use and compatibility problems of IoT configuration software in the existing technology are solved, and efficient device data display and control, reducing development and maintenance costs.

CN118827720AActive Publication Date: 2024-10-22SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411082088.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-10-22
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

The existing IoT field lacks configuration software that is easy to use and supports cross-platform, resulting in high development and maintenance costs, inconsistent user experience, and difficulty in compatibility with different device scenarios.

Method used

It adopts a cross-platform IoT configuration method based on Angular language and fabric.js plug-in, and implements logical binding through the editing and storage of multi-protocol communication point tables. It is divided into display components and control components, supports Modbus protocol, and uses table form to quickly register. Device properties and binding within Web configuration.

Benefits of technology

It achieves cross-platform compatibility, improves the ease of use of configuration, establishes an efficient data channel, reduces development and maintenance costs, and optimizes the display and control experience of equipment operating status and data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118827720A_ABST
    Figure CN118827720A_ABST
Patent Text Reader

Abstract

The invention particularly relates to a cross-platform Internet of Things configuration method. According to the cross-platform Internet of Things configuration method, logic binding of an Anglar language Fabric.js plug-in and a multi-protocol communication point table is realized based on editing storage of the Anglar language Fabric.js plug-in and the multi-protocol communication point table; binding objects of the web configuration component are divided into a display component and a control component; wherein the display component comprises a data panel and a chart panel, and the control component comprises a button and an input box; the communication protocol point table supports a modbus protocol, and equipment attributes are quickly registered and issued in a table form; and quickly binding the communication protocol point table in the web configuration based on the web configuration component and the communication protocol point table. The cross-platform Internet of Things configuration method can be compatible with different equipment use scenes, the usability of configuration is improved, an efficient data channel is established, the equipment operation state and data are visually displayed, the development and maintenance cost is reduced, and the use experience is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of front-end development, and in particular to a cross-platform Internet of Things configuration method. Background Art

[0002] With the rapid development of the Internet, the convenience of the network has penetrated into people's daily life and work, and the Internet of Things is one of the most prominent application areas.

[0003] The Internet of Things refers to a network of interconnected objects. It uses information sensing devices and follows established protocols to closely connect devices to the network. These devices exchange and communicate information through the media of information transmission, thereby realizing functions such as intelligent identification, positioning, tracking and control.

[0004] Especially in the industrial world, being able to view the operating status of equipment in real time and master its operating data has become a very valuable matter. Therefore, for practitioners in the field of the Internet of Things, the potential value of developing a configuration software that is both easy to use and supports cross-platform is immeasurable both from a practical and commercial perspective.

[0005] In order to be compatible with different device usage scenarios, maintain a unified user experience, and reduce development and maintenance costs, the present invention proposes a cross-platform Internet of Things configuration method. Summary of the invention

[0006] In order to overcome the defects of the prior art, the present invention provides a simple and efficient cross-platform Internet of Things configuration method.

[0007] The present invention is achieved through the following technical solutions:

[0008] A cross-platform IoT configuration method based on the Angular language fabric.js plug-in and the editing and storage of multi-protocol communication point tables to achieve logical binding between the two;

[0009] The binding objects of the web configuration component are divided into display components and control components; among them, the display components include data panels and chart panels, and the control components include buttons and input boxes;

[0010] The communication protocol point table supports the modbus protocol, and quickly registers and issues device attributes in the form of a table;

[0011] Based on the web configuration components and the communication protocol point table, the communication protocol point table is quickly bound in the web configuration.

[0012] The following steps are involved:

[0013] Step S1: Develop Web configuration components

[0014] Use the selector to draw graphics for app-draw; in the basic version, the Web configuration component has the functions of control dragging, image drawing, SVG drawing, element size and color setting, form component support and chart drawing;

[0015] Introduce @angular / animations module to add interactive animations to page elements; introduce FormsModule module and ReactiveModule module to implement form control development; introduce DragDropModule module to implement element dragging;

[0016] The Web configuration component path is src / app / cleverlink / draw. The same-level directory contains board.service.ts and button.service.ts services, which provide method support for different configuration elements.

[0017] Step S2: Bind communication point table

[0018] Binding the configuration component with communication function to the point table parameters is essentially to store the ID of the data point, the device to which the data point belongs, and the gateway information through base64 encoding into the web configuration component properties. The component properties are saved and run along with the configuration; then run the configuration to realize the device data viewing and device control functions through the bound components.

[0019] In step S1, the @angular / animations module provides an animation API that can implement CSS animation effects including translation, zooming in, zooming out, and sliding in and out; this configuration uses transition animation to implement switching and translation effects of controls in the configuration control panel;

[0020] When the user selects, switches, and cancels configuration elements on the configuration canvas, the control panel displays different control groups based on the element type; in order to achieve a smooth transition effect, the @angular / animations module is used to provide transition animation effects for displaying and hiding controls.

[0021] Introduce FormsModule and ReactiveModule to create responsive forms. When Web configuration involves reading, displaying, and sending data, data binding, input boxes, and buttons of the Angular framework are required. Use the responsive form provided by the Angular framework to process user input and realize centralized management of configuration data.

[0022] In the step S1, relevant Angular basic modules are introduced, and the component DrawComponent is created using the decorator @Component;

[0023] Create the draw.component.html file, which includes the top toolbar, the left material panel, the configuration canvas, and the right control panel.

[0024] Among them, the top toolbar provides common functions including copying, pasting, deleting, zooming in and out of configuration elements; the material panel on the left uses the tab tag to load material resources including controls, SVG files and pictures; the configuration canvas uses the html canvas element, and then initializes it using the fabric.js plug-in in the ts file; the control panel on the right uses the tab tab to load the view control panel and data processing panel.

[0025] The TopBarComponent component of the top toolbar, the MaterialComponent component of the left material panel, and the ControlComponent component of the right control panel are developed separately.

[0026] The configuration canvas uses the core class fabric.Canvas to obtain the canvas element in HTML to initialize it; after the initialization is completed, the action of the canvas element is monitored to respond to the change of the element state.

[0027] When the fabric.js plug-in initializes the canvas element, first introduce the fabric.min.js file in the angular.json file, declare the fabric object in the DrawComponent component, and use the fabric object to initialize the canvas element and add the listening code when the DrawComponent component is initialized.

[0028] In step S1, the html native method is used to monitor the drag action of the html element and bind a processing function to it; when the mouse is lifted, if the element is in the canvas element, the current coordinates of the element are calculated, and the fabric.js method is used to add the corresponding element type to the canvas element; the implementation process is briefly described as follows:

[0029] Add the draggable attribute to all material images, set it to true, add the dragstart attribute and dragend attribute, and bind the processing function;

[0030] First, calculate the distance x1 from the left side of the canvas to the left side of the screen. When the element is dragged, calculate the distance x2 from the left side of the element to the left side of the screen. The difference between the distance x2 from the left side of the element to the left side of the screen and the distance x1 from the left side of the canvas to the left side of the screen is the distance between the element and the left border of the canvas.

[0031] When the distance between the element and the left edge of the canvas is greater than 0 and less than the sum of the distance from the left side of the canvas to the left side of the screen x1 and the width of the canvas, it means that the element is already in the canvas within the horizontal range; similarly, calculate whether the element is in the canvas within the vertical distance;

[0032] When the element is in the canvas both horizontally and vertically, the element coordinates are calculated and the corresponding element is loaded into the canvas using fabric.js native methods.

[0033] In the step S1, the Fabric.js plug-in supports adding lines, geometric figures and text elements to the canvas; a simple display box is realized through the combination of geometric figures and text for data display; a rectangle is added and click animation and click event are added to it, so that it is simulated as a button and used as a configuration switch; the DOM element is added to the canvas with the rect figure as the carrier to realize the input box control.

[0034] In step S2, a series of data points of the Modbus standard are defined in the communication protocol point table of the Modbus protocol, including register type, register address and slaveID (unique identification address of the slave device) parameters.

[0035] In the step S2, a unique ID is generated for each data point in the communication protocol point table of the modbus protocol; when the user edits the web configuration, the web configuration component is bound to the corresponding data point one-to-one;

[0036] Web configuration determines the applicability based on the component type and data point type. Button components are prohibited from binding to read-only data.

[0037] A cross-platform Internet of Things configuration device, characterized in that it includes a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the above-mentioned method steps when executing the computer program.

[0038] A readable storage medium, characterized in that: a computer program is stored on the readable storage medium, and the computer program implements the above method steps when executed by a processor.

[0039] The beneficial effects of the present invention are: the cross-platform Internet of Things configuration method can be compatible with different device usage scenarios, improve the usability of configuration, establish an efficient data channel, enable the device operating status and data to be intuitively displayed, reduce development and maintenance costs, and optimize the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Attached Figure 1 Schematic diagram of the cross-platform Internet of Things configuration method of the present invention. DETAILED DESCRIPTION

[0042] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0043] At present, the development of Web configuration components presents a diversified trend. Modbus protocol, as a mature and widely used industrial protocol, is combined with these components. Through component development, an efficient data channel can be established, so that the equipment operation status and data can be displayed intuitively.

[0044] This cross-platform IoT configuration method is based on the Angular language fabric.js plug-in and the editing and storage of the multi-protocol communication point table to achieve the logical binding of the two;

[0045] The binding objects of the web configuration component are divided into display components and control components; among them, the display components include data panels and chart panels, and the control components include buttons and input boxes;

[0046] The communication protocol point table supports the modbus protocol, and quickly registers and issues device attributes in the form of a table;

[0047] Based on the web configuration components and the communication protocol point table, the communication protocol point table is quickly bound in the web configuration.

[0048] The following steps are involved:

[0049] Step S1: Develop Web configuration components

[0050] Use the selector to draw graphics for app-draw; in the basic version, the Web configuration component has the functions of control dragging, image drawing, SVG drawing, element size and color setting, form component support and chart drawing;

[0051] In order to optimize the user experience, the @angular / animations module is introduced to add interactive animations to page elements; the FormsModule module and ReactiveModule module are introduced to implement form control development; the DragDropModule module is introduced to implement element dragging;

[0052] The Web configuration component path is src / app / cleverlink / draw. The same-level directory contains board.service.ts and button.service.ts services, which provide method support for different configuration elements such as display boxes and buttons;

[0053] In step S1, the @angular / animations module provides a rich animation API that can realize CSS animation effects including translation, zooming in, zooming out, and sliding in and out; this configuration uses transition animation to realize the switching and translation effects of controls in the configuration control panel;

[0054] When the user selects, switches, and cancels configuration elements on the configuration canvas, the control panel displays different control groups according to the element type. For example, when the user selects a text control, the control panel displays the font size setting control, font color control, etc. When the user cancels the selection of the canvas element, the corresponding control of the control panel font setting disappears. In order to achieve a smooth transition effect, the @angular / animations module is used to provide transition animation effects for the display and hiding of controls.

[0055] Introduce FormsModule and ReactiveModule to create responsive forms. When Web configuration involves reading, displaying, and sending data, data binding, input boxes, and buttons of the Angular framework are required. Use the responsive form provided by the Angular framework to process user input and realize centralized management of configuration data.

[0056] In the step S1, relevant Angular basic modules are introduced, and the component DrawComponent is created using the decorator @Component;

[0057] Create the draw.component.html file, which includes the top toolbar, the left material panel, the configuration canvas, and the right control panel.

[0058] Among them, the top toolbar provides common functions including copying, pasting, deleting, zooming in and out of configuration elements; the material panel on the left uses the tab tag to load material resources including controls, SVG files and pictures; the configuration canvas uses the html canvas element, and then initializes it using the fabric.js plug-in in the ts file; the control panel on the right uses the tab tab to load the view control panel and data processing panel.

[0059] The TopBarComponent component of the top toolbar, the MaterialComponent component of the left material panel, and the ControlComponent component of the right control panel are developed separately.

[0060] The configuration canvas uses the core class fabric.Canvas to obtain the canvas element in HTML to initialize it; after the initialization is completed, the action of the canvas element is monitored to respond to the change of the element state.

[0061] When the fabric.js plug-in initializes the canvas element, first introduce the fabric.min.js file in the angular.json file, declare the fabric object in the DrawComponent component, and use the fabric object to initialize the canvas element and add the listening code when the DrawComponent component is initialized.

[0062] In step S1, the html native method is used to monitor the drag action of the html element and bind a processing function to it; when the mouse is lifted, if the element is in the canvas element, the current coordinates of the element are calculated, and the fabric.js method is used to add the corresponding element type to the canvas element; the implementation process is briefly described as follows:

[0063] Taking pictures as an example, add the draggable attribute to all material pictures, set it to true, add the dragstart attribute and dragend attribute, and bind the processing function;

[0064] First, calculate the distance x1 from the left side of the canvas to the left side of the screen. When the element is dragged, calculate the distance x2 from the left side of the element to the left side of the screen. The difference between the distance x2 from the left side of the element to the left side of the screen and the distance x1 from the left side of the canvas to the left side of the screen is the distance between the element and the left border of the canvas.

[0065] When the distance between the element and the left edge of the canvas is greater than 0 and less than the sum of the distance from the left side of the canvas to the left side of the screen x1 and the width of the canvas, it means that the element is already in the canvas within the horizontal range; similarly, calculate whether the element is in the canvas within the vertical distance;

[0066] When the element is in the canvas both horizontally and vertically, the element coordinates are calculated and the corresponding element is loaded into the canvas using fabric.js native methods.

[0067] In the step S1, the Fabric.js plug-in supports adding lines, geometric figures and text elements to the canvas; a simple display box is realized through the combination of geometric figures and text for data display; a rectangle is added and click animation and click event are added to it, so that it is simulated as a button and used as a configuration switch; the DOM element is added to the canvas with the rect figure as the carrier to realize the input box control.

[0068] Step S2: Bind communication point table

[0069] Binding the configuration component with communication function to the point table parameters is essentially to store the ID of the data point, the device to which the data point belongs, and the gateway information through base64 encoding into the web configuration component properties. The component properties are saved and run along with the configuration; then run the configuration to realize the device data viewing and device control functions through the bound components.

[0070] In step S2, a series of data points of the Modbus standard are defined in the communication protocol point table of the Modbus protocol, including register type, register address and slaveID (unique identification address of the slave device) parameters, and the point table contains all attributes of a type of device.

[0071] In the step S2, a unique ID is generated for each data point in the communication protocol point table of the modbus protocol; when the user edits the web configuration, the web configuration component is bound to the corresponding data point one-to-one;

[0072] Web configuration determines the applicability based on the component type and data point type. Button components are prohibited from binding to read-only data.

[0073] The cross-platform Internet of Things configuration device includes a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the above method steps when executing the computer program.

[0074] The readable storage medium stores a computer program, and when the computer program is executed by a processor, the above method steps are implemented.

[0075] Compared with the existing technology, this cross-platform IoT configuration method has the following characteristics:

[0076] First of all, it supports multiple protocols, and the communication point tables of Modbus protocol and opc-ua protocol types can be configured and bound.

[0077] Secondly, it provides multi-page configuration. When there are many devices on site and the management is complicated, multi-page configuration can be used to manage IoT devices in groups.

[0078] Third, it can flexibly bind data point tables, and components can be intelligently matched according to data point types. For example, read-only data can be bound to a display box, and writable data can be bound to an input box.

[0079] Fourth, from configuration initialization, data loading to normal operation, the configuration provides accurate information feedback to users to optimize the user experience.

[0080] The embodiment described above is only one specific implementation of the present invention. Common changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the protection scope of the present invention.

Claims

1. A cross-platform Internet of Things configuration method, characterized by: Based on the Angular language fabric.js plug-in and the editing and storage of the multi-protocol communication point table, the logical binding of the two is realized; The binding objects of the web configuration component are divided into display components and control components; among them, the display components include data panels and chart panels, and the control components include buttons and input boxes; The communication protocol point table supports the modbus protocol, and quickly registers and issues device attributes in the form of a table; Based on the web configuration components and the communication protocol point table, the communication protocol point table is quickly bound in the web configuration.

2. The cross-platform Internet of Things configuration method according to claim 1, characterized in that: The following steps are involved: Step S1: Develop Web configuration components Use the selector to draw graphics for app-draw; in the basic version, the Web configuration component has the functions of control dragging, image drawing, SVG drawing, element size and color setting, form component support and chart drawing; Introduce @angular / animations module to add interactive animations to page elements; introduce FormsModule module and ReactiveModule module to implement form control development; introduce DragDropModule module to implement element dragging; The Web configuration component path is src / app / cleverlink / draw. The same-level directory contains board.service.ts and button.service.ts services, which provide method support for different configuration elements. Step S2: Bind communication point table Binding the configuration component with communication function to the point table parameters is essentially to store the ID of the data point, the device to which the data point belongs, and the information of the gateway into the web configuration component properties through base64 encoding. The component properties are saved and run along with the configuration. Then run the configuration to realize the functions of viewing device data and controlling device through bound components.

3. The cross-platform Internet of Things configuration method according to claim 2, characterized in that: In the step S1, The @angular / animations module provides an animation API to implement CSS animation effects including translation, zooming in, zooming out, and sliding in and out; the configuration uses transition animation to implement the switching and translation effects of controls in the configuration control panel; When the user selects, switches, and cancels configuration elements on the configuration canvas, the control panel displays different control groups according to the element type; in order to achieve a smooth transition effect, the @angular / animations module is used to provide transition animation effects for the display and hiding of controls; Introduce FormsModule and ReactiveModule to create responsive forms. When Web configuration involves reading, displaying, and sending data, data binding, input boxes, and buttons of the Angular framework are required. Use the responsive form provided by the Angular framework to process user input and realize centralized management of configuration data.

4. The cross-platform Internet of Things configuration method according to claim 2, characterized in that: In the step S1, relevant Angular basic modules are introduced, and the component DrawComponent is created using the decorator @Component; Create the draw.component.html file, which includes the top toolbar, the left material panel, the configuration canvas, and the right control panel. The top toolbar provides common functions including copying, pasting, deleting, zooming in and out of configuration elements; the left material panel uses the tab tag to load material resources including controls, SVG files and pictures; the configuration canvas uses the canvas element of HTML, and then uses the fabric.js plug-in to initialize it in the ts file; The right control panel uses the tab page to load the view control panel and data processing panel; The TopBarComponent component of the top toolbar, the MaterialComponent component of the left material panel, and the ControlComponent component of the right control panel are developed separately.

5. The cross-platform Internet of Things configuration method according to claim 4, characterized in that: The configuration canvas uses the core class fabric.Canvas to obtain the canvas element in HTML to initialize it; after the initialization is completed, the action of the canvas element is monitored to respond to the change of the element state; When the fabric.js plug-in initializes the canvas element, first introduce the fabric.min.js file in the angular.json file, declare the fabric object in the DrawComponent component, and use the fabric object to initialize the canvas element and add the listening code when the DrawComponent component is initialized.

6. The cross-platform Internet of Things configuration method according to claim 4, characterized in that: In step S1, the html native method is used to monitor the drag action of the html element and bind a processing function to it; when the mouse is lifted, if the element is in the canvas element, the current coordinates of the element are calculated, and the fabric.js method is used to add the corresponding element type to the canvas element; the implementation process is briefly described as follows: Add the draggable attribute to all material images, set it to true, add the dragstart attribute and dragend attribute, and bind the processing function; First, calculate the distance x1 from the left side of the canvas to the left side of the screen. When the element is dragged, calculate the distance x2 from the left side of the element to the left side of the screen. The difference between the distance x2 from the left side of the element to the left side of the screen and the distance x1 from the left side of the canvas to the left side of the screen is the distance between the element and the left border of the canvas. When the distance between the element and the left edge of the canvas is greater than 0 and less than the sum of the distance from the left side of the canvas to the left side of the screen x1 and the width of the canvas, it means that the element is already in the canvas within the horizontal range; similarly, calculate whether the element is in the canvas within the vertical distance; When the element is in the canvas both horizontally and vertically, the element coordinates are calculated and the corresponding element is loaded into the canvas using fabric.js native methods.

7. The cross-platform Internet of Things configuration method according to claim 5, characterized in that: In the step S1, the Fabric.js plug-in supports adding lines, geometric figures and text elements to the canvas; a simple display box is realized through the combination of geometric figures and text for data display; a rectangle is added and click animation and click event are added to it, so that it is simulated as a button and used as a configuration switch; the DOM element is added to the canvas with the rect figure as the carrier to realize the input box control.

8. The cross-platform Internet of Things configuration method according to claim 1, characterized in that: In step S2, a series of data points of the Modbus standard are defined in the communication protocol point table of the Modbus protocol, including register type, register address and slaveID parameters; Generate a unique ID for each data point in the communication protocol point table of the modbus protocol; When editing a web configuration, the user binds the web configuration component to the corresponding data point one-to-one; Web configuration determines the applicability based on the component type and data point type. Button components are prohibited from binding to read-only data.

9. A cross-platform Internet of Things configuration device, characterized by: The method comprises a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the method according to any one of claims 1 to 8 when executing the computer program.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Unified management method and device for multi-protocol Internet of Things equipment

    CN111343020A

  • Cloud configuration method based on middleware of Internet of Things

    CN112398953A

  • Industrial configuration state indicating device based on Internet of Things

    CN115202540A

  • Configuration MODBUS protocol access method and device based on dynamic model simulation system

    CN115941819A

  • Data information display method based on chart component

    CN117520617A