Structural data storage access method and system applied to configuration software
By using a templated storage and referencing mechanism, only the difference attribute information of structured data instances is stored, which solves the problem of storage redundancy in configuration software and achieves storage space optimization and high efficiency in data access.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-13
AI Technical Summary
The way structured data is stored in existing configuration software leads to a large amount of redundant attribute value information, increasing storage space and transmission costs.
A templated storage and referencing mechanism is adopted to store only the difference attribute information of structured data instances and dynamically synthesize complete data when accessed.
It significantly saves storage space and transmission costs while ensuring the integrity and efficiency of data access.
Smart Images

Figure CN121658480A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of configuration software technology, and in particular to a method and system for accessing structured data storage in configuration software. Background Technology
[0002] In existing configuration software technologies, structured data is typically stored in its entirety, meaning that each structured data instance saves all its member attribute values. However, when a large number of similar structured data instances exist in the system, this storage method leads to the storage space being filled with a large amount of duplicate attribute value information that is identical to that defined in a generic template, resulting in significant data redundancy. This not only increases the size of the configuration project file but also increases the storage and time costs when transmitting data with the target control device (such as a PLC controller).
[0003] Therefore, there is an urgent need to provide a technical solution to address the above problems. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a method and system for accessing structured data storage in configuration software.
[0005] Firstly, the present invention provides a method for accessing structured data storage in configuration software, the technical solution of which is as follows: With the help of the interactive interface in the configuration software system, a triggered access request for a structured data instance is received, the access request including a target instance identifier; wherein, the structured data instance is configuration data corresponding to a function block instance in the PLC controller; In response to the access request, based on the target instance identifier, query the configuration archive file to see if there is a stored structured data instance with at least one member having different attribute information corresponding to the target instance identifier; if it exists, then obtain the structured data instance. Based on the structured data instance, obtain the template architecture to which the structured data instance belongs, the template architecture including template identifier and common attribute information of multiple members; Based on the differential attribute information in the structured data instance and the general attribute information of the structured data template, generate complete structured data with differential attribute information that can be displayed.
[0006] The beneficial effects of the structured data storage access method of the present invention applied in configuration software are as follows: The method of this invention uses a templated storage and referencing mechanism to store only the differences in structured data instances, which significantly saves storage space and transmission costs. By dynamically synthesizing complete data during access, it achieves simplified storage while ensuring the integrity and efficiency of data access.
[0007] Based on the above solution, the structured data storage access method of the present invention applied to configuration software can be further improved as follows.
[0008] In one alternative approach, the step of generating complete structured data with differentiated attribute information that can be displayed, based on the differentiated attribute information in the structured data instance and the general attribute information of the structured data template, includes: Based on the general attribute information, an initial attribute set is generated; the attribute values in the initial attribute set are default attribute values from the general attribute information. For any attribute, if a corresponding difference attribute value exists in the difference attribute information, then the default attribute value of the corresponding attribute in the initial attribute set is replaced with the difference attribute value of the structured data instance; otherwise, the default attribute value in the general attribute information corresponding to the structured data template remains unchanged to generate the complete structured data.
[0009] Among the above optional methods, by generating an initial attribute set based on common attribute information and dynamically replacing the default attribute values according to the difference attribute information, storage redundancy is effectively avoided, ensuring that complete data can be quickly synthesized during access. This not only significantly reduces storage space occupation but also ensures the real-time and completeness of data queries, thereby achieving dual optimization of storage simplification and access efficiency in the configuration software.
[0010] In one alternative approach, it also includes: With the help of the interactive interface in the configuration software system, a triggered template definition instruction is received; the template definition instruction is used to define the template architecture, including the template identifier of the corresponding template and the predefined general attribute information for multiple members of the template; A structured data template is created based on the general attribute information; wherein, the structured data template is a function block template used to control the PLC controller, each member in the structured data template is uniquely identified by a member identifier, and at least one general attribute is predefined, each general attribute having a corresponding default attribute value; The created structured data template is associated with the template identifier and stored in the configuration project archive file.
[0011] Among the above optional methods, by providing a template definition mechanism, users can easily create and reuse structured data templates. This not only reduces the workload of repeatedly defining the same structure and improves configuration efficiency, but also ensures the consistency of the structure throughout the configuration project, laying an efficient foundation for subsequent structured data instantiation and significantly improving system reusability.
[0012] In one optional approach, the general attribute information includes: attribute description, attribute type, and default attribute value; The value of the attribute type is either a data type identifier or a template identifier of another structured data template. When the value of the attribute type is a template identifier, the member structure defined by the other structured data template is integrated into the member, thereby forming a nested hierarchical structure.
[0013] Among the above optional methods, detailed definition of general attribute information includes attribute description, attribute type and default attribute value, and supports the identification of attribute type as another structured data template, so that structured data can support nested hierarchical structure, meet the needs of complex control systems for multi-layer data structure, and at the same time maintain the simplicity of data storage and the convenience of access.
[0014] In one alternative approach, it also includes: With the help of the interactive interface in the configuration software system, the triggered modification command is received, and the modification command includes the target instance identifier, the target member identifier and the target attribute value; In response to the modification instruction, based on the target instance identifier and the target member identifier, it is determined whether the target member attribute stores a different attribute value in the corresponding structured data instance; If a difference attribute value is stored, then update the difference attribute value to the target attribute value; If the difference attribute value is not stored, then a difference attribute value with the value of the target attribute is created and stored for the target member attribute.
[0015] Among the above optional methods, by intelligently determining whether the target member attribute has already stored the difference attribute value in the instance, and updating or creating the difference attribute value accordingly, the user modification operation is simplified, the repeated storage of the entire structure is avoided, and the data modification process is made more intuitive and efficient. This reduces the user's operation steps and maintains the simplicity of the stored content.
[0016] In one alternative approach, when the structured data storage access method is applied to a motor control system, the structured data template is a function block template for motor control in the PLC controller, and its template identifier is Motor; the members defined by the general attribute information include: The member identified as Tpw has an attribute description in its general attribute information: output pulse width. The attribute type is a real number, and the default attribute value is 5. Members identified as Speed have a general attribute description of motor speed, an integer type, and a default value of 0. For members identified as Enable, the general attribute information describes the attribute as an enable signal, the attribute type is Boolean, and the default attribute value is false.
[0017] Among the above-mentioned alternatives, an application example demonstrates significant advantages in specific scenarios, such as saving a large amount of storage space for controlling hundreds of motors, making abstract technical solutions concrete and perceptible, and powerfully proving their practical value and huge potential in real industrial environments.
[0018] In an alternative approach, the members of the function block template further include a member identified as ControlModule, whose attribute type is defined as a template identifier of a PID control function block template, used to provide closed-loop regulation logic for motor control, so as to form a two-layer nested hierarchical structure through the function block template and the PID control function block template.
[0019] Among the above optional approaches, it is demonstrated how to support the construction of complex control logic. By using two layers of template nesting, a general motor control is modularly combined with a specialized closed-loop PID regulation algorithm, which not only demonstrates the flexibility of the architecture, but also shows that it can support the design of high-performance and highly complex industrial control strategies, thus meeting the design requirements of advanced control systems.
[0020] Secondly, this invention provides a structured data storage and access system applied in configuration software, the technical solution of which is as follows: The structured data storage and access system applied in configuration software includes: The request receiving module is used to receive a triggered access request for a structured data instance via the interactive interface of the configuration software system. The access request includes a target instance identifier. The structured data instance is configuration data corresponding to a function block instance in the PLC controller. The instance acquisition module is used to respond to the access request and, based on the target instance identifier, query the configuration archive file to see if there is a stored structured data instance with at least one member with different attribute information corresponding to the target instance identifier; if it exists, the structured data instance is acquired. The template acquisition module is used to obtain the template architecture to which the structured data instance belongs based on the structured data instance. The template architecture includes a template identifier and common attribute information of multiple members. The attribute synthesis module is used to generate complete structured data with differentiated attribute information that can be displayed, based on the differentiated attribute information in the structured data instance and the general attribute information of the structured data template.
[0021] The beneficial effects of the structured data storage and access system of the present invention applied in configuration software are as follows: The system of this invention uses a templated storage and referencing mechanism to store only the differences in the structured data instance, which significantly saves storage space and transmission costs. By dynamically synthesizing complete data during access, it achieves simplified storage while ensuring the integrity and efficiency of data access.
[0022] Based on the above solution, the structured data storage and access system of the present invention applied to configuration software can be further improved as follows.
[0023] In an alternative embodiment, the attribute synthesis module is specifically used for: Based on the general attribute information, an initial attribute set is generated; the attribute values in the initial attribute set are default attribute values from the general attribute information. For any attribute, if a corresponding difference attribute value exists in the difference attribute information, then the default attribute value of the corresponding attribute in the initial attribute set is replaced with the difference attribute value of the structured data instance; otherwise, the default attribute value in the general attribute information corresponding to the structured data template remains unchanged to generate the complete structured data.
[0024] Among the above optional methods, by generating an initial attribute set based on common attribute information and dynamically replacing the default attribute values according to the difference attribute information, storage redundancy is effectively avoided, ensuring that complete data can be quickly synthesized during access. This not only significantly reduces storage space occupation but also ensures the real-time and completeness of data queries, thereby achieving dual optimization of storage simplification and access efficiency in the configuration software.
[0025] In one alternative approach, it also includes: The template storage module is used to receive triggered template definition instructions through the interactive interface of the configuration software system; the template definition instructions are used to define the template architecture, including the template identifier of the corresponding template and predefined general attribute information for multiple members of the template; A structured data template is created based on the general attribute information; wherein, the structured data template is a function block template used to control the PLC controller, each member in the structured data template is uniquely identified by a member identifier, and at least one general attribute is predefined, each general attribute having a corresponding default attribute value; The created structured data template is associated with the template identifier and stored in the configuration project archive file.
[0026] Among the above optional methods, by providing a template definition mechanism, users can easily create and reuse structured data templates. This not only reduces the workload of repeatedly defining the same structure and improves configuration efficiency, but also ensures the consistency of the structure throughout the configuration project, laying an efficient foundation for subsequent structured data instantiation and significantly improving system reusability.
[0027] In one optional approach, the general attribute information includes: attribute description, attribute type, and default attribute value; The value of the attribute type is either a data type identifier or a template identifier of another structured data template. When the value of the attribute type is a template identifier, the member structure defined by the other structured data template is integrated into the member, thereby forming a nested hierarchical structure.
[0028] Among the above optional methods, detailed definition of general attribute information includes attribute description, attribute type and default attribute value, and supports the identification of attribute type as another structured data template, so that structured data can support nested hierarchical structure, meet the needs of complex control systems for multi-layer data structure, and at the same time maintain the simplicity of data storage and the convenience of access.
[0029] In one alternative approach, it also includes: The attribute modification module is used to receive triggered modification instructions through the interactive interface of the configuration software system. The modification instructions include the target instance identifier, the target member identifier, and the target attribute value. In response to the modification instruction, based on the target instance identifier and the target member identifier, it is determined whether the target member attribute stores a different attribute value in the corresponding structured data instance; If a difference attribute value is stored, then update the difference attribute value to the target attribute value; If the difference attribute value is not stored, then a difference attribute value with the value of the target attribute is created and stored for the target member attribute.
[0030] Among the above optional methods, by intelligently determining whether the target member attribute has already stored the difference attribute value in the instance, and updating or creating the difference attribute value accordingly, the user modification operation is simplified, the repeated storage of the entire structure is avoided, and the data modification process is made more intuitive and efficient. This reduces the user's operation steps and maintains the simplicity of the stored content.
[0031] In an alternative embodiment, when the system is configured for use in a motor control system, the structured data template is a function block template for motor control in the PLC controller, and its template identifier is Motor; the members defined by the general attribute information include: The member identified as Tpw has an attribute description in its general attribute information: output pulse width. The attribute type is a real number, and the default attribute value is 5. Members identified as Speed have a general attribute description of motor speed, an integer type, and a default value of 0. For members identified as Enable, the general attribute information describes the attribute as an enable signal, the attribute type is Boolean, and the default attribute value is false.
[0032] Among the above-mentioned alternatives, an application example demonstrates significant advantages in specific scenarios, such as saving a large amount of storage space for controlling hundreds of motors, making abstract technical solutions concrete and perceptible, and powerfully proving their practical value and huge potential in real industrial environments.
[0033] In an alternative approach, the members of the function block template further include a member identified as ControlModule, whose attribute type is defined as a template identifier of a PID control function block template, used to provide closed-loop regulation logic for motor control, so as to form a two-layer nested hierarchical structure through the function block template and the PID control function block template.
[0034] Among the above optional approaches, it is demonstrated how to support the construction of complex control logic. By using two layers of template nesting, a general motor control is modularly combined with a specialized closed-loop PID regulation algorithm, which not only demonstrates the flexibility of the architecture, but also shows that it can support the design of high-performance and highly complex industrial control strategies, thus meeting the design requirements of advanced control systems.
[0035] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0036] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a flowchart illustrating an embodiment of a structured data storage access method applied in configuration software according to the present invention. Figure 2 This is a flowchart illustrating the structured data synthesis process of the present invention; Figure 3 This is a flowchart illustrating the structured data template definition and storage process of the present invention; Figure 4 This is an overall flowchart of the process for modifying the structured data instance of the present invention; Figure 5 This is a schematic diagram of an embodiment of a structured data storage and access system applied in configuration software according to the present invention. Detailed Implementation
[0037] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0038] In the field of configuration software technology for industrial control systems, structured data is the fundamental unit for building control logic, used to define and access complex data structures such as function blocks and variables in programmable logic controllers (PLCs). In a large industrial project, such as an automotive manufacturing production line or a chemical process control system, a large number of control units with similar functions but slightly different parameters are typically used, such as starters controlling hundreds of motors or temperature sensors monitoring thousands of points. These control units are represented as structured data instances in the configuration software. Existing technologies typically employ a direct but inefficient storage method: each structured data instance stores all its attribute information completely, including those that are identical to a generic template. This "full storage" model ignores the high similarity between data, resulting in a large amount of redundant information in the configuration project archive files.
[0039] For example, in a typical motor control system, an engineer defines a generic motor control function block template (e.g., named "Motor") containing all the attributes needed to control a motor, such as pulse width (Tpw), speed (Speed), and enable signal (Enable), and assigns these attributes generic default values. When controlling 100 motors of the same model but with different individual parameters (e.g., pulse width), existing technology creates 100 motor control instances (e.g., Motor_1 to Motor_100) and stores a complete list of attributes for each of these 100 instances in the archive. This means that even if 99 instances use the template's default attribute value of 5 for pulse width, the archive for these 99 instances will still repeatedly store the information "pulse width = 5," resulting in a huge waste of storage space. This not only increases the size of the configuration project file but also significantly increases the required storage cost and download time when downloading the configuration to a PLC controller with limited storage space; similarly, it also takes more time to upload the configuration.
[0040] To address the aforementioned drawbacks, the core idea of this invention lies in separating the storage of general attributes and instance-specific attributes. Specifically, this invention predefines and stores a complete structured data template architecture, which contains the general attribute information and default attribute values of all members of a certain type of functional block (such as motor control). When a specific instance is created, the instance only needs to store its name used to identify itself and those "difference attributes" that differ from the default attribute values of the template. Taking the aforementioned motor control system as an example, for 100 motor instances, the configuration archive only saves one complete "Motor" template. Of the 100 instances, only the motor instance whose pulse width is modified to 10 (Motor_1) needs to record the difference attribute value "Tpw=10" in its archive. The remaining 99 instances using default attribute values do not need to store any pulse width information, thereby greatly reducing storage capacity.
[0041] When accessing or displaying complete data for a specific instance is required, a dynamic synthesis process ensures data integrity. First, the instance and its referenced template are located based on the instance identifier. Then, using the common attribute information provided by the template as a base, an initial complete data view is generated. Next, the differing attribute values stored in the instance are used to overwrite the corresponding default attribute values in the base. Finally, a complete and accurate instance data is quickly synthesized and presented to the user. This method cleverly resolves the contradiction between streamlined storage and complete access, significantly reducing storage and transmission overhead while ensuring efficiency in configuration engineering and debugging.
[0042] Figure 1This diagram illustrates a flowchart of an embodiment of a structured data storage access method for configuration software provided by the present invention. This method is executed by a structured data storage access system applied to configuration software. Figure 1 As shown, it includes the following steps: S1. Using the interactive interface of the configuration software system, receive a triggered access request for a structured data instance, the access request including the target instance identifier; wherein, the structured data instance is the configuration data corresponding to a function block instance in the PLC controller.
[0043] For example, a target instance identifier can be a unique name in configuration software corresponding to a function block instance of a specific industrial device (such as a valve or a motor). When a user clicks on the device icon in the monitoring screen to view or modify its parameters, an access request containing this identifier is triggered.
[0044] Understandably, a structured data instance is a logical collection of all configuration data used in configuration software to map and control a specific functional unit (such as a function block) within a PLC controller. It has been created and associated with a specific physical device during the configuration project development phase.
[0045] S2. In response to the access request, based on the target instance identifier, query whether there is a stored structured data instance in the configuration archive file that corresponds to the target instance identifier and has differential attribute information of at least one member; if it exists, retrieve the structured data instance.
[0046] For example, based on the received instance identifier (such as "Valve_001"), the system locates the storage record of the instance in the project archive and loads it into memory. This record is the persistent form of the structured data instance.
[0047] Understandably, the difference attribute information here specifically refers to those member attributes and their values in this instance whose specific values differ from the default attribute values of the referenced general template. The storage mechanism of this invention ensures that, in the archive, instances typically only store this part of the difference content, rather than the complete set of all attributes, thereby optimizing storage space.
[0048] S3. Based on the structured data instance, obtain the template schema to which the structured data instance belongs. The template schema includes the template identifier and common attribute information of multiple members.
[0049] For example, the template identifier (e.g., "Motor_Template") referenced by the obtained instance data is parsed out, and then the corresponding complete template definition is retrieved from the template library based on this template identifier.
[0050] Understandably, a template architecture is a predefined, reusable data structure blueprint that is uniquely identified by a template identifier and contains a set of standardized definitions that describe the common "general attribute information" shared by a class of functional units (such as all motors), including the attribute names, data types, functional descriptions, and standard default attribute values of all members.
[0051] S4. Based on the differential attribute information in the structured data instance and the general attribute information of the structured data template, generate complete structured data with differential attribute information that can be displayed.
[0052] Understandably, this step is the core data merging process. Using the complete attribute set and default attribute values provided by the template's general attribute information obtained in the previous step as a base, the differencing attribute information stored in the instance is then applied to this base like a patch. For any attribute in the base, if a corresponding item exists in the differencing information, the differencing attribute value overwrites the default attribute value; otherwise, the default attribute value is retained. Ultimately, through this dynamic merging mechanism, a complete data view containing all attributes (including default attributes inherited from the template and instance-specific differencing attributes) is generated, directly displayable to the user. This process seamlessly ensures the integrity and accuracy of user-accessed data while maintaining a highly streamlined underlying storage.
[0053] It should be noted that when defining a structured data template, it must be constructed according to specific structural specifications. For example, a complete structured data template is defined in the following form: Mode={name=Mode,desc,default,...,Children{Child1={name=Child1,desc,type,default,...,Children{...}},Child2={name,desc,type,default,...,Children{...}},...}}; Here, `Mode` represents the structured data template itself; `name=Mode` is the template identifier, used to uniquely name the template; `desc` is the template's descriptive information, one of the template's general attributes; `default` is the template's default attribute value; `Children` is a collection used to contain the template's members, each member such as `Child1`, `Child2`, etc., is an independent object. For each member, such as `Child1`, its definition includes: `name=Child1` is the member identifier; `desc` is the member's descriptive information; `type` is the member's data type, its value can be a basic type (such as `REAL`) or the identifier of another template (for nesting); `default` is the member's default attribute value; `Children{...}` indicates that this member can contain subordinate members, thus supporting nested structures. It should be noted that the `name` attribute of all elements is their unique identifier, ensuring the recognizability of templates and members.
[0054] This invention has significant application value in industrial control systems (especially PLC control systems). In typical industrial scenarios, configuration software (such as Siemens WinCC and Rockwell FactoryTalk) is used to configure the input / output points of the PLC controller, and each controlled object (such as a motor or pump) needs to define structured data. To more clearly illustrate the specific implementation in industrial control systems, a motor control function block, which is one of the most common functions in PLC programming, will be used as an example. Those skilled in the art will understand that this example is for illustrative purposes only, and the invention is also applicable to function blocks in various industrial devices such as valves, actuators, and PID controllers.
[0055] In one alternative approach, the step of generating complete structured data with differentiated attribute information that can be displayed, based on the differentiated attribute information in the structured data instance and the general attribute information of the structured data template, includes: Based on general attribute information, an initial attribute set is generated; the attribute values in the initial attribute set are default attribute values from the general attribute information. For any attribute, if a corresponding differential attribute value exists in the differential attribute information, then the default attribute value of the corresponding attribute in the initial attribute set is replaced with the differential attribute value of the structured data instance; otherwise, the default attribute value in the general attribute information corresponding to the structured data template remains unchanged to generate complete structured data.
[0056] In this embodiment, as Figure 2As shown, an initial attribute set is first generated based on the general attribute information obtained from the template architecture. The initial value of each attribute in this initial attribute set is directly derived from the predefined default attribute value in the general attribute information.
[0057] Subsequently, iterate through any attribute in the initial attribute set and perform the following core operations: if a corresponding differential attribute value exists in the differential attribute information of the current structured data instance, then perform an overwrite operation, that is, replace the default attribute value of the corresponding attribute in the initial attribute set with the differential attribute value of the structured data instance; otherwise, that is, if the attribute has no differential definition in the instance, then keep the default attribute value in the general attribute information corresponding to the structured data template unchanged.
[0058] Through the above traversal and replacement / preservation operations on all attributes, a complete structured data containing all common attributes and the latest values of their instances is dynamically generated for display.
[0059] To facilitate understanding, let's illustrate this with an example from a motor control scenario: For instance, based on the general attribute information obtained from the "Motor" template, an initial attribute set is generated, where the "Default" attribute of member "Tpw" takes the default attribute value "5" defined by the template. When a difference attribute value (e.g., "10") for the "Default" attribute of "Tpw" is found in the difference attribute information of instance "Motor_1", a replacement operation is performed, replacing the default attribute value "5" in the initial set with the difference attribute value "10". For all other attributes of the instance that are not modified, their default attribute values from the template remain unchanged (e.g., "Desc" remains "output pulse width", and "Type" remains "REAL"). The final generated complete structured data accurately reflects the current state of instance "Motor_1".
[0060] For example, the storage structure of instance "Motor_1" might be as follows: {, "Name": "Motor_1", "Type": "Motor", "Children": {, "Tpw": {, "Default": 10 }, }, }; The final complete data structure is presented as the synthesized result, as shown in the following example: {, "Name": "Motor_1", "Type": "Motor", "Desc": "Motor Control", "Children": {, "Tpw": {, "Desc": "Output pulse width", "Type": "REAL", "Default": 10, }, "Speed": {, "Desc": "Motor speed", Type: "INT", "Default": 0, }, "Enable": {, "Desc": "Enable signal", Type: "BOOL", "Default": false, }, }, }
[0061] In one alternative approach, it also includes: With the help of the interactive interface in the configuration software system, the triggered template definition command is received; the template definition command is used to define the template architecture, including the template identifier of the corresponding template and the predefined general attribute information for multiple members of the template; A structured data template is created based on general attribute information. The structured data template is a function block template used to control the PLC controller. Each member in the structured data template is uniquely identified by a member identifier and has at least one predefined general attribute. Each general attribute has a corresponding default attribute value. The created structured data templates are associated with template identifiers and stored in the configuration project archive file.
[0062] In one optional approach, the general attribute information includes: attribute description, attribute type, and default attribute value; The attribute type value is either a data type identifier or a template identifier of another structured data template. When the attribute type value is a template identifier, the member structure defined by the other structured data template is integrated into the member, thereby forming a nested hierarchical structure.
[0063] In this embodiment, as Figure 3As shown, firstly, the system receives a triggered template definition command through the interactive interface of the configuration software system. The core function of this template definition command is to define the template architecture, which includes the template identifier of the corresponding template and predefined general attribute information for multiple members of the template.
[0064] Subsequently, a structured data template is created based on the general attribute information. In the industrial control context, this structured data template serves as a function block template for controlling the PLC controller. Within this template, each member is uniquely identified by a member identifier and has at least one predefined general attribute, each with a corresponding default attribute value.
[0065] Finally, the created structured data template is associated with a template identifier and stored in the configuration project archive file for reference when creating subsequent instances.
[0066] Furthermore, in the template definition, general attribute information includes: attribute description, attribute type, and default attribute value. The attribute type here defines a key characteristic: its value is either a data type identifier or a template identifier for another structured data template. When the attribute type value is a template identifier, a nesting mechanism is triggered, integrating the member structure defined by another structured data template into that member, thus forming a nested hierarchical structure.
[0067] To facilitate understanding, a specific scenario is illustrated below: For example, when defining a template, an engineer inputs instructions through an interactive interface to define a motor control template architecture with the template identifier "Motor" and predefines common attribute information for its members. For instance, the attribute description for the member "Tpw" is "output pulse width", the attribute type is "REAL", and the default attribute value is "5".
[0068] Understandably, a template identifier (such as "Motor") is a unique identifier for this template, used for referencing instances. A member identifier (such as "Tpw") is used to uniquely identify a member within the template. Common attribute information (such as description, type, and default attribute values) together constitute the complete standardized definition of this member.
[0069] Nesting becomes applicable when defining more complex devices. For example, within the "Motor" template, a member named "CoolingFan" can be defined, and its attribute type value can be set to the template identifier of another defined "Fan_Template," rather than a basic data type. In this way, the "CoolingFan" member integrates all the member structures defined by "Fan_Template" (such as fan speed, status, etc.), thus forming a nested hierarchical structure under the "Motor" template. This precisely maps the physical composition of the motor in the actual device, which includes a complex cooling fan unit.
[0070] In one alternative approach, it also includes: With the help of the interactive interface in the configuration software system, the system receives triggered modification commands, which include the target instance identifier, the target member identifier, and the target attribute value. In response to the modification command, based on the target instance identifier and the target member identifier, determine whether the target member attribute has a different attribute value stored in the corresponding structured data instance; If there are stored difference attribute values, then update the difference attribute values to the target attribute values; If the difference attribute value is not stored, a difference attribute value is created and stored for the target member attribute, taking the value of the target attribute.
[0071] In this embodiment, as Figure 4 As shown, firstly, the system receives a triggered modification command through the interactive interface of the configuration software system. This modification command explicitly includes the target instance identifier, target member identifier, and target attribute value, which together indicate the specific object and new value that the user intends to modify.
[0072] Subsequently, in response to the modification command, the core judgment logic is executed: based on the target instance identifier and the target member identifier, it is determined whether the target member attribute has a different attribute value stored in the corresponding structured data instance.
[0073] Based on the judgment result, perform the branch operation: if a difference attribute value is stored, perform the update operation, that is, update the difference attribute value to the target attribute value; if no difference attribute value is stored, perform the creation operation, that is, create and store a difference attribute value with the value of the target attribute for the target member attribute.
[0074] To facilitate understanding, a specific scenario is illustrated below: For instance, a user modifies the "Default" attribute of the "Tpw" member of a motor instance identified as "Motor_1" through the configuration software interface, changing its value to 10. The data storage structure before the modification is as follows: {, "Name": "Motor_1", "Type": "Motor", }; Upon receiving this modification instruction, the system first searches the storage data of the "Motor_1" instance to see if the member attribute already contains a different attribute value, based on the target instance identifier "Motor_1" and the target member identifier "Tpw".
[0075] Understandably, a modification command is an operation command initiated by the user through the interface, requesting a change to the value of a specific member attribute in a specific instance. The target instance identifier and the target member identifier jointly and uniquely identify the location of the attribute to be modified. The difference attribute value is the attribute value in instance storage that differs from the default attribute value of the template.
[0076] If this attribute has not been modified in the instance before, i.e., no difference attribute value has been stored, a new difference attribute value of 10 will be created and stored. If a difference attribute value has already been stored in the instance (e.g., originally 8), that value will be directly updated to the new target attribute value of 10. The modified data storage structure is as follows: {, "Name": "Motor_1", "Type": "Motor", "Children": {, "Tpw": {, "Default": 10, }, }, }; This mechanism ensures that all user modifications are accurately recorded, while maintaining the principle of minimizing instance data storage.
[0077] In one alternative approach, when the structured data storage access method is applied to a motor control system, the structured data template is a function block template for motor control in the PLC controller, and its template identifier is Motor; the members defined by the general attribute information include: The member identified as Tpw has an attribute description in its general attribute information: output pulse width. The attribute type is a real number, and the default attribute value is 5. Members identified as Speed have a general attribute description of motor speed, an integer type, and a default value of 0. For members identified as Enable, the general attribute information describes the attribute as an enable signal, the attribute type is Boolean, and the default attribute value is false.
[0078] In an alternative approach, the function block template also includes a member identified as ControlModule, whose attribute type is defined as a template identifier for a PID control function block template, used to provide closed-loop regulation logic for motor control, so as to form a two-layer nested hierarchical structure through the function block template and the PID control function block template.
[0079] In this embodiment, in this application scenario, engineers can create multiple motor control instances based on this "Motor" template. For example, when creating the "Motor_1" instance, if all attributes use the template's default attribute values, the instance archive only needs to store its instance identifier and template reference relationship, without having to repeatedly store the complete structured data of all members, thus significantly saving storage space.
[0080] Understandably, in this specific application scenario, the structured data template refers specifically to a standardized data structure blueprint designed for the particular function of motor control. The template identifier "Motor" serves as the template's unique identity. Each member represents a key parameter for motor control, uniquely identified within the template by its member identifier (such as Tpw, Speed, Enable). General attribute information (including description, type, and default attribute values) provides a complete standardized definition for these parameters.
[0081] For practical applications with nested hierarchies, such as defining the "ControlModule" member in the "Motor" template, its attribute type is set to "PID_Controller" (a predefined PID control template identifier). This automatically integrates a complete PID control unit into each motor control instance.
[0082] In this process, the nested hierarchical structure is implemented through template references. For example, the template structure of a motor containing a PID control module is as follows: {, "name": "Motor", "desc": "Motor control function block", "Children": {, "Tpw": {, "name": "Tpw", "desc": "Output pulse width", "type": "REAL", "default": 5, }, "ControlModule": {, "name": "ControlModule", "type": "PID_Controller", "desc": "PID control module" }, }, }; Here, "PID_Controller" is an identifier for another template, defined as follows: {, "name": "PID_Controller", "desc": "PID control function block", "Children": {, "Kp": {, "name": "Kp", "desc": "proportioning factor", "type": "REAL", "default": 1.0, },, "Ki": {, "name": "Ki", "desc": "Integral coefficient", "type": "REAL", "default": 0.1, }, }, }; Understandably, this nested hierarchical structure is implemented through template references. When the attribute type value of a member is the identifier of another template (such as `type="PID_Controller"` in `ControlModule`), that member inherits all the member structures defined by the referenced template. In this example, a two-level nesting structure of "motor control template -> PID control module" is formed, accurately mapping the complex logical relationship of the motor requiring a closed-loop controller in the actual control system, while maintaining storage economy.
[0083] Figure 5 This diagram illustrates a structural schematic of an embodiment of a structured data storage and access system 200 applied in configuration software, provided by the present invention. Figure 5 As shown, the system 200 includes: The request receiving module 210 is used to receive a triggered access request for a structured data instance via the interactive interface of the configuration software system. The access request includes a target instance identifier. The structured data instance is the configuration data corresponding to a function block instance in the PLC controller. The instance acquisition module 220 is used to respond to an access request and, based on the target instance identifier, query whether there is a stored structured data instance in the configuration archive file that corresponds to the target instance identifier and has differential attribute information of at least one member; if it exists, the structured data instance is acquired. The template acquisition module 230 is used to obtain the template architecture to which the structured data instance belongs based on the structured data instance. The template architecture includes the template identifier and common attribute information of multiple members. The attribute synthesis module 240 is used to generate complete structured data with differentiated attribute information that can be displayed, based on the differentiated attribute information in the structured data instance and the general attribute information of the structured data template.
[0084] The technical solution of this embodiment uses a templated storage and referencing mechanism to store only the differences in the structured data instance, which significantly saves storage space and transmission costs. By dynamically synthesizing complete data during access, it achieves simplified storage while ensuring the integrity and efficiency of data access.
[0085] In one alternative approach, the attribute composition module is specifically used for: Based on general attribute information, an initial attribute set is generated; the attribute values in the initial attribute set are default attribute values from the general attribute information. For any attribute, if a corresponding differential attribute value exists in the differential attribute information, then the default attribute value of the corresponding attribute in the initial attribute set is replaced with the differential attribute value of the structured data instance; otherwise, the default attribute value in the general attribute information corresponding to the structured data template remains unchanged to generate complete structured data.
[0086] In one alternative approach, it also includes: The template storage module is used to receive triggered template definition instructions through the interactive interface of the configuration software system. The template definition instructions are used to define the template architecture, including the template identifier of the corresponding template and the predefined general attribute information for multiple members of the template. A structured data template is created based on general attribute information. The structured data template is a function block template used to control the PLC controller. Each member in the structured data template is uniquely identified by a member identifier and has at least one predefined general attribute. Each general attribute has a corresponding default attribute value. The created structured data templates are associated with template identifiers and stored in the configuration project archive file.
[0087] In one optional approach, the general attribute information includes: attribute description, attribute type, and default attribute value; The attribute type value is either a data type identifier or a template identifier of another structured data template. When the attribute type value is a template identifier, the member structure defined by the other structured data template is integrated into the member, thereby forming a nested hierarchical structure.
[0088] In one alternative approach, it also includes: The attribute modification module is used to receive triggered modification commands through the interactive interface of the configuration software system. The modification commands include the target instance identifier, the target member identifier, and the target attribute value. In response to the modification command, based on the target instance identifier and the target member identifier, determine whether the target member attribute has a different attribute value stored in the corresponding structured data instance; If there are stored difference attribute values, then update the difference attribute values to the target attribute values; If the difference attribute value is not stored, a difference attribute value is created and stored for the target member attribute, taking the value of the target attribute.
[0089] In an alternative approach, when the system is configured for use in a motor control system, the structured data template is a function block template for motor control in a PLC controller, and its template identifier is Motor; the members defined by the general attribute information include: The member identified as Tpw has an attribute description in its general attribute information: output pulse width. The attribute type is a real number, and the default attribute value is 5. Members identified as Speed have a general attribute description of motor speed, an integer type, and a default value of 0. For members identified as Enable, the general attribute information describes the attribute as an enable signal, the attribute type is Boolean, and the default attribute value is false.
[0090] In an alternative approach, the function block template also includes a member identified as ControlModule, whose attribute type is defined as a template identifier for a PID control function block template, used to provide closed-loop regulation logic for motor control, so as to form a two-layer nested hierarchical structure through the function block template and the PID control function block template.
[0091] The parameters and steps for implementing the corresponding functions of each module in the structured data storage access system 200 applied in configuration software described above can be referred to the parameters and steps in the embodiments of the structured data storage access method applied in configuration software above, and will not be repeated here.
[0092] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.
[0093] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0094] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for accessing structured data in configuration software, characterized in that, include: With the help of the interactive interface in the configuration software system, a triggered access request for a structured data instance is received, the access request including a target instance identifier; wherein, the structured data instance is configuration data corresponding to a function block instance in the PLC controller; In response to the access request, based on the target instance identifier, query the configuration archive file to see if there is a stored structured data instance with at least one member having different attribute information corresponding to the target instance identifier; if it exists, then obtain the structured data instance. Based on the structured data instance, obtain the template architecture to which the structured data instance belongs, the template architecture including template identifier and common attribute information of multiple members; Based on the differential attribute information in the structured data instance and the general attribute information of the structured data template, generate complete structured data with differential attribute information that can be displayed.
2. The method according to claim 1, characterized in that, The steps for generating complete structured data with distinguished attribute information that can be displayed, based on the distinguished attribute information in the structured data instance and the general attribute information of the structured data template, include: Based on the general attribute information, an initial attribute set is generated; the attribute values in the initial attribute set are default attribute values from the general attribute information. For any attribute, if a corresponding difference attribute value exists in the difference attribute information, then the default attribute value of the corresponding attribute in the initial attribute set is replaced with the difference attribute value of the structured data instance; otherwise, the default attribute value in the general attribute information corresponding to the structured data template remains unchanged to generate the complete structured data.
3. The method according to claim 1, characterized in that, Also includes: With the help of the interactive interface in the configuration software system, a triggered template definition instruction is received; the template definition instruction is used to define the template architecture, including the template identifier of the corresponding template and the predefined general attribute information for multiple members of the template; A structured data template is created based on the general attribute information; wherein, the structured data template is a function block template used to control the PLC controller, each member in the structured data template is uniquely identified by a member identifier, and at least one general attribute is predefined, each general attribute having a corresponding default attribute value; The created structured data template is associated with the template identifier and stored in the configuration project archive file.
4. The method according to claim 3, characterized in that, The general attribute information includes: attribute description, attribute type, and default attribute value; The value of the attribute type is either a data type identifier or a template identifier of another structured data template. When the value of the attribute type is a template identifier, the member structure defined by the other structured data template is integrated into the member, thereby forming a nested hierarchical structure.
5. The method according to claim 1, characterized in that, Also includes: With the help of the interactive interface in the configuration software system, the triggered modification command is received, and the modification command includes the target instance identifier, the target member identifier and the target attribute value; In response to the modification instruction, based on the target instance identifier and the target member identifier, it is determined whether the target member attribute stores a different attribute value in the corresponding structured data instance; If a difference attribute value is stored, then update the difference attribute value to the target attribute value; If the difference attribute value is not stored, then a difference attribute value with the value of the target attribute is created and stored for the target member attribute.
6. The method according to claim 1, characterized in that, When the structured data storage access method is applied to a motor control system, the structured data template is a function block template for motor control in the PLC controller, and its template identifier is Motor; the members defined by the general attribute information include: The member identified as Tpw has an attribute description in its general attribute information: output pulse width. The attribute type is a real number, and the default attribute value is 5. Members identified as Speed have a general attribute description of motor speed, an integer type, and a default value of 0. For members identified as Enable, the general attribute information describes the attribute as an enable signal, the attribute type is Boolean, and the default attribute value is false.
7. The method according to claim 6, characterized in that, The function block template also includes a member identified as ControlModule, whose attribute type is defined as a template identifier for a PID control function block template, used to provide closed-loop regulation logic for motor control, so as to form a two-layer nested hierarchical structure through the function block template and the PID control function block template.
8. A structured data storage and access system applied in configuration software, characterized in that, include: The request receiving module is used to receive a triggered access request for a structured data instance via the interactive interface of the configuration software system. The access request includes a target instance identifier. The structured data instance is configuration data corresponding to a function block instance in the PLC controller. The instance acquisition module is used to respond to the access request and, based on the target instance identifier, query the configuration archive file to see if there is a stored structured data instance with at least one member with different attribute information corresponding to the target instance identifier; if it exists, the structured data instance is acquired. The template acquisition module is used to obtain the template architecture to which the structured data instance belongs based on the structured data instance. The template architecture includes a template identifier and common attribute information of multiple members. The attribute synthesis module is used to generate complete structured data with differentiated attribute information that can be displayed, based on the differentiated attribute information in the structured data instance and the general attribute information of the structured data template.
9. The system according to claim 8, characterized in that, The attribute synthesis module is specifically used for: Based on the general attribute information, an initial attribute set is generated; the attribute values in the initial attribute set are default attribute values from the general attribute information. For any attribute, if a corresponding difference attribute value exists in the difference attribute information, then the default attribute value of the corresponding attribute in the initial attribute set is replaced with the difference attribute value of the structured data instance; otherwise, the default attribute value in the general attribute information corresponding to the structured data template remains unchanged to generate the complete structured data.
10. The system according to claim 8, characterized in that, Also includes: The template storage module is used to receive triggered template definition commands through the interactive interface of the configuration software system; The template definition instruction is used to define the template architecture, including the template identifier of the corresponding template and predefined general attribute information for multiple members of the template; A structured data template is created based on the general attribute information; wherein, the structured data template is a function block template used to control the PLC controller, each member in the structured data template is uniquely identified by a member identifier, and at least one general attribute is predefined, each general attribute having a corresponding default attribute value; The created structured data template is associated with the template identifier and stored in the configuration project archive file.