Method and system for automatically creating tree structure model
By automatically creating tree-structured object models, the problem of rigid metadata management and high maintenance costs in industrial software is solved, enabling unified management and real-time analysis of multi-source heterogeneous data and lowering the technical threshold.
Patent Information
- Application Number
- CN202610044326.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-14
- Publication Date
- 2026-02-10
AI Technical Summary
Existing technologies lack effective management of unstructured metadata in industrial software, resulting in rigid metadata management, high maintenance costs, and high technical barriers, which hinders business experts from participating in the construction and management of data models.
By collecting time-series data and metadata from devices, a tree-structured model is automatically created using tag data, supporting unified management and analysis of multi-source heterogeneous data, and monitoring data changes in real time and dynamically updating the model.
It enables automated management of industrial metadata, improves management efficiency and the intuitiveness of data analysis, reduces the professional background requirements, and supports real-time data analysis and decision-making.
Smart Images

Figure CN121501804A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial software development technology, and in particular to a method and system for automatically creating tree-structured object models. Background Technology
[0002] With the rapid development of industrial digitalization and intelligentization, industrial software has become a core bridge connecting traditional industrial production and modern informatization, and a pillar of intelligent manufacturing. In the design and development of industrial software, how to effectively digitally model and manage physical equipment (such as sensors, machine tools, etc.) and the massive, multi-source, heterogeneous data they generate is a key foundation for realizing the Industrial Internet and digital twins.
[0003] Currently, the main technical challenges and limitations in this field are as follows:
[0004] 1. Rigid metadata management, lacking dynamism and flexibility: The industrial sector typically uses tree structures to organize and manage industrial metadata to represent its complex hierarchical relationships. However, existing metadata management methods often lack effective management of unstructured metadata and cannot dynamically and automatically respond to changes in the metadata itself (such as the addition of new equipment, attribute changes, etc.). This makes it difficult for the system to adapt to the reality of frequent changes in equipment and data in modern industrial fields.
[0005] 2. High dependence on manual labor and high maintenance costs: Whether it is the establishment and maintenance of tree-like hierarchical relationships or the definition of the object model (i.e., the digital blueprint of the equipment), it currently relies heavily on manual configuration. When the tree hierarchy is deep, the number of nodes is large, or data needs to be organized from multiple dimensions (such as geographical location, functional grouping, etc.), manual maintenance becomes extremely cumbersome, time-consuming, and error-prone, severely restricting management efficiency and system scalability.
[0006] 3. High technical barriers hinder rapid application and popularization: Traditional solutions (such as form generation and manual coding) exclude non-professional developers, making it difficult for business experts to directly participate in the construction and management of data models, thus forming a technical barrier. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides a method and system for automatically creating tree-like structural models.
[0008] This invention provides a method for automatically creating a tree-like structure model, comprising:
[0009] Collect time-series data and metadata for each device, and store the collected time-series data as indicator data and the metadata as tag data in the database;
[0010] Select one or more tag data from the data table of the user-selected device in the database, and automatically create a tree structure according to the user-defined tree structure creation rules and the selected one or more tag data;
[0011] During the automatic creation of the tree structure, leaf elements are formed by defining the leaf nodes of the tree structure using standardized semantics, based on the indicator data, tag data, and other data containing functions, events, and services of the user-selected device. This results in a tree structure model.
[0012] Preferably, the user-defined tree structure creation rules include tree structure creation types and hierarchical path rules that determine non-leaf node paths through tags or hierarchical path expressions and leaf node paths through element name expressions. The tree structure creation types include single-tag tree structure creation types, multi-tag combined tree structure creation types, and single or multiple tag and custom character combined tree structure creation types.
[0013] Preferably, when the tree structure creation type is a single-tag tree structure creation type, the automatic creation of the tree structure based on user-defined tree structure creation rules and the selected one or more tag data includes:
[0014] Based on the user-defined rules for creating a tree structure, retrieve the tag name and tag value corresponding to each tag from one or more tag data selected from the data table of the user-selected device in the database;
[0015] Using the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag as the intermediate node, and the device name of the user-selected device as the leaf node, one or more single-tag tree structures are automatically created; wherein, if the tag value contains an English period, the intermediate node is split into multiple levels.
[0016] Preferably, when the tree structure creation type is a multi-tag combination tree structure creation type or a single or multiple tag and custom character combination tree structure creation type, the automatic creation of the tree structure according to the user-defined tree structure creation rules and the selected one or more tag data includes:
[0017] Based on the user-defined rules for creating a tree structure, retrieve the tag name and tag value corresponding to each tag from one or more tag data selected from the data table of the user-selected device in the database;
[0018] Using the label name specified in the tree structure creation rules as the root node, the label value corresponding to each label as the intermediate node, and the device name of the user-selected device as the leaf node, a multi-label combined tree structure is automatically created; or
[0019] Using the label name specified in the tree structure creation rules as the root node, the label value and custom character corresponding to each label as intermediate nodes, and the device name of the user-selected device as the leaf node, a tree structure of one or more labels and custom characters is automatically created.
[0020] If the tag value contains an English period, the intermediate node will be split into multiple levels.
[0021] Preferably, it further includes:
[0022] Monitor the database in real time to see if any changes occur.
[0023] If a change is detected in the database, the type of data change is determined, and the tree structure and the tree structure model are automatically updated based on the type of data change.
[0024] Preferably, the automatic updating of the tree structure and the tree structure model based on the data change type includes:
[0025] When the data change type is determined to be adding a data table, the intermediate nodes and leaf nodes are automatically created at the corresponding positions in the already created tree structure according to the user-defined tree structure creation rules and the selected one or more label data.
[0026] When the data change type is determined to be deleting a data table, the intermediate nodes and leaf nodes are automatically deleted at the corresponding positions in the created tree structure according to the user-defined tree structure creation rules and the selected one or more label data.
[0027] When the data change type is determined to be adding labeled data, attribute information is added to the newly added label corresponding to the leaf element template in the tree structure model;
[0028] When the data change type is determined to be deleted tag data, the attribute information is deleted from the deletion tag corresponding to the leaf element template in the tree structure model.
[0029] This invention provides a system for automatically creating tree-like structural models, comprising:
[0030] The data storage module is used to collect time-series data and metadata from each device, and store the collected time-series data as indicator data and metadata as tag data in the database.
[0031] The tree structure creation module is used to select one or more tag data from the data table of the user-selected device in the database, and automatically create a tree structure according to the user-defined tree structure creation rules and the selected one or more tag data;
[0032] The module for creating a tree structure model is used to form leaf elements by defining the leaf nodes of the tree structure using standardized semantics during the automatic creation of the tree structure, based on the indicator data, tag data, and other data containing functions, events, and services of the user-selected device.
[0033] Preferably, the user-defined tree structure creation rules include tree structure creation types and hierarchical path rules that determine non-leaf node paths through tags or hierarchical path expressions and leaf node paths through element name expressions. The tree structure creation types include single-tag tree structure creation types, multi-tag combined tree structure creation types, and single or multiple tag and custom character combined tree structure creation types.
[0034] Preferably, when the tree structure creation type is a single-tag tree structure creation type, the tree structure creation module is specifically used to obtain the tag name and tag value corresponding to each tag from one or more tag data selected from the user-selected device data table in the database according to the user-defined tree structure creation rules; and automatically create one or more single-tag tree structures with the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag as the intermediate node, and the device name of the user-selected device as the leaf node; wherein, if the tag value contains an English period, the intermediate node is split into multiple levels.
[0035] Preferably, when the tree structure creation type is a multi-tag combination tree structure or a single or multiple tag and custom character combination tree structure, the tree structure creation module is specifically used to obtain the tag name and tag value corresponding to each tag from one or more tag data selected from the user-selected device data table in the database according to the user-defined tree structure creation rules; automatically create a multi-tag combination tree structure with the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag as the intermediate node, and the device name of the user-selected device as the leaf node; or automatically create a single or multiple tag and custom character combination tree structure with the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag and the custom character as the intermediate node, and the device name of the user-selected device as the leaf node; wherein, if the tag value contains an English period, the intermediate node is split into multiple levels.
[0036] The technical solution provided by this invention has the following beneficial effects:
[0037] (1) By adding various tags to the original collected data on the data acquisition side and automatically creating a tree structure model based on the information of the tags, the automatic management of industrial metadata is realized, avoiding the tediousness and time-consuming nature of traditional manual maintenance of relationships, and greatly improving the efficiency of industrial metadata management.
[0038] (2) This invention supports unified management and analysis of multi-source heterogeneous data. Through the flexible combination of tags and the support of custom strings, it can effectively integrate and analyze complex industrial system data, solving the problems of data dispersion and low degree of structure in the prior art.
[0039] (3) By adopting the automatic creation method of tree structure model, the global structured management of industrial system is realized, which enables developers to understand and analyze complex industrial system structure more intuitively, reduces the requirements for professional background and improves development efficiency;
[0040] (4) The automated tree structure model creation process reduces the impact of human factors on the metadata structure, improves the standardization and normalization of metadata management, and ensures the high quality and high reliability of industrial metadata.
[0041] (5) The present invention supports dynamic processing of additions, deletions and structural changes, which can reflect the complex changes in the industrial system in a timely manner and meet the needs of the industrial system for real-time data analysis and decision-making. Attached Figure Description
[0042] Figure 1 This is a flowchart of a method for automatically creating a tree-like structure model provided by the present invention;
[0043] Figure 2 This is a flowchart illustrating the method for automatically creating tree-like structural models provided by the present invention.
[0044] Figure 3 This is a schematic diagram of the tree structure of a single label tree provided by the present invention;
[0045] Figure 4 This is a schematic diagram of a custom tree structure provided by the present invention;
[0046] Figure 5 This is a schematic diagram of a tree structure where a single label is used to form a tree when new data is added, as provided by the present invention.
[0047] Figure 6 This is a diagram illustrating a tree structure that can be customized into a tree when new data is added, provided by existing technology. Detailed Implementation
[0048] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In the following description, suffixes such as "module," "part," or "unit" used to denote elements are used only for the purpose of illustrative purposes and have no inherent meaning. Therefore, "module," "part," or "unit" may be used interchangeably.
[0049] Introduction to basic concepts
[0050] Object Model: An object model is the "blueprint" or "instruction manual" for a physical device in the digital world. It defines the device's attributes, functions, events, and services using a standardized language, enabling communication between the device, the cloud, and applications using the same "language." The object model of a device is an element in a tree structure.
[0051] Element: When organizing industrial metadata using a tree-like hierarchical structure, each node in the tree structure is called an element. An element is a physical or logical entity. It can be a specific physical device (such as a car), a subsystem of a physical device (such as a car's brakes), or even a sensor. It can also be logical, such as a factory, a group, or a city.
[0052] Element templates: For the common parts of multiple elements, you can extract them to form a template. Then you can create elements using the template. Elements created using the same template will inherit the same content from the template.
[0053] Attributes: Attributes are an important component of an element, used to describe the various data an element possesses, including time-series data, metadata, or other data. Attributes can have names, attribute values, and other information. This value may also require a unit of measurement. For example, temperature is an attribute of a device, and temperature also requires the unit of measurement Celsius.
[0054] Attribute templates: Element templates can have attribute templates. When an element is created based on an element template, attributes will also be created for the element based on the attribute template.
[0055] Figure 1 This is a flowchart of a method for automatically creating a tree-like structure model provided by the present invention, such as... Figure 1 As shown, it includes:
[0056] Step S101: Collect time-series data and metadata for each device, and store the collected time-series data of each device as indicator data and the metadata as tag data in the database;
[0057] Step S102: Select one or more tag data from the data table of the user-selected device in the database, and automatically create a tree structure according to the user-defined tree structure creation rules and the selected one or more tag data;
[0058] In some possible implementations, the user-defined tree structure creation rules include tree structure creation types and hierarchical path rules that determine non-leaf node paths through label or hierarchical path expressions and leaf node paths through element name expressions. The tree structure creation types include creating single-label tree structure types, creating multi-label combined tree structure types, and creating tree structure types that combine single or multiple labels and custom characters.
[0059] Step S103: During the automatic creation of the tree structure, leaf elements are formed by defining the leaf nodes of the tree structure using standardized semantics by the indicator data, tag data, and other data containing functions, events, and services of the user-selected device. This results in a tree structure model.
[0060] In some possible implementations, when the tree structure creation type is a single-tag tree structure creation type, the automatic creation of the tree structure based on user-defined tree structure creation rules and the selected one or more tag data includes:
[0061] Based on the user-defined rules for creating a tree structure, the tag name and tag value corresponding to each tag are obtained from one or more tag data selected from the data table of the user-selected device in the database; wherein, the tag value may contain an English period used to divide the intermediate nodes into levels; or it may not contain an English period, that is, the intermediate nodes do not have a level division.
[0062] Using the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag as the intermediate node, and the device name of the user-selected device as the leaf node, one or more single-tag tree structures are automatically created; wherein, if the tag value contains an English period, the intermediate node is split into multiple levels.
[0063] In some possible implementations, when the tree structure creation type is a multi-tag combined tree structure type or a single or multiple tag and custom character combined tree structure type, the automatic creation of the tree structure based on user-defined tree structure creation rules and the selected one or more tag data includes:
[0064] Based on the user-defined rules for creating a tree structure, retrieve the tag name and tag value corresponding to each tag from one or more tag data selected from the data table of the user-selected device in the database;
[0065] Using the label name specified in the tree structure creation rules as the root node, the label value corresponding to each label as the intermediate node, and the device name of the user-selected device as the leaf node, a multi-label combined tree structure is automatically created; or
[0066] Using the label name specified in the tree structure creation rules as the root node, the label value and custom character corresponding to each label as intermediate nodes, and the device name of the user-selected device as the leaf node, a tree structure of one or more labels and custom characters is automatically created.
[0067] If the tag value contains an English period, the intermediate node will be split into multiple levels.
[0068] In some possible implementations, the present invention further includes:
[0069] Monitor the database in real time to see if any changes occur.
[0070] If a change is detected in the database, the type of data change is determined, and the tree structure and the tree structure model are automatically updated based on the type of data change.
[0071] Furthermore, the automatic updating of the tree structure and the tree structure model based on the type of data change includes:
[0072] When the data change type is determined to be adding a data table, the intermediate nodes and leaf nodes are automatically created at the corresponding positions in the already created tree structure according to the user-defined tree structure creation rules and the selected one or more label data.
[0073] When the data change type is determined to be deleting a data table, the intermediate nodes and leaf nodes are automatically deleted at the corresponding positions in the created tree structure according to the user-defined tree structure creation rules and the selected one or more label data.
[0074] When the data change type is determined to be adding labeled data, attribute information is added to the newly added label corresponding to the leaf element template in the tree structure model;
[0075] When the data change type is determined to be deleted tag data, the attribute information is deleted from the deletion tag corresponding to the leaf element template in the tree structure model.
[0076] The present invention also provides a system for automatically creating tree-like structural models, comprising:
[0077] The data storage module is used to collect time-series data and metadata from each device, and store the collected time-series data as indicator data and metadata as tag data in the database.
[0078] The tree structure creation module is used to select one or more tag data from the data table of the user-selected device in the database, and automatically create a tree structure according to the user-defined tree structure creation rules and the selected one or more tag data;
[0079] The module for creating a tree structure model is used to form leaf elements by defining the leaf nodes of the tree structure using standardized semantics during the automatic creation of the tree structure, based on the indicator data, tag data, and other data containing functions, events, and services of the user-selected device.
[0080] The user-defined tree structure creation rules include tree structure creation types and hierarchical path rules that determine non-leaf node paths through tags or hierarchical path expressions and leaf node paths through element name expressions. The tree structure creation types include single-tag tree structure creation types, multi-tag combined tree structure creation types, and single or multiple tag and custom character combined tree structure creation types.
[0081] Furthermore, when the tree structure creation type is a single-tag tree structure creation type, the tree structure creation module is specifically used to obtain the tag name and tag value corresponding to each tag from one or more tag data selected from the user-selected device data table in the database according to the user-defined tree structure creation rules; and automatically create one or more single-tag tree structures with the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag as the intermediate node, and the device name of the user-selected device as the leaf node; wherein, if the tag value contains an English period, the intermediate node is split into multiple levels.
[0082] Furthermore, when the tree structure creation type is a multi-tag combination tree structure or a single or multiple tag and custom character combination tree structure, the tree structure creation module is specifically used to obtain the tag name and tag value corresponding to each tag from one or more tag data selected from the user-selected device data table in the database according to the user-defined tree structure creation rules; automatically create a multi-tag combination tree structure with the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag as the intermediate node, and the device name of the user-selected device as the leaf node; or automatically create a single or multiple tag and custom character combination tree structure with the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag and the custom character as the intermediate node, and the device name of the user-selected device as the leaf node; wherein, if the tag value contains an English period, the intermediate node is split into multiple levels.
[0083] This invention provides a method for automatically constructing a tree-structured object model based on data tags. By parsing pre-stored tags in the data and according to user-defined rules, it automatically generates a hierarchical tree structure and creates a unified data model (object model) for the element nodes in the tree. It also supports dynamic responses to changes in the data source, such as... Figure 2 As shown, it specifically includes:
[0084] Step 1: Data modeling and storage;
[0085] Data Classification: After data acquisition, the data acquisition team will persistently store the data in the database. During data acquisition modeling, the collected raw data is divided into two types: metrics and tags. Metrics store time-series data, such as temperature and humidity, which change continuously over time; tags store metadata describing the static characteristics of the equipment, such as equipment model, installation location, and name.
[0086] Data storage: In the relational database, indicator data and tag data are stored in separate tables and linked by key fields such as device ID. In the time-series database, a supertable containing indicator and tag fields is created, and each specific device corresponds to a subtable under the supertable.
[0087] Step 2: Automatic creation of the tree structure model;
[0088] After data modeling is completed, a data structure model can be automatically constructed based on the label data in the table. The steps are as follows:
[0089] 2.1 Selecting a data source
[0090] Users specify a table (in relational databases) or a supertable (in time-series databases) as the data source for building the tree structure.
[0091] 2.2 Define tree construction rules
[0092] Users specify the tree hierarchy generation logic in one of the following two ways:
[0093] Single Tag Tree: Select one or more tags. The system will create an independent tree for each selected tag, with that tag serving as the root node. If the tag value itself contains a period ".", the system will automatically split it into multiple levels.
[0094] Custom path tree: Manually write a hierarchical path expression. This expression can be freely combined with one or more tags (referenced via ${tag name}, etc.) and custom fixed strings, with each part separated by a period ".". For example: "City.${Region}.${Device Type}".
[0095] 2.3 Creating Element Templates
[0096] Creating an element template is the process of defining the data model for nodes in a tree. This invention provides three methods for mapping fields from a data table to element templates:
[0097] Method 1 (One-to-One): Automatically create and map all fields of the entire table to an element template.
[0098] Method 2 (many-to-one): Manually select and map fields from multiple tables to an existing element template to achieve data model reuse.
[0099] Method 3 (One-to-Many): Map different fields in a table to multiple existing element templates to achieve logical splitting of single-table data.
[0100] 2.4 Assigning Node Templates
[0101] When constructing the tree, the system automatically stipulates that all non-leaf nodes at the same level (i.e., intermediate nodes on the path) share the same element template; all leaf nodes (i.e., the final device nodes) share another element template.
[0102] 2.5 Naming Leaf Elements
[0103] Name the leaf nodes (i.e., the specific device elements) at the end of the tree structure. The name can be generated by combining one or more tag values, or it can contain a custom string.
[0104] Step 3: Automatic updates based on data changes.
[0105] After the tree structure model is created, the tables in the database may change at any time, and the elements will change accordingly:
[0106] 3.1 Processing newly added data
[0107] When a new sub-table (time-series database) or a new record / table (relational database) is added, the system automatically creates new leaf elements at the corresponding positions in the tree structure according to the established construction rules (step 2: automatic creation of the tree structure model).
[0108] 3.2 Handling Table Structure Changes
[0109] Add a new column: If configured to allow automatic updates, the system will automatically add a new attribute to the element template corresponding to the leaf node, and all related elements will automatically inherit this attribute.
[0110] Deleting a column: If the column to be deleted is a regular indicator or label column, the system will automatically remove the attribute from the element template and the element. If the column to be deleted is a key label column used to build the tree structure, the system will provide options: either automatically rebuild the tree path based on the new structure, or keep the existing tree structure unchanged.
[0111] The following uses a time-series data smart meter (super meter) as an example to illustrate the specific implementation process of this invention:
[0112] The smart meter is described as follows: note is a TAG column, groupid is a label indicating the grouping information of the device, location is a label indicating the location information of the device, and device is a label indicating the name information of the device.
[0113] Step 1: The modeling statement for the smart meter is as follows (it has two tags: location and groupId);
[0114]
[0115] Step 2: Create a tree structure;
[0116] Method 1, Single Tag Tree: Select `location` and `groupId`, rename `location` to "Location" and `groupId` to "Group", for example, `location.${location}`, where element names use the tag value "${tbname}"; `group.${groupId}`, where element names use the tag value "${tbname}", i.e., using the sub-table name as the element name. This will create two trees, one with the root node named "Location" and the other with the root node named "Group". A diagram of the two tree structures is shown below. Figure 3 As shown.
[0117] At this point, an element template will be created for the "Location" element, and another element template will be created for "Grouping". The element templates contain all six fields from the table. d0 and d1 will share the same element template. d0 and d1 in both trees are the same element; one tree simply references it.
[0118] Method 2, Custom Tree Structure: Select the path of the tree composed of "location" and "groupId", for example, "location.${location}.${groupId}", use the tag value "${device}" for element names, and select an element template that contains all fields from the table. The resulting tree structure diagram is as follows. Figure 4 As shown.
[0119] Step 3: When the new sub-table d2 is automatically created, its corresponding elements will be automatically created based on the sub-table d2.
[0120] The description information of sub-table d2 is as follows: note is a TAG, which means that this column is a label column; groupid is a label that indicates the grouping information of the device; location is a label that indicates the location information of the device; and device is a label that indicates the name information of the device.
[0121] The statement for creating sub-table d2 is as follows:
[0122]
[0123] Therefore, when using location and groupId to create a tree structure, the tree structure automatically becomes as follows: Figure 5 As shown.
[0124] When creating a tree-structured model using "location.${location}.${groupId}", the tree structure automatically becomes as follows: Figure 6 As shown.
[0125] The tree structure provided in this embodiment of the invention comprises two parts: leaf nodes and non-leaf nodes. Non-leaf nodes contain parent nodes of leaf nodes. All nodes in the relationship chain from the root node of each tree to the parent node of a leaf node form the path of the leaf node, such as " / location / Beijing / Chaoyang / Wangjing / Device 1". Device 1 is an element and also a leaf node (leaf element). Location, Beijing, Chaoyang, and Wangjing are all non-leaf nodes. The link / location / Beijing / Chaoyang / Wangjing / is the path of the node Device 1. The node Wangjing is the parent node of Device 1. After this tree is created, attributes will be added to the leaf node, i.e., Device 1, to form leaf elements, and then the object model will be constructed accordingly.
[0126] The key technical features of this invention include: automatically creating a tree-like structure model based on the tag information carried in the data; automatically dividing the hierarchy by including a period in the tag value; freely combining the tag information carried in the data with periods, or combining it with any string with periods; creating multiple trees based on multiple tags carried in the data; automatically maintaining the structure model based on table structure changes; and automatically creating or deleting elements based on the creation and deletion of tables.
[0127] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but this does not limit the scope of the invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the present invention.
Claims
1. A method for automatically creating a tree-like structure model, characterized in that, include: Collect time-series data and metadata for each device, and store the collected time-series data as indicator data and the metadata as tag data in the database; Select one or more tag data from the data table of the user-selected device in the database, and automatically create a tree structure according to the user-defined tree structure creation rules and the selected one or more tag data; During the automatic creation of the tree structure, leaf elements are formed by defining the leaf nodes of the tree structure using standardized semantics, based on the indicator data, tag data, and other data containing functions, events, and services of the user-selected device. This results in a tree structure model.
2. The method according to claim 1, characterized in that, The user-defined tree structure creation rules include tree structure creation types and hierarchical path rules that determine non-leaf node paths through tags or hierarchical path expressions and leaf node paths through element name expressions. The tree structure creation types include single-tag tree structure creation types, multi-tag combined tree structure creation types, and single or multiple tag and custom character combined tree structure creation types.
3. The method according to claim 2, characterized in that, When the tree structure creation type is a single-tag tree structure creation type, the automatic creation of the tree structure based on the user-defined tree structure creation rules and the selected one or more tag data includes: Based on the user-defined rules for creating a tree structure, retrieve the tag name and tag value corresponding to each tag from one or more tag data selected from the data table of the user-selected device in the database; Using the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag as the intermediate node, and the device name of the user-selected device as the leaf node, one or more single-tag tree structures are automatically created; wherein, if the tag value contains an English period, the intermediate node is split into multiple levels.
4. The method according to claim 2, characterized in that, When the tree structure creation type is a multi-tag combination tree structure or a single or multiple tag and custom character combination tree structure, the automatic creation of the tree structure based on the user-defined tree structure creation rules and the selected one or more tag data includes: Based on the user-defined rules for creating a tree structure, retrieve the tag name and tag value corresponding to each tag from one or more tag data selected from the data table of the user-selected device in the database; Using the label name specified in the tree structure creation rules as the root node, the label value corresponding to each label as the intermediate node, and the device name of the user-selected device as the leaf node, a multi-label combined tree structure is automatically created; or Using the label name specified in the tree structure creation rules as the root node, the label value and custom character corresponding to each label as intermediate nodes, and the device name of the user-selected device as the leaf node, a tree structure of one or more labels and custom characters is automatically created. If the tag value contains an English period, the intermediate node will be split into multiple levels.
5. The method according to claim 3 or 4, characterized in that, Also includes: Monitor the database in real time to see if any changes occur. If a change is detected in the database, the type of data change is determined, and the tree structure and the tree structure model are automatically updated based on the type of data change.
6. The method according to claim 5, characterized in that, The automatic updating of the tree structure and the tree structure model based on the type of data change includes: When the data change type is determined to be adding a data table, the intermediate nodes and leaf nodes are automatically created at the corresponding positions in the already created tree structure according to the user-defined tree structure creation rules and the selected one or more label data. When the data change type is determined to be deleting a data table, the intermediate nodes and leaf nodes are automatically deleted at the corresponding positions in the created tree structure according to the user-defined tree structure creation rules and the selected one or more label data. When the data change type is determined to be adding labeled data, attribute information is added to the newly added label corresponding to the leaf element template in the tree structure model; When the data change type is determined to be deleted tag data, the attribute information is deleted from the deletion tag corresponding to the leaf element template in the tree structure model.
7. A system for automatically creating tree-like structural models, characterized in that, include: The data storage module is used to collect time-series data and metadata from each device, and store the collected time-series data as indicator data and metadata as tag data in the database. The tree structure creation module is used to select one or more tag data from the data table of the user-selected device in the database, and automatically create a tree structure according to the user-defined tree structure creation rules and the selected one or more tag data; The module for creating a tree structure model is used to form leaf elements by defining the leaf nodes of the tree structure using standardized semantics during the automatic creation of the tree structure, based on the indicator data, tag data, and other data containing functions, events, and services of the user-selected device.
8. The system according to claim 7, characterized in that, The user-defined tree structure creation rules include tree structure creation types and hierarchical path rules that determine non-leaf node paths through tags or hierarchical path expressions and leaf node paths through element name expressions. The tree structure creation types include single-tag tree structure creation types, multi-tag combined tree structure creation types, and single or multiple tag and custom character combined tree structure creation types.
9. The system according to claim 8, characterized in that, When the tree structure creation type is a single-tag tree structure creation type, the tree structure creation module is specifically used to obtain the tag name and tag value corresponding to each tag from one or more tag data selected from the data table of the user-selected device in the database according to the user-defined tree structure creation rules; Using the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag as the intermediate node, and the device name of the user-selected device as the leaf node, one or more single-tag tree structures are automatically created; wherein, if the tag value contains an English period, the intermediate node is split into multiple levels.
10. The system according to claim 8, characterized in that, When the tree structure creation type is a multi-tag combination tree structure or a single or multiple tags and custom character combination tree structure, the tree structure creation module is specifically used to obtain the tag name and tag value corresponding to each tag from one or more tag data selected from the data table of the user-selected device in the database according to the user-defined tree structure creation rules; Using the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag as the intermediate node, and the device name of the user-selected device as the leaf node, a multi-tag combined tree structure is automatically created; or using the tag name specified in the tree structure creation rules as the root node, the tag value corresponding to each tag and a custom character as the intermediate node, and the device name of the user-selected device as the leaf node, a single or multiple tag and custom character combined tree structure is automatically created; wherein, if the tag value contains an English period, the intermediate node is split into multiple levels.