A method for supporting custom nested configuration
Patent Information
- Application Number
- CN202611148420.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-27
AI Technical Summary
[0003]本发明旨在提供一种支持自定义嵌套的组态方法,以解决或改善上述技术问题中现有组态软件在深层嵌套及跨层级编辑场景下,存在内存管理低效、节点定位困难、序列化异常以及嵌套结构与界面显示不一致的问题
通过定义功能块的全局唯一标识、功能码、输入及输出,并构建包括父节点ID、子节点列表、当前节点层级及当前层级内功能块连接关系表的嵌套节点结构,能够将功能块之间的层级归属关系、连接组织关系及节点位置关系统一纳入标准化数据结构中,从而使自定义嵌套场景下的层级关系更加清晰,避免嵌套结构混乱导致的逻辑组织不清和界面显示不一致问题;
Smart Images

Figure CN122985144A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial control configuration software technology, and more specifically, to a configuration method that supports custom nesting. Background Technology
[0002] In the configuration development of gas turbine control logic, Function Block Diagrams (FBDs) are commonly used to graphically design speed regulation, fuel control, ignition protection, and interlocking logic. Existing host computer configuration software typically supports basic function block calls and limited-level encapsulation and nesting, and implements logic organization and editing through a page-based approach. However, as the scale of gas turbine logic increases and loop connections become more complex, existing nesting methods are prone to problems in scenarios involving deep nesting, custom encapsulation, and cross-level editing. These problems include increased memory fragmentation due to frequent creation and destruction of memory objects, decreased efficiency in locating nested nodes, abnormal structure recovery during serialization and deserialization, page editing lag, and inconsistencies between the nested structure and the displayed logic page. Summary of the Invention
[0003] The present invention aims to provide a configuration method that supports custom nesting, in order to solve or improve the problems of inefficient memory management, difficulty in node positioning, serialization anomalies, and inconsistency between nested structure and interface display in existing configuration software in scenarios of deep nesting and cross-level editing.
[0004] In view of this, a first aspect of the present invention is to provide a configuration method that supports custom nesting.
[0005] The first aspect of the present invention provides a configuration method supporting custom nesting, comprising the following steps: defining a globally unique identifier, function code, input, and output of a function block; constructing a nested node structure based on the globally unique identifier, the function code, the input, and the output, wherein the nested node structure includes a parent node ID, a list of child nodes, a current node level, and a function block connection relationship table within the current level; initializing a memory management model, wherein the memory management model includes a memory pool, a hash table, and a nested root node; in response to an encapsulated logical page creation operation, establishing a corresponding level node and adding the level node to the corresponding parent node; in response to a function block addition or deletion operation, calling the memory pool to allocate or release memory, and synchronously updating the hash table content of the current level, based on the... A hash table is used to locate and access functional blocks within the current level; an input / output connection topology is established based on the connection relationships of functional blocks within the encapsulated logical page, and this topology is abstracted into an input connection matrix and an output connection matrix; based on the nested node structure, the functional block information within the node, and the input and output connection matrices, the CRC32 checksum of the current nested node is calculated. The functional block information within the node includes the globally unique identifier, the function code, the parent node ID, the list of child nodes, and the current node level; the nested node data is serialized and stored according to the structured XML data layer and the binary data layer, and parsing and recovery are performed when the configuration storage file is opened, with consistency verification based on the CRC32 checksum.
[0006] The beneficial effects of this invention compared to the prior art are as follows: By defining the globally unique identifier, function code, input and output of the function block, and constructing a nested node structure including the parent node ID, child node list, current node level and function block connection relationship table within the current level, the hierarchical belonging relationship, connection organization relationship and node position relationship between function blocks can be uniformly incorporated into the standardized data structure. This makes the hierarchical relationship in custom nested scenarios clearer and avoids the problems of unclear logical organization and inconsistent interface display caused by the chaotic nested structure. By initializing a memory management model that includes a memory pool, a hash table, and nested root nodes, and calling the memory pool to allocate or release memory, synchronously updating the hash table content, and locating and accessing functional blocks within the current level based on the hash table during the addition and deletion of functional blocks, it is possible to reduce memory fragmentation caused by frequent creation and destruction of objects, improve resource scheduling efficiency and node retrieval efficiency during the dynamic editing process of functional blocks, thereby alleviating page editing lag and improving access response capabilities in deeply nested scenarios. By establishing an input-output connection topology based on the connection relationship of functional blocks within the encapsulated logic page, and abstracting it into an input connection matrix and an output connection matrix, the logical relationship that originally relied on graphical connections can be transformed into a calculable, storable, and verifiable structured connection relationship data, thereby improving the accuracy of the connection relationship expression and the stability of subsequent processing. By calculating the CRC32 checksum of the current nested node based on the nested node structure, the functional block information within the node, and the input and output connection matrices, the node hierarchical state, functional block composition state, and connection state can be uniformly mapped to comparable checksum results. This allows for timely reflection of data differences when the node structure, parameters, or connection relationships change, thereby improving the consistency judgment capability of the nested structure. By serializing and storing nested node data according to the structured XML data layer and the binary data layer, and performing parsing and recovery when opening the configuration storage file and performing consistency verification based on CRC32 checksum, it is possible to balance the parsing of structural description information and the storage efficiency of running data. At the same time, the integrity of the recovery result is verified during the deserialization recovery process, thereby reducing the risk of abnormal structure recovery, data corruption, or inconsistency between the nested structure and the logical page display.
[0007] Additional aspects and advantages of embodiments of the invention will become apparent in the following description or may be learned by practice of embodiments of the invention. Attached Figure Description
[0008] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart of the method steps of the present invention. Detailed Implementation
[0009] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0010] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0011] Please see Figure 1 The following describes a configuration method that supports custom nesting, based on some embodiments of the present invention.
[0012] An embodiment of the first aspect of the present invention proposes a configuration method that supports custom nesting. In some embodiments of the present invention, such as... Figure 1 As shown, the method includes: S101 defines the globally unique identifier, function code, input, and output of the function block. Based on the globally unique identifier, function code, input, and output, a nested node structure is constructed. The nested node structure includes the parent node ID, the list of child nodes, the current node level, and the function block connection relationship table within the current level.
[0013] Here, by defining the globally unique identifier, function code, input and output of the functional block, a clear and distinguishable set of basic attributes can be established for each functional block, so that different functional blocks have a unified identification basis in the subsequent nesting organization, relationship identification and data processing. Furthermore, a nested node structure is constructed based on globally unique identifiers, function codes, inputs, and outputs. In the nested node structure, parent node IDs, child node lists, current node levels, and function block connection relationship tables within the current level are set. This ensures that each function block is no longer an isolated independent object, but is organized into nested data units with hierarchical associations, hierarchical affiliations, and connection relationship constraints. This provides a unified data organization foundation for subsequent hierarchical node creation, function block addition and deletion, connection topology construction, checksum calculation, and serialized storage.
[0014] Specifically, the steps for defining the globally unique identifier, function code, inputs, and outputs of a function block include: Define nesting control parameters for function blocks, set a custom upper limit for nesting depth of function blocks, and use nesting control parameters to constrain the current node level when constructing nested node structures.
[0015] Based on the above specific description, by defining the globally unique identifier, function code, input, and output of the function block, further defining the nesting control parameters of the function block and setting the upper limit of the custom nesting depth of the function block, it is possible to add control constraint information related to nesting behavior to the function block in the initial modeling stage. This allows each function block to have a hierarchical control basis when participating in nested organization, in addition to having basic functional attributes. On this basis, when constructing the nested node structure, the nesting control parameters are used to constrain the current node level. This allows the level of the function block after entering the nested node structure to no longer be naturally determined by the creation result of the encapsulated logic page, but is also restricted by the pre-set nesting rules. Thus, when the user continues to encapsulate, nest, and expand the level, the nesting depth of the current node can be effectively constrained, preventing the node level from growing indefinitely or exceeding the preset range.
[0016] Specifically, the steps for constructing a nested node structure based on a globally unique identifier, function code, input, and output include: The encapsulated function block contains a globally unique identifier, function code, inputs, and outputs.
[0017] Establish a parent node ID, a list of child nodes, the current node level, a field for storing the CRC32 checksum of the current nested level, and a table of functional block connections within the current level. Use the table of functional block connections within the current level to construct the input / output connection topology.
[0018] Regarding the specific description above, by encapsulating the globally unique identifier, function code, input and output of the functional blocks, the identity attributes, function attributes and signal interaction attributes of each functional block can be uniformly incorporated into the data expression scope of the nested nodes, so that the functional blocks have complete and standardized basic descriptive information when entering the nested organization system. By establishing a parent node ID, a child node list, a current node level, a field for storing the CRC32 checksum of the current nested level, and a table of functional block connections within the current level, the nested node structure can not only represent the basic attributes of a single functional block, but also simultaneously represent the hierarchical relationship between the node containing the current functional block and its parent and child nodes, the nesting depth of the current node, and the connection organization status between functional blocks within the current level. Specifically, the parent node ID and child node list determine the parent-child relationship path between nodes, the current node level reflects the node's position in the overall nested structure, the field storing the CRC32 checksum of the current nested level carries the verification results generated subsequently based on node attributes and connection relationships, and the table of functional block connections within the current level further constructs the input-output connection topology. This transforms the originally scattered connection relationships between functional blocks in the current level into structured relationship data that can be uniformly organized and subsequently processed. Thus, the nested node structure simultaneously possesses the capabilities of attribute carrying, hierarchical organization, connection description, and verification result carrying.
[0019] S102, Initialize the memory management model, which includes a memory pool, a hash table, and nested root nodes.
[0020] Here, by initializing the memory management model and pre-establishing a memory pool, hash table, and nested root node within it, the underlying operational foundation supporting subsequent custom nested processing can be built at the initial stage of configuration method execution. The memory pool is used to uniformly pre-allocate and centrally manage the memory resources of functional block objects and nested node objects, thereby reducing memory fragmentation generated during frequent object creation and release and improving memory allocation response efficiency. The hash table is used to establish a fast index relationship for functional blocks in the nested structure, facilitating the subsequent location, access, and retrieval of functional blocks within the current or target level. The nested root node serves as the top-level starting node of the entire nested node structure, enabling all subsequently created nodes at each level to establish parent-child relationships under a unified root node. This gives the entire custom nested structure a clear resource management foundation, a node organization starting point, and a fast access channel in memory.
[0021] Specifically, the steps for initializing the memory management model include: Initialize the memory pool and preset its size, initialize the hash table, initialize the nested root node, set the current node level of the nested root node to 0, and use the nested root node as the starting node for traversing the nested node structure.
[0022] Based on the specific description above, by initializing the memory management model and sequentially initializing the memory pool, hash table, and nested root node, a low-level runtime environment supporting the entire custom nested processing can be established before the configuration method is executed. Initializing the memory pool and pre-setting its size provides a unified and responsive memory resource foundation for the creation, addition, deletion, and release of subsequent functional block objects and nested node objects, thereby reducing resource jitter and memory fragmentation issues during dynamic allocation. Initializing the hash table establishes a fast access channel for the index of functional blocks at each level, providing efficient data support for the location, access, and retrieval of functional blocks within the nested structure. Initializing the nested root node and setting its current node level to 0 establishes a unified top-level starting point for the entire nested node structure, allowing subsequent newly added nodes at each level to expand downwards around the nested root node. Furthermore, using the nested root node as the starting node for traversing the nested node structure provides a unified traversal entry point for subsequent hierarchical access, structure restoration, relationship checking, and checksum calculation of the entire nested node structure.
[0023] S103, in response to the encapsulation logic page creation operation, establish the corresponding hierarchical node and add the hierarchical node to the corresponding parent node; in response to the function block addition and deletion operation, call the memory pool to allocate or release memory, and synchronously update the hash table content of the current level, and locate and access the function block in the current level based on the hash table.
[0024] Here, by responding to the encapsulation logic page creation operation, establishing the corresponding hierarchical node and adding the hierarchical node to the corresponding parent node, the encapsulation behavior of the user in the configuration interface can be mapped to the hierarchical structure change in memory in real time, so that the newly added encapsulation logic page is incorporated into the existing nested system, thereby gradually forming a hierarchical nested node structure with a clear parent-child relationship. When responding to the addition or deletion of function blocks, the memory pool is invoked for memory allocation or release. This ensures that the creation and deletion of function block objects are completed under a unified memory management mechanism, reducing memory fragmentation and resource waste caused by frequent operations. Furthermore, the hash table content of the current level is updated synchronously after the addition or deletion of function blocks, and the function blocks in the current level are located and accessed based on the hash table. This ensures that the set of function blocks in the current level always remains consistent with the memory index. Thus, even when the number of function blocks changes, the hierarchical relationship is adjusted, or subsequent connection relationships are processed, the location and object information of the target function block can still be obtained quickly.
[0025] Specifically, the steps of creating corresponding hierarchical nodes and adding them to their corresponding parent nodes include: Create the hierarchical node corresponding to the encapsulated logical page, and add the hierarchical node to the corresponding parent node.
[0026] Set the current node level of the hierarchical node to the current node level of the parent node plus 1, and perform hierarchical division and management of the nested node structure based on the current node level.
[0027] Regarding the specific description above, by creating a hierarchical node corresponding to the encapsulated logic page and adding the hierarchical node to the corresponding parent node, the newly added encapsulated logic page in the configuration interface can be synchronously mapped to a new hierarchical unit in the nested node structure, so that the hierarchical unit can obtain a clear superior relationship in the overall nested structure, thereby avoiding the existence of each encapsulated logic page in an isolated manner. Setting the current node level of the hierarchical node to the current node level of the parent node plus 1 enables the newly created hierarchical node to obtain a definite nesting depth identifier while forming a parent-child relationship. This allows the hierarchical nodes corresponding to different encapsulated logical pages to not only have the upper and lower level paths in terms of connection relationship, but also the order in terms of hierarchical position. By dividing and managing the nested node structure according to the current node level, the nodes in the entire nested node structure can be organized in an orderly manner according to the level depth. This allows for quick identification of the target node's location and level when performing node access, function block management, connection relationship construction, check code calculation, and serialization processing.
[0028] Specifically, the steps of calling the memory pool to allocate or release memory and synchronously updating the hash table content at the current level include: Allocate corresponding storage space when adding function blocks.
[0029] When a function block is deleted, the corresponding storage space is released and returned to the memory pool.
[0030] After adding or deleting a function block, update the hash table content of the current level and perform a fast function block retrieval based on the updated hash table.
[0031] Regarding the specific description above, by allocating corresponding storage space when adding functional blocks and releasing and returning the corresponding storage space to the memory pool when deleting functional blocks, functional block objects can always be under a unified memory management mechanism during dynamic addition and deletion. This avoids problems such as increased memory fragmentation, decreased allocation efficiency, and untimely resource reclamation caused by directly relying on discrete memory allocation when frequently creating and destroying objects. Synchronously updating the hash table content of the current level after adding or deleting a function block ensures that the actual existence status of the function block in the current level is consistent with the index status, avoiding positioning errors, access failures, or inaccurate search results caused by the index not being updated in time after the function block is added or deleted. The updated hash table enables fast retrieval of function blocks, transforming the search process for target function blocks in the current level from sequential traversal to fast access based on index mapping. This maintains high positioning and access efficiency even when the number of function blocks increases, the nesting level deepens, or editing operations are frequent. This creates a linkage mechanism between memory resource scheduling and index access processing during the dynamic editing process of function blocks.
[0032] S104. Based on the connection relationship of functional blocks within the encapsulated logic page, establish the input / output connection topology and abstract the input / output connection topology into an input connection matrix and an output connection matrix.
[0033] Here, by establishing an input-output connection topology based on the connection relationship of functional blocks within the encapsulated logic page, the original graphical connection relationship between functional blocks in the configuration page can be transformed into a calculable and resolvable structured connection relationship, so that the signal transmission direction between functional blocks, the correspondence between input and output terminals, and the dependency path between different functional blocks can be clearly expressed. Abstracting the input-output connection topology into an input connection matrix and an output connection matrix can transform complex topological relationships into a regularized data representation. This facilitates subsequent unified storage, fast retrieval, consistency verification, and checksum calculation of the connection relationships. As a result, the data processing of subsequent nested nodes no longer relies solely on the visual connections at the interface level, but is based on a logical relationship representation method built upon a standardized matrix structure.
[0034] Specifically, the steps of establishing the input-output connection topology and abstracting it into an input connection matrix and an output connection matrix include: Establish the input connection matrix based on the connection relationships between functional blocks.
[0035] An output connection matrix is established based on the connection relationships between functional blocks, and connection relationships are generated based on the functional block connection relationship table within the current level.
[0036] Regarding the specific description above, by establishing an input connection matrix and an output connection matrix based on the connection relationship between functional blocks, and generating the connection relationship based on the functional block connection relationship table in the current level, the association state originally represented by graphical connections between functional blocks in the current level can be extracted and uniformly organized into computable connection relationship data, so that the correspondence between the input and output ends of each functional block, the signal transmission path, and the interdependence can be clearly expressed. Abstracting the connection relationships into input connection matrices and output connection matrices respectively, the complex and scattered connection topology can be transformed into a regular and standardized data representation. This allows the connection organization status between functional blocks within the current level to no longer depend solely on the page display results, but can be uniformly recorded, retrieved, and processed in a matrix manner.
[0037] S105. Based on the nested node structure, the functional block information within the node, and the input connection matrix and output connection matrix, calculate the CRC32 checksum of the current nested node. The functional block information within the node includes a globally unique identifier, a function code, a parent node ID, a list of child nodes, and the current node level.
[0038] Here, by calculating the CRC32 checksum of the current nested node based on the nested node structure, the functional block information within the node, and the input and output connection matrices, the hierarchical organization state, functional block composition state, and connection state between functional blocks corresponding to the current nested node at the current moment can be transformed into a unique corresponding checksum. Among them, the globally unique identifier in the functional block information of the node is used to represent the unique identity of each functional block, the function code is used to represent the functional attributes of each functional block, the parent node ID and the child node list are used to represent the organizational relationship between the current nested node and its superior and subordinate nodes, the current node level is used to represent the nesting depth of the current nested node, and the input connection matrix and output connection matrix are used to represent the input and output connection relationship between the functional blocks within the current nested node. In this way, the structural information, attribute information and connection information of the current nested node can be uniformly incorporated into the CRC32 check code generation process, so that as long as the composition, hierarchical relationship or connection relationship of the functional blocks in the current nested node changes, the generated CRC32 check code will change accordingly.
[0039] Specifically, the steps for calculating the CRC32 checksum of the current nested node include: Extract the basic encapsulation information and functional block information of the current node, and extract the input connection matrix and output connection matrix. Generate the CRC32 check code of the current nested node based on the information. The basic encapsulation information includes the current node level and nesting control parameters.
[0040] Based on the above specific description, by extracting the basic encapsulation information, functional block information within the node, and input and output connection matrices of the current node, and generating the CRC32 checksum of the current nested node based on the information, the hierarchical state, nesting constraint state, functional block composition state, and connection state between functional blocks corresponding to the current nested node at the current moment can be uniformly converted into quantifiable and comparable checksum results. Among them, the current node level in the basic encapsulation information is used to represent the position of the current nested node in the overall nested structure; the nesting control parameters are used to represent the hierarchical constraint rules of the current nested node; the functional block information within the node is used to represent the identity and organizational attributes of the functional blocks contained within the current nested node; and the input connection matrix and output connection matrix are used to represent the input and output connection relationships between the functional blocks within the current nested node. In this way, the structural information, attribute information, and connection information of the current nested node can jointly participate in the CRC32 check code generation process. This ensures that as long as the hierarchical relationship, functional block composition, control parameters, or connection relationship in the current nested node changes, the generated CRC32 check code will change accordingly, thereby providing a unified and reliable judgment basis for subsequent serialization storage, parsing recovery, and consistency verification.
[0041] S106, according to the structured XML data layer and binary data layer, serialize and store the nested node data, and perform parsing and recovery when opening the configuration storage file, and perform consistency verification based on CRC32 check code.
[0042] Here, by serializing and storing nested node data according to a structured XML data layer and a binary data layer, the structural description information and runtime data in the nested nodes can be organized in layers according to different data characteristics. The structured XML data layer is used to carry the hierarchical relationship of the nested nodes, functional block description information, and verification-related information, so that the nested structure has a clear structured expression. The binary data layer is used to carry runtime data such as the visual layout information of functional blocks, pin status, and connection relationships, so as to improve data storage density and reading efficiency. Thus, when writing nested node data to the configuration storage file, both structural parsing and data storage efficiency can be taken into account. When a configuration storage file is opened, parsing and recovery are performed. This allows the structured XML data layer and the binary data layer to be restored to the corresponding nested node structure and related data content according to the predetermined storage structure. Furthermore, consistency verification based on CRC32 checksums can compare and judge the consistency between the parsed and recovered nested node data and the original stored data. This ensures that any changes in node structure, abnormal functional block information, or damaged connection relationships that occur during file storage, transmission, or retrieval can be identified in a timely manner.
[0043] Specifically, the steps for serializing and storing nested node data include: Write the node CRC32 checksum, node level, function block description table, and logical page information into the structured XML data layer.
[0044] Write the visual layout information of the function blocks, pin status, and pin connection relationships of the function blocks into the binary data layer.
[0045] The structured XML data layer and the binary data layer are serialized and written to the configuration storage file. The function block description table includes a globally unique identifier and a function code.
[0046] Regarding the specific description above, by writing the node CRC32 checksum, node level, function block description table, and logical page information into the structured XML data layer, and writing the function block visual layout information, pin status, and function block pin connection relationship into the binary data layer, it is possible to hierarchically organize the nested node data according to the attribute differences of different data content. The structured XML data layer carries the hierarchical organization information, functional block identification information, and logical page association information of nested nodes, giving nested nodes a clear and parsable structured description in the storage file. The functional block description table includes globally unique identifiers and function codes, which enables each functional block to still have a clear identity and functional attribute identifier in the storage state, facilitating the identification and matching of functional blocks during subsequent parsing and recovery. The binary data layer carries the visual layout information of functional blocks, pin status, and functional block pin connection relationships, as well as other runtime or interface state data, allowing this part of the data to be written and read in a more compact data format, thus balancing data storage efficiency and data recovery efficiency. On this basis, serializing the structured XML data layer and the binary data layer and writing them into the configuration storage file enables the structural description information and runtime related information of nested nodes to form a complete and corresponding storage result in a unified file.
[0047] Specifically, the steps for performing parsing recovery and consistency verification based on CRC32 checksums include: Read the structured XML data layer and binary data layer from the configuration storage file.
[0048] Restore the nested node structure and generate the CRC32 checksum of each nested node, then compare it with the read CRC32 checksum.
[0049] The configuration storage file is opened when the comparison is consistent, and refused to be opened when the comparison is inconsistent. The process of generating the CRC32 checksum is based on traversal calculation of the nested root node.
[0050] Regarding the specific description above, by reading the structured XML data layer and binary data layer of the configuration storage file, the information content of the file, which respectively carries the nested node structure description information and the operation-related data, can be reloaded into the configuration processing flow, thereby providing a basic data source for subsequent nested structure reconstruction and data recovery; By restoring the nested node structure and generating CRC32 check codes for each nested node through traversal calculation based on the nested root node, the entire nested node structure can be expanded step by step from the top-level starting point according to the predetermined hierarchical relationship. This allows the hierarchical state, functional block composition state, and connection relationship state of each node to be re-incorporated into the check calculation process, thereby forming a set of check values corresponding to the current restoration result. The generated CRC32 checksum is then compared with the read CRC32 checksum to determine whether the currently parsed and recovered nested node structure is consistent with the original data in the storage file. If the comparison is consistent, it confirms that the nested structure, node information and connection relationship in the configuration storage file have not changed abnormally and allows the configuration storage file to be opened. If the comparison is inconsistent, it indicates that the configuration data has been damaged, tampered with or recovered abnormally during storage, transmission or reading, and the configuration storage file is refused to be opened.
[0051] This invention provides a configuration method that supports custom nesting. By uniformly modeling the nested structure of functional blocks and combining it with a memory pool, hash table, hierarchical node management, connection topology matrix processing, CRC32 verification, and a layered storage mechanism of structured XML data layer and binary data layer, it can support flexible custom nesting of functional blocks while achieving efficient creation, rapid location, stable editing, accurate verification, and reliable storage recovery of nested nodes. This effectively reduces problems such as memory fragmentation, inefficient node access, complex connection relationship processing, insufficient data consistency, and abnormal file parsing and recovery in deep nesting scenarios, thereby improving the flexibility of the configuration design process, the consistency of data processing, and the stability of configuration file operation and storage.
[0052] Those skilled in the art will recognize that the algorithmic steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0053] The above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit it. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be included within the protection scope of this disclosure.
Claims
1. A configuration method that supports custom nesting, characterized in that, Includes the following steps: Define a globally unique identifier, function code, input, and output for a function block. Construct a nested node structure based on the globally unique identifier, function code, input, and output. The nested node structure includes a parent node ID, a list of child nodes, the current node level, and a table of function block connection relationships within the current level. Initialize the memory management model, which includes a memory pool, a hash table, and nested root nodes; In response to the encapsulation logic page creation operation, the corresponding hierarchical node is established and the hierarchical node is added to the corresponding parent node; in response to the function block addition and deletion operation, the memory pool is called to allocate or release memory, and the hash table content of the current level is updated synchronously, and the function block in the current level is located and accessed based on the hash table; Based on the connection relationship of functional blocks within the encapsulated logic page, an input-output connection topology is established, and the input-output connection topology is abstracted into an input connection matrix and an output connection matrix. Based on the nested node structure, the functional block information within the node, and the input connection matrix and the output connection matrix, the CRC32 checksum of the current nested node is calculated. The functional block information within the node includes the globally unique identifier, the function code, the parent node ID, the list of child nodes, and the current node level. The nested node data is serialized and stored according to the structured XML data layer and the binary data layer. When the configuration storage file is opened, parsing and recovery are performed, and consistency verification is performed based on the CRC32 checksum.
2. The configuration method supporting custom nesting according to claim 1, characterized in that, The steps for defining the globally unique identifier, function code, input, and output of a function block include: Define the nesting control parameters of the function block, set the upper limit of the custom nesting depth of the function block, and use the nesting control parameters to constrain the current node level when constructing the nested node structure.
3. The configuration method supporting custom nesting according to claim 1, characterized in that, The step of constructing a nested node structure based on the globally unique identifier, the function code, the input, and the output includes: Encapsulate the globally unique identifier, function code, inputs, and outputs of the functional block; Establish a parent node ID, a list of child nodes, a current node level, a field for storing the CRC32 checksum of the current nested level, and a table of functional block connections within the current level. Use the table of functional block connections within the current level to construct the input / output connection topology.
4. The configuration method supporting custom nesting according to claim 1, characterized in that, The steps for initializing the memory management model include: Initialize the memory pool and preset the memory size, initialize the hash table, initialize the nested root node, set the current node level of the nested root node to 0, and use the nested root node as the starting node for traversing the nested node structure.
5. The configuration method supporting custom nesting according to claim 1, characterized in that, The steps of creating corresponding hierarchical nodes and adding the hierarchical nodes to their corresponding parent nodes include: Create a hierarchical node corresponding to the encapsulated logical page and add the hierarchical node to the corresponding parent node; Set the current node level of the hierarchical node to the current node level of the parent node plus 1, and perform hierarchical division and management of the nested node structure based on the current node level.
6. The configuration method supporting custom nesting according to claim 1, characterized in that, The step of calling the memory pool to allocate or release memory and synchronously updating the hash table content at the current level includes: Allocate corresponding storage space when adding function blocks; When a function block is deleted, the corresponding storage space is released and returned to the memory pool; After adding or deleting a function block, update the hash table content of the current level, and perform a fast function block retrieval based on the updated hash table.
7. The configuration method supporting custom nesting according to claim 1, characterized in that, The steps of establishing the input-output connection topology and abstracting the input-output connection topology into an input connection matrix and an output connection matrix include: Establish the input connection matrix based on the connection relationships between functional blocks; An output connection matrix is established based on the connection relationships between functional blocks, and the connection relationships are generated based on the functional block connection relationship table within the current level.
8. The configuration method supporting custom nesting according to claim 1, characterized in that, The step of calculating the CRC32 checksum of the current nested node includes: Extract the basic encapsulation information and functional block information within the current node, and extract the input connection matrix and the output connection matrix. Generate the CRC32 checksum of the current nested node based on the information, wherein the basic encapsulation information includes the current node level and the nesting control parameters.
9. The configuration method supporting custom nesting according to claim 1, characterized in that, The step of serializing and storing nested node data includes: Write the node CRC32 checksum, node level, function block description table, and logical page information into the structured XML data layer; Write the visual layout information of the function block, pin status, and pin connection relationship of the function block into the binary data layer; The structured XML data layer and the binary data layer are serialized and written to a configuration storage file. The function block description table includes the globally unique identifier and the function code.
10. The configuration method supporting custom nesting according to claim 1, characterized in that, The aforementioned execution of parsing and recovery, including the step of performing consistency verification based on the CRC32 checksum, comprises: Read the structured XML data layer and binary data layer from the configuration storage file; Restore the nested node structure and generate the CRC32 checksum of each nested node, then compare it with the read CRC32 checksum. If the comparison matches, the configuration storage file is opened; if the comparison does not match, the configuration storage file is refused to be opened. The process of generating the CRC32 checksum is based on the nested root node through traversal calculation.