A data modeling method and system in a controller configuration

By employing a dual-container design of template and configuration libraries, combined with a tree structure and attribute verification mechanisms for specific data types, the reusability and scalability issues of data modeling in controller configuration are resolved, thereby improving configuration efficiency and reliability.

CN115658645BActive Publication Date: 2026-05-15NANJING GUODIAN NANZI WEIMEIDE AUTOMATION CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-23
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, data modeling methods in controller configuration suffer from poor reusability, limited data type selection, and time-consuming and complex data verification, leading to increased workload and higher error probability.

Method used

It adopts a dual-container design of template library and configuration library. By creating information table, instance table and instance attribute table, it organizes data using tree structure. Combined with specific data type and attribute verification mechanism, it provides customized function blocks and template generation module to achieve efficient data management and verification.

Benefits of technology

It improves configuration efficiency and reliability, enhances data scalability and ease of use, reduces the probability of errors, and simplifies data management processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658645B_ABST
    Figure CN115658645B_ABST
Patent Text Reader

Abstract

The application discloses a data modeling method and system in controller configuration, the method comprises the following steps: creating a template library, creating an information table in the template library according to the basic information required by the controller when being configured; when a new configuration is created, selecting a template library according to the category and version of the controller, obtaining the information in the information table and loading into the memory; creating a new configuration library according to the content of the selected template library, copying the content of the template library into the new configuration library; creating an instance table and an instance attribute table in the new configuration library, completing the construction of the configuration library, and the controller can directly load and use the configuration library when being configured; the application adopts the design of using the template library and the configuration library together, uses the basic information to the maximum extent, uses the main library once to place, and improves the configuration efficiency; the instance data table in the configuration library is organized in a tree structure, the logic is clear, and the usability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a data modeling method and system in controller configuration, belonging to the field of data modeling technology. Background Technology

[0002] With the rapid development of modern industry, the industrial control field increasingly requires strong technical support to maintain ever-expanding production scales and monitor increasingly complex production processes. Controllers are the hardware processing engines of industrial control systems, used to perform basic data acquisition, control, and data processing functions. Specifically, this includes continuously scanning I / O modules and executing predefined algorithms for process control and data acquisition. Configuration, simply put, is the combination of multiple modules. It means using software tools to configure various resources of the computer and software, enabling the computer or software to automatically execute specified tasks according to pre-set instructions to meet user needs. Controller configuration is the process of combining different controller algorithm modules according to the actual control requirements in an engineering project. It defines the control and data acquisition function blocks of the controller and related I / O hardware, mainly used for intuitive monitoring of the field operating status, convenient management of field equipment, and meeting user requirements for measurement and control. Point data, as the core part of configuration software, is crucial to the stability of the entire configuration software due to its reliable and efficient organization and construction. The rationality of its design directly affects the versatility and efficiency of the configuration. Therefore, a reliable, universal, and efficient data modeling method in controller configuration is essential.

[0003] Chinese patent CN 105787013 B proposes a method and system for assigning type names to heterogeneous data. The method includes: reading the original heterogeneous data; decomposing the original heterogeneous data into three basic elements: objects, attributes, and connections; and constructing a ternary model of objects, attributes, and connections, which is implemented through an object table, an attribute table, and a connection table; assigning at least one object type name to each object table, at least one attribute type name to each attribute table, and at least one connection type name to each connection table to achieve a many-to-many correspondence between the original data and the type names. This solves the problem of errors caused by type name mismatches during the retrieval of original data.

[0004] The disadvantages of existing technology are as follows:

[0005] 1) The reusability of data design is poor. When configuring different controllers, there is a lot of repetitive work, which increases the workload and the probability of errors.

[0006] 2) The choice of data types is limited and not extensible;

[0007] 3) Data verification is performed during compilation after configuration is completed. The verification logic is complex and time-consuming. Summary of the Invention

[0008] The purpose of this invention is to overcome the shortcomings of the prior art and provide a data modeling method and system in controller configuration, thereby overcoming the defects of the above-mentioned solutions.

[0009] To achieve the above objectives, the present invention is implemented using the following technical solution:

[0010] In a first aspect, the present invention provides a data modeling method in controller configuration, comprising:

[0011] Create a template library and create information tables in the template library based on the basic information required by the controller during configuration.

[0012] When creating a new configuration, select a template library based on the controller's category and version, retrieve the information from its information table, and load it into memory;

[0013] Create a new configuration library based on the contents of the selected template library, and copy the contents of the template library to the new configuration library;

[0014] Create instance tables and instance attribute tables in the new configuration library to complete the construction of the configuration library. Once the configuration library is built, it can be directly loaded and used by the controller during configuration.

[0015] Furthermore, the information table includes a service table, a service attribute type table, a data type table, and a usage table, wherein:

[0016] The service table defines basic atomic block types, including any one or more of the following: atomic block name, category, description, lock status, hidden flag, and revision time. The categories in the service table include system-level, cache-level, analog block, discrete logic, and state logic, used to distinguish atomic blocks. The lock status in the service table indicates whether the atomic block is locked. The hidden flag in the service table indicates whether the atomic block is visible during configuration; if it is hidden, related operations cannot be performed on it during configuration. The revision time in the service table records the time when the current atomic block was last modified, allowing for the tracing of modification history.

[0017] The service attribute type table defines the basic attribute types corresponding to all atomic blocks in the service table, and all attribute types have sub-attributes. Sub-attributes include category, description, data type, index, configuration flag, reference flag, security level, and any one or more of the maximum value, minimum value, and enumerated set variables used for data validation; the categories of the sub-attributes include normal, input, output, parameter, status, customized, and quality.

[0018] In addition to basic attribute types, the data types in the service attribute type table also include specific data types, which provide four interfaces: add, modify, delete, and used count.

[0019] Once the specific data type is defined, its name will be added to the data type table.

[0020] The usage table defines the usage scenarios, including regular, system, custom, template category, template service, and template instance.

[0021] Furthermore, the definition process for the specific data type is as follows:

[0022] d) Add a new specific data type by calling the add interface. The parameters of the add interface include the specific data type name, the specific subtype, and the number of elements.

[0023] e) Call the modification interface to update the content of the above parameters; the used count interface is used to view the number of times a specific data type is currently used. Each specific data type maintains a variable to count the number of times it is used. Whenever an attribute object selects this specific data type as its data type, the variable will increment by 1. Conversely, when an attribute object with a specific data type is removed, the variable will decrement by 1.

[0024] f) When calling the delete interface for a specific data type to perform a delete operation, the counting interface is first called to check if the count being used is 0. If it is not 0, an attribute object using this specific data type is deleted, the count is decremented by 1, and the delete operation continues until the count being used is 0, at which point the deletion is truly complete.

[0025] Furthermore, the step of creating a new configuration library based on the content of the selected template library and copying the content of the template library into the new configuration library also includes:

[0026] Assign a unique configuration name to the configuration library, which is consistent with the name of the controller. Then, modify the configuration library when editing the configuration, create new custom atomic blocks or molecular blocks, write the information of the custom atomic blocks into the service table, and write any new attribute types into the service attribute type table. Provide a set of user-defined interface attributes for use in customizing a function block. Then, use the template function to package the custom function block or atomic block into a template with preset reusable attribute values. The template can be used multiple times in a configuration or copied to multiple configurations for reuse.

[0027] Furthermore, the configuration library stores information on atomic blocks and molecular blocks. A molecular block is a composite algorithm block constructed from two or more atomic blocks according to a certain logic.

[0028] Furthermore, the instance table defines functional block objects, which are instantiations of functional block types, including atomic block objects in the template library and molecular block objects added later. The data in the instance table is designed using a tree data structure, with each node having a parent node except for the root node.

[0029] The instance table includes the handle of the current node, the handle of the parent node, references, the type of the function block to which it belongs and its corresponding handle, relative indexes and download status;

[0030] The current node handle in the instance table is used to uniquely identify the current node, and the parent node handle represents the unique identifier of the current node's parent node, in order to record the parent-child logical relationship between two nodes, thus forming a tree structure. When a previously created configuration is reopened, the configuration content will be loaded from the instance table.

[0031] The relative index in the instance table represents an ordered number of all child nodes under a group node. A group is an instance node with service type GRP, used to manage other instance nodes. It is selected by default in an incremental manner when creating a new group or control, or it can be manually modified by entering the desired index number. The relative index number of each group or control within a group must be unique, so as to represent the child nodes under a certain group node in another way. On the one hand, it represents the creation order of the child nodes, and on the other hand, it is used to identify a target group node or control in the reference field.

[0032] Furthermore, the instance attribute table defines all created function block instances and their attributes, and records the configuration values ​​during actual runtime, including the node handle, attributes and corresponding actual values, function block type, and parameters.

[0033] The reference in the instance attribute table is a string that identifies the location of a specific attribute. A reference string includes the name of the reference attribute, the tag name of the control containing this attribute, an alias or relative multiple quotes, and the HID information.

[0034] Furthermore, there is a relationship between the instance table and the instance attribute table, and there are also corresponding relationships between them and the service table and the service attribute type table. There is a one-to-many relationship between the instance table and the service table, and there is also a one-to-many relationship between the instance table and the instance attribute table, and between the service attribute type table and the instance attribute table.

[0035] Secondly, the present invention provides a data modeling system in controller configuration, comprising:

[0036] The template library creation module includes a service table creation module, a service attribute type table creation module, and a specific data type creation module. It is used to create information tables in the template library based on the basic information required by the controller during configuration. The information tables include service tables, service attribute type tables, data type tables, and usage tables.

[0037] The loading module is used to select a template library based on the controller's category and version when creating a new configuration, retrieve information from its information table, and load it into memory;

[0038] The configuration library creation module is used to create a new configuration library based on the contents of the selected template library, and to copy the contents of the template library to the new configuration library;

[0039] The configuration library construction module includes an instance table creation module and an instance attribute table creation module, which are used to create instance tables and instance attribute tables in the new configuration library to complete the construction of the configuration library. After the configuration library is constructed, it can be directly loaded and used by the controller during configuration.

[0040] Furthermore, it also includes:

[0041] The attribute validation module is used to verify and confirm the correctness of reference points and the validity of attribute values ​​of different data types;

[0042] Custom function blocks are used to define the name, category, and description, add them to the service table, define the relevant information of the required attributes, and then write them to the service type table;

[0043] The template generation module is used to generate reusable templates for any atomic block or custom function attribute value preset. It packages custom function blocks into reusable functions that can be used multiple times in a configuration or copied to multiple configurations for reuse. Each custom function block has a unique name and can be added to the list of available function blocks for selection.

[0044] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0045] (1) The design of using both template library and configuration library is adopted. By making the most of the basic information, the main library can be modeled once and used everywhere, which improves the efficiency of configuration. The instance data table in the configuration library is organized in a tree structure, which is logically clear and improves the ease of use.

[0046] (2) An attribute verification mechanism is adopted, and different verification rules are set according to different categories of attributes, which reduces the probability of errors and improves the reliability of the system.

[0047] (3) The design of specific data types is adopted to meet the needs of special application scenarios, make up for the limitations of basic data types, enhance scalability, and improve the judgment of data validity;

[0048] (4) The use of relative index numbers: In order to make child nodes easy to reference and sort within their groups, a relative index number is introduced for each child node. In the use of HID, for multiple child nodes of the same type within a group, their relative index numbers are used directly instead, which is more concise.

[0049] (5) Reference design. References are used to indicate the source of important data. The content in the reference is a relative position code or an absolute position code. The source of the data can be found quickly through its content, which enhances the user-friendliness and improves the efficiency of configuration.

[0050] (6) Design of custom function blocks and template generation modules. A set of user-definable interface attributes is provided for customizing a function block; the template generation module packages the custom module into a reusable function, which can be used multiple times in one configuration or copied to multiple configurations for reuse, thus improving the reusability of the algorithm. Attached Figure Description

[0051] Figure 1 This is a flowchart of a data modeling method in controller configuration provided by an embodiment of the present invention;

[0052] Figure 2 This is a flowchart illustrating the definition of a specific data type provided in an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of the design of a data table in the template library provided in this embodiment of the invention;

[0054] Figure 4 This is a flowchart of the attribute verification mechanism provided in an embodiment of the present invention;

[0055] Figure 5 This is a schematic diagram of the design of a data table in a configuration library provided in an embodiment of the present invention;

[0056] Figure 6 This is a controller configuration flowchart provided in an embodiment of the present invention. Detailed Implementation

[0057] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0058] Example 1

[0059] This embodiment introduces a data modeling method in controller configuration, including:

[0060] Create a template library and create information tables in the template library based on the basic information required by the controller during configuration.

[0061] When creating a new configuration, select a template library based on the controller's category and version, retrieve the information from its information table, and load it into memory;

[0062] Create a new configuration library based on the contents of the selected template library, and copy the contents of the template library to the new configuration library;

[0063] Create instance tables and instance attribute tables in the new configuration library to complete the construction of the configuration library. Once the configuration library is built, it can be directly loaded and used by the controller during configuration.

[0064] like Figures 1 to 6 As shown, the data modeling method in controller configuration provided in this embodiment involves the following steps in its application process:

[0065] Step 1: Create a template library.

[0066] The template library is named Master_x.y.type, where xy represents the version number and type represents the controller type, to accommodate different types and versions of controller iterations.

[0067] Step 2: Create information tables in the template library. The template library defines the basic information required during configuration, including which atomic blocks are available and their attributes. An atomic block is an algorithm block that cannot be further divided. The information tables in the template library mainly include service tables, attribute type tables, data type tables, and usage tables.

[0068] The service table is the main table, which defines the basic atomic block types, including atomic block name, category, description, lock status, hiding flag, and revision time.

[0069] The service table includes categories such as system-level, cache-level, analog block, discrete logic, and state logic, which are used to distinguish atomic blocks.

[0070] The lock status in the service table is used to indicate whether the atomic block is locked. The correct execution of the control logic is related to the safe operation of the device. Therefore, a locking function is provided for important atomic blocks, which can only be modified by entering the correct password to improve security.

[0071] The hidden flag in the service table is used to indicate whether this atomic block is visible during configuration. If it is hidden, no related operations can be performed on it during configuration.

[0072] The revision time in the service table records the time when the current atomic block was last modified, in order to trace the history of modifications and help analyze the cause when errors occur.

[0073] The service attribute type table defines the basic attribute types corresponding to all atomic blocks in the service table. All attribute types have sub-attributes, which include category, description, data type, index, configuration flag, reference flag, security level, and maximum, minimum and enumerated set variables used for data validation.

[0074] The categories of the sub-attributes include normal, input, output, parameter, status, custom, and quality.

[0075] In addition to basic types, the service attribute type table also provides specific data types. The definition process for specific data types is as follows: Figure 2 As shown. The design of this specific data type provides four interfaces: add, modify, delete, and use count. The definition process for this specific data type is as follows:

[0076] g) Add a new specific data type by calling the add interface. The parameters of the add interface include the specific data type name, the specific subtype, and the number of elements.

[0077] h) Call the modification interface to update the content of the above three elements; the used count interface is used to check the number of times a specific data type is currently used. Each specific data type maintains a variable to count the number of times it is used. Whenever an attribute object selects this specific data type as its data type, the variable will increment by 1. Conversely, when an attribute object with a specific data type is removed, the variable will decrement by 1.

[0078] i) When calling the delete interface for a specific data type to perform a delete operation, the counting interface is first called to check if the count being used is 0. If it is not 0, an attribute object using this specific data type is deleted, the count is decremented by 1, and the delete operation continues until the count being used is 0, at which point the deletion is truly complete.

[0079] Once a specific data type is defined, its unique name is added to the data type table. For a primary value, there are often some supplementary data required, which is included in its value.

[0080] The usage table defines the usage scenarios, including general, system, custom, template category, template service, and template instance. The definitions of the service table, service attribute type table, and data type table are as follows: Figure 3As shown, the service table and the service attribute type table are the most important tables, and they have a one-to-many forced update and delete relationship. The data type table and the service attribute type table have a one-to-many relationship; the value of the DataType field in the service attribute type table corresponds to the Value in a record in the data type table.

[0081] Step 3: Select a template library. When creating a new configuration, select a template library based on the controller's category and version.

[0082] Step 4: Load the template library. For the template library selected in Step 3, obtain its information and load it into memory.

[0083] Step 5: Create a configuration library. Create a new configuration library based on the template library's contents. Copy the template library's contents into the new configuration library and assign it a unique configuration name, which is usually the same as the controller's name. Then, modify the configuration library during configuration editing. When creating new custom atomic blocks or molecular blocks, the custom atomic block's information is written to the service table. If new attribute types are added, they are written to the service attribute type table. A set of user-defined interface attributes is also provided for customizing a function block. Then, use the template function to package the custom function block or atomic block into a reusable model with preset attribute values. The template can be used multiple times in a single configuration or copied to multiple configurations for reuse.

[0084] The configuration library stores information about atomic blocks and molecular blocks. Molecular blocks are composite algorithm blocks built from two or more atomic blocks according to certain logic to achieve more complex functions.

[0085] Step 6: Create information tables in the configuration library. The configuration file adds two tables to the template file: the instance table and the instance attribute table. These are the most frequently read and written information tables.

[0086] The instance table defines function block objects, which are instantiations of function block types, including atomic block objects in the template library and molecular block objects added later. The data in the instance table is designed using a tree data structure. Except for the root node, each node has a parent node. The maximum level of the tree structure is 8 levels to avoid overly complex logical relationships.

[0087] The instance table includes the handle of the current node, the handle of the parent node, references, the type of the function block to which it belongs and its corresponding handle, relative indexes and download status.

[0088] The local node handle in the instance table is used to uniquely identify the current node, and the parent node handle represents the unique identifier of the parent node of the current node, in order to record the parent-child logical relationship between the two nodes, thus forming a tree structure. When a previously created configuration is reopened, the configuration content will be loaded from the instance table.

[0089] The relative index in the instance table represents an ordered number of all child nodes under a group node. A group is an instance node with service type GRP and has no actual meaning; it is used to manage other instance nodes. It is selected by default in an incremental manner when creating a new group or control, or it can be manually modified by entering the desired index number. The relative index number of each group or control within a group must be unique to represent the child nodes under a certain group node in another way. On the one hand, it represents the creation order of the child nodes, and on the other hand, it is used to identify a target group node or control in the reference field, simplifying the display length of the reference, making it more concise, and improving its recognizability.

[0090] The instance attribute table defines all created function block instances and their attributes, and records the configuration values ​​at actual runtime, including the node handle, attributes and corresponding actual values, function block type, and parameters.

[0091] The verification mechanism for the attributes in the instance attribute table is as follows: Figure 4 As shown in the service attribute type table, different correctness verification mechanisms are added for each attribute type based on its data type. For each integer and floating-point attribute, a minimum and maximum value are defined. These minimum and maximum values ​​are configurable and need to be pre-set to reasonable values ​​based on the actual application scenario. When configuring an instance attribute, it is automatically compared with the maximum and minimum values ​​of its corresponding attribute type. If the value is not within the range of the minimum and maximum values, an error message is displayed in real time. For each enumeration type attribute, when adding or editing the corresponding instance object, it automatically checks whether the entered object belongs to the enumeration set. If the judgment result meets expectations, the operation is successful. When the sub-attribute type is a parameter, if the attribute category is status or output, the parameter is invalid. Input is only accepted when the attribute category is input or parameter. Then, the corresponding function block attribute is searched through the parameter content. If the referenced path and attribute exist, the parameter is valid; otherwise, the parameter is invalid.

[0092] The reference in the instance attribute table is a string that identifies the location of a specific attribute. To identify an attribute in the same configuration or another configuration, a reference string can include the name of the referenced attribute, the tag name of the control containing this attribute, an alias or relative multiple quotes, and HID (Hierarchy Identification) information (since the referenced attribute is usually located in the HID). If referencing an attribute in another configuration, the controller name and workstation IP address are also required. The syntax of a reference string includes the following elements:

[0093] [ <box><Basic HID><HID Qualifier><Point Qualifier><Attribute>

[0094] For each element,. / or / is used as the hierarchical separator. Square brackets are optional. BOX is used to identify the DPMS (Data Point Management System) device being referenced, which can be the controller name, workstation name, workstation IP address. The controller name and workstation name represent an ASCII string registered in the DPMS. If BOX is empty, it is defaulted to the local workstation. The Basic HID is the starting HID address identifying this reference, and the HID Qualifier is the subgroup identifying the Basic HID. The Point Qualifier is used to select a DPMS object from a group, and the alias of the object or its relative index number in the group can be input. The Attribute is an input, output, parameter, or status of the DPMS object.

[0095] The reference is associated with the category of the attribute. References associated with the input and parameter categories can be edited, and other attribute categories do not accept input. That is, input and parameter attributes can be used to reference other attributes, and the most commonly used is the input attribute. Using references, a control can be linked to other controls in the same configuration, or across configurations. Inputting a reference in a control to read attribute data, the reference can be used to read an attribute of the control where the reference is located, or an attribute of other controls, or an attribute of controls in other configurations.

[0096] In the configuration library, there are two tables corresponding to the corresponding configuration settings, namely the instance table and the instance attribute table. There is an association between these two tables, and there are also corresponding connections with the service table and the service attribute type table, as Figure 5 shown. There is a one-to-many relationship between the instance table and the service table, and there is also a one-to-many relationship between the instance table and the instance attribute table, and between the service attribute type table and the instance attribute table. When creating a new Service instance, according to the type of this Service, it is determined which attributes need to be configured, and these attributes are added to the instance attributes. In this database file, there is a table named Usage, and there is also a one-to-many relationship between this table and the instance table.

[0097] The process of controller configuration is to generate a configuration database file for each controller, defining the function blocks for controlling and data acquisition corresponding to the IO hardware related to one controller. A single configuration generally only represents a small part of a large application, and large and complex applications usually include multiple configurations of multiple controllers.

[0098] The configuration flowchart of the described controller is as Figure 6 shown, and its detailed process is as follows:

[0099] Step 1: Plan the required hardware resources. Generating a configuration database that conforms to the overall process control strategy requires preliminary planning. First, it's necessary to determine which control and data acquisition applications need to be implemented and their scope. Only after understanding the application scale in terms of hardware resources and total number of points can configuration construction begin.

[0100] Step 2: Based on the plan in Step 1, count the approximate number of measurement points in this control system. Calculate the required number of controllers from the number of measurement points, leaving a certain margin. Design a name and IP address for each controller and save them in the configuration file DPUList.ini. The format of the DPUList.ini file is as follows: each line describes the information of a controller, in the form of "[DPUIP Address]DpuName". To enhance reliability, a station consists of two pairs of controllers, serving as primary and backup to each other. The information of the backup controller is on the next line after the information of the primary controller. The IP address of the backup controller is one greater than the IP address of the primary controller, and the controller names are the same.

[0101] Step 3: Extract the basic algorithm library used in all controller configurations and pre-design and pre-configure it. First, create an empty template library (master template), and then create service tables, attribute type tables, data type tables, and usage tables within the template library. Specific table structure information is as follows... Figure 1 Detailed explanation. The data type table provides an open interface for defining new data types; the specific process is as follows: Figure 2 As stated above.

[0102] Step 4: Create a new configuration. Create a new configuration from scratch for an empty controller.

[0103] Step 5: Select a master template. Select a master template corresponding to the version number of the current configuration controller, i.e., the template library created in Step 3.

[0104] Step 6: Instantiate the master template, copy the configuration information from the master template to the newly created configuration, and use the current controller name as the name of the new configuration, which is also the name of the configuration library.

[0105] Step 7: Edit and set the inherent function blocks such as standard DPMS, Backup, time synchronization and communication threshold in the master version according to the specific situation of this controller to achieve the optimization of data acquisition and logic control of this controller.

[0106] Step 8: Define the hardware. Use buffers to define the detailed catalog of the I / O modules, specifying the positive definiteness and linearization requirements for the signals. The I / O modules communicate with the controller via the I / O bus. Each module has 1 to 16 channels, each channel corresponding to one signal, and each signal is assigned a tag name using Atag and Dtag function blocks.

[0107] Step 9: Define and generate local custom blocks. Custom function blocks are groups of function blocks packaged into reusable functions. Custom function blocks have a set of user-defined interface attributes. Custom function blocks can be used multiple times in a single configuration or copied to multiple configurations for reuse. Each custom block has a unique name and can be added to a list of available function blocks for configuration personnel to select. The simplest application is to implement a frequently used subroutine using a custom block. In the most complex applications, a custom block can be a combination of many inherent function blocks or custom controls that implement full PID control, multi-step sequential controllers, and other controls. Custom blocks can be combinations of inherent function blocks and other custom controls, and the maximum nesting depth of custom blocks within custom blocks is specified to be 4 layers.

[0108] Step 10: Define and generate local templates. The template function is used to generate reusable models with pre-defined attribute values ​​for any inherent or custom functionality. Multiple variations of the same functionality can be generated, each with a unique description illustrating the functionality represented by the pre-defined values ​​in its attribute set.

[0109] Step 11: Create a new group node. Group nodes are used for the logical division of functional blocks. When creating a new group node, enter both the group name and the relative index number to identify the current group. If the group cannot be identified by a tag name or group name parameter, the relative index number becomes particularly important. If you need to change the index number, you should ensure that the new index number is unique within the group.

[0110] Step 12: Create instance tables and instance attribute tables, select custom blocks, define control and data acquisition function blocks, and configure detailed information. During configuration, validate newly added instance attributes; the specific validation logic is as follows: Figure 4 As stated above.

[0111] Step 13: Edit the parameter pointers for function block interconnections. Parameters can be used to connect a control to other controls in the same configuration, or to connect across configurations. The attributes of a parameter can be the input, output, parameter, or status of a DPMS object.

[0112] Step 14: Verify and confirm the correctness of the reference point. The reference validity check function can be used to check the validity of a reference, both within the same configuration and external references pointing to function blocks in other controller configurations. If a bad reference is found, its path name will be listed in the status log display. Double-clicking the reference will locate its position in the configuration, and the status log can be printed or saved to a file.

[0113] Step 15: Download the configuration to the controller and test it. Configuration downloads are divided into full download, incremental download, and secure download. A full download transmits the entire configuration logic to the controller's memory via the communication link for execution during controller operation; an incremental download transmits any part of a single function block to the controller; a secure download downloads a security permission table into the controller. Before starting the download, it first checks whether the version of the configuration to be downloaded matches the version of the selected target controller; if they do not match, an error is reported.

[0114] Step 16: The configuration of this controller is complete. Start configuring the next controller.

[0115] The beneficial effects achieved by this invention are as follows:

[0116] (1) The design of using both template library and configuration library is adopted. By making the most of the basic information, the main library can be modeled once and used everywhere, which improves the efficiency of configuration. The instance data table in the configuration library is organized in a tree structure, which is logically clear and improves the ease of use.

[0117] (2) An attribute verification mechanism is adopted, and different verification rules are set according to different categories of attributes, which reduces the probability of errors and improves the reliability of the system.

[0118] (3) The design of specific data types is adopted to meet the needs of special application scenarios, make up for the limitations of basic data types, enhance scalability, and improve the judgment of data validity;

[0119] (4) The use of relative index numbers: In order to make child nodes easy to reference and sort within their groups, a relative index number is introduced for each child node. In the use of HID, for multiple child nodes of the same type within a group, their relative index numbers are used directly instead, which is more concise.

[0120] (5) Reference design. References are used to indicate the source of important data. The content in the reference is a relative position code or an absolute position code. The source of the data can be found quickly through its content, which enhances the user-friendliness and improves the efficiency of configuration.

[0121] (6) Design of custom function blocks and template generation modules. A set of user-definable interface attributes is provided for customizing a function block; the template generation module packages the custom module into a reusable function, which can be used multiple times in one configuration or copied to multiple configurations for reuse, thus improving the reusability of the algorithm.

[0122] Example 2

[0123] This embodiment provides a data modeling system in controller configuration, including:

[0124] The template library creation module includes a service table creation module, a service attribute type table creation module, and a specific data type creation module. It is used to create information tables in the template library based on the basic information required by the controller during configuration. The information tables include service tables, service attribute type tables, data type tables, and usage tables.

[0125] The loading module is used to select a template library based on the controller's category and version when creating a new configuration, retrieve information from its information table, and load it into memory;

[0126] The configuration library creation module is used to create a new configuration library based on the contents of the selected template library, and to copy the contents of the template library to the new configuration library;

[0127] The configuration library construction module includes an instance table creation module and an instance attribute table creation module, which are used to create instance tables and instance attribute tables in the new configuration library to complete the construction of the configuration library. After the configuration library is constructed, it can be directly loaded and used by the controller during configuration.

[0128] The data modeling system provides customizable function blocks and template generation modules. It offers a set of user-defined interface attributes to customize these function blocks, which can be easily implemented by defining services and their attributes (using a specific attribute validation mechanism). A simple extension is provided to allow for the expansion of these function blocks without modifying the configuration library.

[0129] The design of the custom function block is mainly implemented using two forms: one is to define the name, category and description, add them to the service table, and then define the relevant information of its required attributes, and write them to the service type table.

[0130] The template generation module is used to generate reusable models with any atomic block or custom functional attribute values ​​pre-defined. The same template can generate multiple different variants, each with a unique description.

[0131] The template generation module packages custom function blocks into reusable functions that can be used multiple times in a single configuration or copied to multiple configurations for reuse. Each custom block has a unique name and can be added to the list of available function blocks for selection.

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

Claims

1. A data modeling method in controller configuration, characterized in that, include: Create a template library and create information tables in the template library based on the basic information required by the controller during configuration. When creating a new configuration, select a template library based on the controller's category and version, retrieve the information from its information table, and load it into memory; Create a new configuration library based on the contents of the selected template library, and copy the contents of the template library to the new configuration library; Create instance tables and instance attribute tables in the new configuration library to complete the construction of the configuration library. Once the configuration library is built, it can be directly loaded and used by the controller during configuration. The information table includes a service table, a service attribute type table, a data type table, and a usage table, wherein: The service table defines the basic atomic block types, and the service attribute type table defines the basic attribute types corresponding to all atomic blocks in the service table. The instance table defines function block objects, which are instantiations of function block types, including atomic block objects in the template library and molecular block objects added later. The instance attribute table defines all created function block instances and their attributes, and records the configuration values ​​during actual runtime, including the node handle, attributes and corresponding actual values, function block type, and parameters. The step of creating a new configuration library based on the content of the selected template library and copying the content of the template library to the new configuration library also includes: Assign a unique configuration name to the configuration library, which is consistent with the name of the controller. Then, modify the configuration library when editing the configuration, create new custom atomic blocks or molecular blocks, write the information of the custom atomic blocks into the service table, and write any new attribute types into the service attribute type table. Provide a set of user-defined interface attributes for use in customizing a function block. Then, use the template function to package the custom function block or atomic block into a template with preset reusable attribute values. The template can be used multiple times in a configuration or copied to multiple configurations for reuse.

2. The data modeling method in controller configuration according to claim 1, characterized in that, The service table includes any one or more of the following: atomic block name, category, description, lock status, hidden flag, and revision time. The categories in the service table include system-level, cache-level, analog block, discrete logic, and state logic, used to distinguish atomic blocks. The lock status in the service table indicates whether the atomic block is locked. The hidden flag in the service table indicates whether the atomic block is visible during configuration; if it is hidden, related operations cannot be performed on it during configuration. The revision time in the service table records the time when the current atomic block was last modified, allowing for the tracing of modification history. In the service attribute type table, all attribute types have sub-attributes, which include category, description, data type, index, configuration flag, reference flag, security level, and any one or more of the maximum value, minimum value, and enumerated set variables used for data validation; the categories of the sub-attributes include normal, input, output, parameter, status, customized, and quality. In addition to basic attribute types, the data types in the service attribute type table also include specific data types, which provide four interfaces: add, modify, delete, and used count. Once the specific data type is defined, its name will be added to the data type table. The usage table defines the usage scenarios, including regular, system, custom, template category, template service, and template instance.

3. The data modeling method in controller configuration according to claim 2, characterized in that, The definition process for the specific data type is as follows: a) Add a new specific data type by calling the add interface. The parameters of the add interface include the specific data type name, the specific subtype, and the number of elements. b) Call the modification interface to update the content of the above parameters; the used count interface is used to view the number of times a specific data type is currently used. Each specific data type maintains a variable to count the number of times it is used. Whenever an attribute object selects this specific data type as its data type, the variable will increase by 1. Conversely, when an attribute object with a specific data type is removed, the variable will decrease by 1. c) When calling the delete interface for a specific data type to perform a delete operation, the counting interface is first called to check if the count being used is 0. If it is not 0, an attribute object using this specific data type is deleted, the count is decremented by 1, and the delete operation continues until the count being used is 0, at which point the deletion is truly complete.

4. The data modeling method in controller configuration according to claim 1, characterized in that, The configuration library stores information about atomic blocks and molecular blocks. A molecular block is a composite algorithm block built from two or more atomic blocks according to certain logic.

5. The data modeling method in controller configuration according to claim 1, characterized in that, The data in the example table is designed using a tree data structure, where each node has a parent node except for the root node; The instance table includes the handle of the current node, the handle of the parent node, references, the type of the function block to which it belongs and its corresponding handle, relative indexes and download status; The current node handle in the instance table is used to uniquely identify the current node, and the parent node handle represents the unique identifier of the current node's parent node, in order to record the parent-child logical relationship between two nodes, thus forming a tree structure. When a previously created configuration is reopened, the configuration content will be loaded from the instance table. The relative index in the instance table represents an ordered number of all child nodes under a group node. A group is an instance node with service type GRP, used to manage other instance nodes. It is selected by default in an incremental manner when creating a new group or control, or it can be manually modified by entering the desired index number. The relative index number of each group or control within a group must be unique, so as to represent the child nodes under a certain group node in another way. On the one hand, it represents the creation order of the child nodes, and on the other hand, it is used to identify a target group node or control in the reference field.

6. The data modeling method in controller configuration according to claim 1, characterized in that, The reference in the instance attribute table is a string that identifies the location of a specific attribute. A reference string includes the name of the reference attribute, the tag name of the control containing this attribute, an alias or relative multiple quotes, and the HID information.

7. The data modeling method in controller configuration according to claim 1, characterized in that, There is a relationship between the instance table and the instance attribute table, and there are also corresponding relationships between the instance table and the service table and the service attribute type table. There is a one-to-many relationship between the instance table and the service table, and there is also a one-to-many relationship between the instance table and the instance attribute table, and between the service attribute type table and the instance attribute table.

8. A data modeling system in controller configuration, used to implement the data modeling method in controller configuration according to any one of claims 1-7, characterized in that, include: The template library creation module includes a service table creation module, a service attribute type table creation module, and a specific data type creation module. It is used to create information tables in the template library based on the basic information required by the controller during configuration. The information tables include service tables, service attribute type tables, data type tables, and usage tables. The loading module is used to select a template library based on the controller's category and version when creating a new configuration, retrieve information from its information table, and load it into memory; The configuration library creation module is used to create a new configuration library based on the contents of the selected template library, and to copy the contents of the template library to the new configuration library; The configuration library construction module includes an instance table creation module and an instance attribute table creation module, which are used to create instance tables and instance attribute tables in the new configuration library to complete the construction of the configuration library. After the configuration library is constructed, it can be directly loaded and used by the controller during configuration.

9. The data modeling system in controller configuration according to claim 8, characterized in that, Also includes: The attribute validation module is used to verify and confirm the correctness of reference points and the validity of attribute values ​​of different data types; Custom function blocks are used to define the name, category, and description, add them to the service table, define the relevant information of the required attributes, and then write them to the service type table; The template generation module is used to generate reusable templates for any atomic block or custom function attribute value preset. It packages custom function blocks into reusable functions that can be used multiple times in a configuration or copied to multiple configurations for reuse. Each custom function block has a unique name and can be added to the list of available function blocks for selection.