An adaptive remote configuration method and system of a substation measurement and control device
Patent Information
- Application Number
- CN202611424656.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]为了解决现有技术中拓扑配置比对耗时长、递归遍历易阻塞实时任务、差异识别效率低、整体下发占用带宽且缺乏更新前状态校验,容易造成配置不同步的问题,本发明提出一种变电站测控装置的自适应远程配置方法及系统
通过为测控装置建立包含设备区位、电压等级和逻辑节点序号的复合节点索引,并结合参数摘要值实现拓扑节点的唯一标识和快速校验;利用子节点指针、兄弟节点指针和父节点返回指针构建链式Fiber树结构,将深度嵌套拓扑转化为便于遍历的链式存储结构,降低了拓扑解析和节点查询的计算开销。通过引入双缓冲区隔离机制和拓扑子树状态指纹,采用先进行子树级指纹比对、再进行节点级索引与参数摘要比对的差异识别策略,能够快速跳过未变更分支,提高配置差异定位效率。基于时间分片机制将比对任务拆分为离散工作单元,并在后台任务中非阻塞执行,同时支持高优先级任务打断和断点恢复,避免配置比对过程影响测控装置实时业务处理。此外,通过将差异节点封装为携带前置状态指纹的数据包下发至目标测控装置,使目标测控装置在状态一致校验通过后执行增量更新,减少了网络传输数据量,提高了拓扑配置同步的准确性和运行安全性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application belongs to the field of substation measurement and control, and particularly relates to an adaptive remote configuration method and system for substation measurement and control devices. Background Technology
[0002] In recent years, with the continuous expansion of the construction scale of smart substations, the number of in-station measurement and control devices and the logical nodes and topology configuration data they carry have been increasing. These devices not only need to process sampled data and control commands in real time, but also need to maintain the logical topology relationships between devices. During routine operation and maintenance, measurement and control devices typically use deeply nested tree data structures to describe the hierarchical relationships between equipment locations, voltage levels, and functional virtual points. To ensure consistency in equipment configuration between the station control layer and the bay layer, the topology configuration in the measurement and control devices needs to be updated synchronously during system expansion, function upgrades, or parameter adjustments. Current methods generally load the entire topology configuration file into memory, construct a traditional multi-branch tree model, and then the processor sequentially traverses all nodes in the tree, checking the old and new configuration data item by item. While this method can express the hierarchical relationships between substation equipment and functional nodes, its shortcomings in data processing efficiency and real-time task scheduling become increasingly apparent as the scale of equipment and the number of logical nodes increase.
[0003] First, traditional tree structures suffer from deep nesting, requiring extensive recursive traversal operations for configuration comparison, resulting in lengthy processing times and continuous resource consumption by the comparison thread. Since the monitoring and control device simultaneously handles real-time tasks such as fault recording, remote signaling, remote control execution, and protection linkage, failure to relinquish processing resources during configuration comparison can delay high-priority service responses, impacting device reliability. Second, existing comparison processes lack rapid difference identification mechanisms for logical intervals, typically requiring node-by-node comparison of the entire topology tree, making it difficult to quickly skip unchanged branches, leading to significant unnecessary calculations and reduced configuration maintenance efficiency. Third, after identifying configuration changes, traditional solutions often employ overall configuration file distribution and overwrite updates, resulting in large data transmission volumes and consuming significant station communication bandwidth. When the target monitoring and control device receives and executes updates, it typically lacks verification mechanisms based on the pre-update state and a secure buffer transition process. Communication interruptions, version inconsistencies, or write anomalies during the update process can easily lead to configuration file corruption and desynchronization between the master station and the device, ultimately affecting substation operational safety. Summary of the Invention
[0004] To address the problems of long topology configuration comparison time, recursive traversal easily blocking real-time tasks, low difference identification efficiency, bandwidth consumption of overall distribution and lack of pre-update state verification in existing technologies, which easily lead to configuration asynchrony, this invention proposes an adaptive remote configuration method and system for substation monitoring and control devices.
[0005] According to one aspect of the present invention, an adaptive remote configuration method for substation monitoring and control devices is proposed to solve the problem that existing methods are prone to configuration file corruption or data asynchrony, comprising the following steps: For each measurement and control device and functional virtual point, a composite node index consisting of equipment location code, voltage level code and logical node number is established and parameter summary value is calculated; by setting child node pointers, sibling node pointers and parent node return pointers, the deep nested topology is transformed into a chain-structured reference Fiber tree and the reference Fiber tree is placed in the first buffer, and the state fingerprint of the reference topology subtree is generated. The target Fiber tree is generated in the second buffer, the topology subtree is divided at logical intervals and a state fingerprint is generated for the root node of each topology subtree; the comparison task is split into discrete working units and executed non-blockingly in the background task based on the time-slicing mechanism. Compare the state fingerprints of the root nodes of the corresponding topological subtrees. If the fingerprints are the same, jump to the next logical interval. If the fingerprints are different, extract the composite node index and parameter summary value of the old and new nodes in the topological subtree and compare them to identify the difference nodes. If a high-priority task is generated, the comparison task is suspended and the node pointer is saved. The comparison task is resumed after the high-priority task is completed. The difference node is encoded into a data packet containing the previous state fingerprint and differential configuration instructions and sent to the target measurement and control device. After verifying that the previous state is consistent, the target measurement and control device performs an incremental update, and the data in the second buffer overwrites the data in the first buffer.
[0006] According to another aspect of the present invention, an adaptive remote configuration system for a substation monitoring and control device is proposed, comprising the following modules: The calculation module is used to establish a composite node index consisting of equipment location code, voltage level code and logical node number for each measurement and control device and functional virtual point, and to calculate parameter summary value; by setting child node pointer, sibling node pointer and parent node return pointer, the deeply nested topology is transformed into a chain structure of reference Fiber tree and the reference Fiber tree is placed in the first buffer, and the state fingerprint of the reference topology subtree is generated. The generation module is used to generate the target Fiber tree in the second buffer, divide the topology subtrees at logical intervals and generate a state fingerprint for the root node of each topology subtree; and split the comparison task into discrete working units and execute them in a non-blocking background task based on a time-slicing mechanism. The identification module is used to compare the state fingerprint of the root node of the corresponding topological subtree. If the fingerprints are the same, it jumps to the next logical interval. If the fingerprints are different, it extracts the composite node index of the old and new nodes in the topological subtree and the parameter summary value for comparison to identify the difference nodes. If a high-priority task is generated, the comparison task is suspended and the node pointer is saved. The comparison task is resumed after the high-priority task is completed. The update module is used to encode the difference nodes into a data packet containing the previous state fingerprint and differential configuration instructions and send it to the target measurement and control device. After verifying that the previous state is consistent, the target measurement and control device performs an incremental update, and the data in the second buffer overwrites the first buffer.
[0007] The present invention has the following advantages: By establishing a composite node index for the measurement and control device, including equipment location, voltage level, and logical node sequence number, and combining it with parameter digest values, unique identification and rapid verification of topology nodes are achieved. A linked Fiber tree structure is constructed using child node pointers, sibling node pointers, and parent node return pointers, transforming deeply nested topologies into a traversable linked storage structure, reducing the computational overhead of topology parsing and node querying. By introducing a double-buffer isolation mechanism and topology subtree state fingerprinting, a difference identification strategy is adopted, first comparing subtree-level fingerprints and then comparing node-level indexes and parameter digests. This allows for rapid skipping of unchanged branches, improving the efficiency of configuration difference location. A time-slicing mechanism divides the comparison task into discrete working units, executing them non-blockingly in the background, while supporting high-priority task interruption and breakpoint recovery, preventing the configuration comparison process from affecting the real-time business processing of the measurement and control device. Furthermore, by encapsulating differing nodes into data packets carrying prior state fingerprints and sending them to the target measurement and control device, the target device performs incremental updates after the state consistency verification is passed, reducing the amount of network data transmitted and improving the accuracy and operational security of topology configuration synchronization. Attached Figure Description
[0008] Figure 1 A flowchart of the first embodiment; Figure 2 Generate a schematic diagram for the composite node index; Figure 3 This is a flowchart of the fingerprint comparison process for topological subtrees. Detailed Implementation
[0009] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0010] In the first embodiment, the present invention proposes an adaptive remote configuration method for substation monitoring and control devices, such as... Figure 1 As shown, it includes the following steps: S1: Establish a composite node index consisting of equipment location code, voltage level code and logical node number for each measurement and control device and functional virtual point, and calculate parameter summary value; transform the deep nested topology into a chain-structured reference Fiber tree by setting child node pointers, sibling node pointers and parent node return pointers, place the reference Fiber tree in the first buffer, and generate the reference topology subtree state fingerprint.
[0011] Obtain the substation system configuration description file, parse and extract the configuration information of each measurement and control device and functional virtual point, and concatenate the equipment location code, voltage level code and logical node sequence number in a preset order to generate the composite node index of the node; extract the configuration parameters of each node and concatenate them into a text stream in a preset order, and generate parameter digest values through a preset hash algorithm.
[0012] A first buffer is allocated in memory, and a parameter data area is set up to store the complete set of configuration parameters. A depth-first traversal algorithm is used to read the nested tree level, allocate a memory block for each node traversed, and write the composite node index, parameter summary value, and parameter data offset into the memory block; the parameter data offset is used to point to the storage location of the configuration parameter set of that node in the parameter data area.
[0013] The first child node, the next sibling node, and the parent node of the current node are written to the child node pointer, sibling node pointer, and parent node return pointer, respectively, with offsets relative to the base address of the first buffer. This constructs a linked baseline Fiber tree stored in the first buffer. After the linked baseline Fiber tree is constructed, the topology is divided into subtrees according to logical intervals. Based on the composite node index, topology hierarchy, and parameter summary value of the nodes in each subtree, a state fingerprint of the root node of the corresponding subtree is generated.
[0014] In an optional embodiment, the step of establishing a composite node index consisting of equipment location code, voltage level code, and logical node sequence number for each measurement and control device and functional virtual point, and calculating parameter summary values, includes: Read the equipment configuration file, extract the interval number and the measurement and control device instance identifier in sequence and combine them to generate the equipment location code, the integer voltage level value as the voltage level code, and the logical node unique instance identifier as the logical node sequence number. Use underscores as delimiters to connect the three parts of character data to generate a single composite node index string. The configuration parameter set is extracted from the configuration file of each node. The configuration parameter set includes communication address, data type and fixed value range. The data segment of the configuration parameter set is hashed using the MD5 hash function, and the output feature string of fixed length of 32 hexadecimal characters is saved as the parameter digest value of the node.
[0015] Parse the SCL or XML format configuration file of the measurement and control device, and declare the string variable interval_id, the measurement and control device instance identifier variable device_inst, the integer variable voltage_level, and the identifier variable ln_inst.
[0016] When traversing configuration nodes, if a node is found to have an interval number of 02, a measurement and control device instance identifier of MCU1, a voltage level of 110kV, and a logical node identifier of PTOC1, the interval_id and device_inst are first combined to generate the device location code area_code. Then, the string concatenation operation NodeIndex = area_code + "_" + String(voltage_level) + "_" + ln_inst is performed to output the exact composite node index string 02MCU1_110_PTOC1. This string is stored in the memory index table as the address matching key for this node. For the PTOC1 node, the set of configuration parameters of this node is extracted to form a raw data segment, such as a structured character stream {"Address":"0x1201","DataType":"FLOAT","CurrentLimit":5.0,"TimeDelay":0.5} containing the communication address, data type, current start value, and time delay.
[0017] The hash algorithm is invoked to convert the character stream into a UTF-8 encoded byte array and input it into the MD5 hash function. Internally, the algorithm fills the byte stream into data blocks that are multiples of 512 bits and performs 64 bit-level logical operations in 4 rounds to generate a 128-bit digest binary code. This binary code is then converted to a string format, outputting a fixed-length 32-hexadecimal character set, such as "e4d909c290d0fb1ca068ffaddf22cbd0". This hash value is assigned to the node's `param_digest` variable and stored therein. Simultaneously, the node's configuration parameter set is written to the parameter data area, and the storage offset of the configuration parameter set relative to the parameter data area's base address is recorded in the node's parameter data offset field, achieving the solidification and traceable storage of the multi-dimensional parameter set's digest. The principle of composite node index generation is as follows... Figure 2 As shown.
[0018] In an optional embodiment, the step of converting a deeply nested topology into a linked-structured baseline Fiber tree by setting child node pointers, sibling node pointers, and parent node return pointers, placing the baseline Fiber tree in a first buffer, and generating a baseline topology subtree state fingerprint includes: During the traversal of the tree hierarchy, the child node pointer is established by directly pointing the child node attribute of the current parent node to the relative memory offset of the first next-level derived node belonging to it. The relative memory offset of the sibling node pointer is used to point the adjacent sibling attribute of the currently traversed node to the next derived node at the same parent node level. Record the relative memory offset of the parent node of the traversed node and establish the parent node return pointer; Following the depth-first path and in accordance with the established concatenation order of the three types of pointers, all the scattered multi-dimensional tree nodes are assembled and reorganized into the continuous sequential memory blocks in the first buffer, resulting in a chained Fiber tree structure that supports depth-first queries. After the chain-like Fiber tree structure is constructed, the baseline topology subtree is divided according to the logical interval identifier, and the state fingerprint of the corresponding root node is generated based on the composite node index, level depth, parent node information and parameter summary value of the nodes in each baseline topology subtree.
[0019] A contiguous first buffer of size 1MB is pre-allocated in memory, with the initial memory base address set to BaseAddr=0x1000. A node structure FiberNode containing three integer variables: child_offset, sibling_offset, and return_offset is defined. Assuming the root node A is allocated at offset 0x00, during depth-first traversal of the tree topology, A's first derived child node B is detected and allocated at a relative offset of 0x40. Assuming a single node occupies 64 bytes, the child node pointer is established through the pointer assignment operation A.child_offset=0x40, achieving parent-to-child descending addressing. When the traversal process moves to the next derived node C at the same level as B and allocates memory for this node at offset 0x80, B.sibling_offset=0x80 is executed to establish the sibling node pointer for parallel horizontal addressing. For nodes B and C, the relative memory offset of their parent node A is written to their respective `return_offset` fields, for example, `B.return_offset=0x00` and `C.return_offset=0x00`. If an intermediate node has child nodes but no sibling nodes, the previous level node can still be returned through the `return_offset` recorded by the intermediate node or its terminal node after the subtree traversal is completed. Using these three types of offset pointers, the previously stack-push multidimensional recursive scattered nodes are restructured into a chained Fiber tree structure arranged in depth-first order, supporting parent-child jumps, sibling jumps, and return jumps. The processor only needs to perform the addition operation `CurrentAddr=BaseAddr+offset` to complete the node jump, helping to reduce the risk of stack overflow caused by deeply nested topologies. When traversing to the end of a branch with no child nodes and no sibling nodes, the processor uses `return_offset` to return to the previous level parent node and continues to search for the subsequent sibling nodes of the previous level parent node, thus completing the continuous query on the depth-first path.
[0020] After the baseline Fiber tree is reorganized, the system divides the baseline Fiber tree in the first buffer into subtrees according to the logical interval identifier. For each baseline subtree, the system sequentially reads the composite node index, level depth scalar, parent node composite node index, and parameter digest value of each node in the subtree according to the chained Fiber tree query path. The above data is appended to a byte stream in traversal order, and the corresponding state fingerprint is generated using the SHA-256 information security hash algorithm. This state fingerprint is then written to the fingerprint field of the root node of the corresponding baseline subtree. Thus, the baseline Fiber tree in the first buffer already has a readable topology subtree state fingerprint before entering the subsequent comparison process. The state fingerprint generation rule of the baseline Fiber tree in the first buffer is the same as the state fingerprint generation rule of the target Fiber tree in the second buffer.
[0021] S2, generate the target Fiber tree in the second buffer, divide the topology subtrees at logical intervals and generate a state fingerprint for the root node of each topology subtree; split the comparison task into discrete working units and execute them in a non-blocking background task based on the time-sharing mechanism.
[0022] When a substation is expanded or its parameters are modified, resulting in a topology change, a second buffer is created in memory, isolated from the first buffer. The same depth-first traversal algorithm and pointer assignment logic as used to generate the baseline Fiber tree are employed to parse the new configuration file and construct the target Fiber tree within the second buffer.
[0023] Traverse the target Fiber tree and, based on the interval attributes such as line bays, transformer bays, and bus bays of the substation, divide the entire target Fiber tree into multiple independent topological subtrees. For each topological subtree, concatenate the composite node index, level depth scalar, parent node composite node index, and parameter digest value of all internal nodes in traversal order, and again use the same preset hash algorithm to generate the corresponding state fingerprint. Then, assign this state fingerprint to the root node of the corresponding topological subtree.
[0024] The system obtains its control cycle or background task scheduling cycle, calculates the idle time available for background comparison within the current scheduling cycle as the time slice length, and divides the entire Fiber tree comparison task into multiple independent discrete work units according to the number of topological subtrees. Each work unit is then pushed into the background asynchronous task queue. Low-priority background threads retrieve discrete work units from the queue within each time slice for comparison. Once the current time slice is exhausted, the thread voluntarily relinquishes control, waiting for the next scheduling cycle to continue executing the currently unfinished work unit or the next discrete work unit, thus achieving non-blocking background computation.
[0025] In an optional embodiment, the step of generating the target Fiber tree within the second buffer, dividing the topological subtrees at logical intervals, and generating a state fingerprint for each root node of the topological subtree includes: Initialize a byte stream buffer for each logical interval topology subtree of the target Fiber tree in the second buffer, following the same state fingerprint generation rules as the baseline Fiber tree in the first buffer. According to the pre-defined chained Fiber tree query path, all subordinate nodes within the current logical interval are read sequentially. When encountering each subordinate node, the composite node index string, the level depth scalar identifying its own level position, the parent node composite node index, and the parameter digest value are extracted according to the established protocol and continuously appended to the tail of the byte stream buffer. After reaching the boundary and completing the extraction step, the SHA-256 information security hash algorithm engine is used to read in all the appended merged byte streams to generate the corresponding fixed-length hash digest value. The fixed-length hash digest value is then filled into a dedicated feature storage field allocated to the root node of the current topology subtree as the state fingerprint of the root node of the topology subtree.
[0026] For independently segmented topological subtrees, such as local networks divided by interval number 02, the memory allocation function is called in the memory heap area to initialize the byte array stream_buffer and initialize the write cursor to 0.
[0027] During the sequential traversal of the chained Fiber tree query path, for each subordinate node that hits the logical interval, the pre-stored attribute values of that node are read through the protocol parsing module. For example, the composite node index 02MCU1_110_PTOC1, the level depth scalar such as depth=2, are extracted and converted into a single byte 0x02, the parent node composite node index such as 02MCU1_110_PROT1, and the pre-calculated parameter digest value "e4d909c290d0fb1ca068ffaddf22cbd0".
[0028] Perform a memory append operation, storing the index string as an ASCII byte stream into an array, followed by a depth scalar byte, then concatenating the character sequence of the parent node's composite node index, and finally concatenating the 32-character sequence of the digest value. Simultaneously, the cursor variable is incremented by the offset corresponding to the number of bytes written. Optionally, before each append, it is checked whether the remaining capacity meets the current write length; if not, expansion or segmentation is performed before continuing the write.
[0029] The byte stream concatenation terminates when the traversal pointer reaches the boundary marker of the current logical interval or when there are no subsequent subordinate nodes within the current logical interval. The SHA-256 information security hash engine is instantiated, and the merged valid byte stream is read in. During hash calculation, eight 32-bit hash initial values H0-H7 are initialized. The byte stream is padded and cut into 512-bit blocks. After 64 rounds of operations based on bitwise shift, XOR, and nonlinear functions, a set of 256-bit fixed-length hash data is compressed and synthesized. This data is formatted into a hash digest string of 64 hexadecimal characters, such as "a1b2c3d4...e5f6", and an addressing write instruction is executed to store it in the fingerprint-specific feature field allocated to the root node of this subtree, completing the solidification of the state fingerprint at this level.
[0030] In an optional embodiment, the step of splitting the comparison task into discrete work units and executing them non-blockingly in a background task based on a time-slicing mechanism includes: Package all the comparison and verification work belonging to the single logical interval topology subtree into an independent discrete work unit; Configure a background thread for the comparison task in the operating system of the host, and set a fixed time slice threshold as the scheduling benchmark. When a background thread mounts and executes a discrete unit of work, a timer is started synchronously. If the execution time of the current discrete work unit reaches the time slice threshold, the operating system's task scheduling mechanism will be used to actively trigger a context switch, relinquishing the central processing unit's control and transferring it to a ready task or main control flow program in the operating system's scheduling queue, thus avoiding delays to the system's multi-threaded concurrency and real-time control tasks.
[0031] In the real-time operating system of the configuration host, create a background low-priority worker thread Thread_Compare and set the integer time threshold constant TimeSlice_Threshold to 5000 microseconds, or 5 milliseconds.
[0032] Task boundaries are defined by logical interval IDs, such as interval 01 and interval 02. The pairing relationship between new and old node pointers and the attribute comparison logic within a single logical interval are packaged into an independent structure instance TaskUnit and pushed into the processing queue of the background thread to obtain a relatively independent verification unit.
[0033] When the Thread_Compare thread retrieves a TaskUnit from the queue and begins processing it, it invokes a hardware timer to identify the current system clock tick as the start timestamp T_start. In the attribute comparison loop for each specific node, each iteration reads the latest clock tick T_current and calculates the elapsed time delta_T by subtraction.
[0034] If the system's decision variable satisfies the condition delta_T>=TimeSlice_Threshold, the thread will actively execute system call interfaces, such as yield() or taskDelay(1), generating a voluntary blocking signal that causes the kernel to push the current CPU context into the task control block for storage. The operating system then takes over the control flow, transferring CPU execution to high-priority tasks in the ready queue, such as fast parsing of GOOSE messages or distribution of protection actions, thereby helping to reduce the impact of large-scale configuration operations on the real-time performance of the control system.
[0035] S3. Compare the state fingerprints of the root nodes of the corresponding topological subtrees. If the fingerprints are the same, jump to the next logical interval. If the fingerprints are different, extract the composite node index and parameter summary value of the new and old nodes in the topological subtree and compare them to identify the difference nodes. If a high-priority task is generated, the comparison task is suspended and the node pointer is saved. The comparison task is resumed after the high-priority task is completed.
[0036] Before performing state fingerprint comparison, the main controller extracts the logical interval identifier lists from the first buffer and the second buffer respectively, and establishes a correspondence according to the logical interval identifiers. If a logical interval identifier exists only in the target Fiber tree, its corresponding topological subtree is marked as a newly added subtree, and the state fingerprint of the empty subtree generated by the preset empty node list is used as the preceding state fingerprint; if a logical interval identifier exists only in the base Fiber tree, its corresponding topological subtree is marked as a deleted subtree; if a logical interval identifier exists in both the base Fiber tree and the target Fiber tree, the state fingerprints of the root nodes of the corresponding topological subtrees of the two are compared.
[0037] When the state fingerprints are the same, it is determined that the topology and parameters have not changed within the logical interval, and the process jumps to the next logical interval. When the state fingerprints are different, the process enters the corresponding topology subtree, and identifies newly added nodes, deleted nodes, modified nodes, and nodes with changed topology relationships based on the comparison of the composite node index and parameter summary value. The identification results are then written to the operation log.
[0038] During the above comparison process, if a high-priority task trigger signal such as a relay protection action signal or a remote control operation command is received, the current comparison task is suspended and the comparison context is saved. After the high-priority task is completed, the comparison task is resumed from the interruption point based on the saved comparison context. The topology subtree state fingerprint comparison process is as follows: Figure 3 As shown.
[0039] In an optional embodiment, the step of comparing the composite node index of the new and old nodes within the extracted topological subtree with the parameter digest value to identify the difference nodes includes: Cursor structures are established in the first and second buffers respectively to traverse and compare the old and new subtrees. For the node status extracted by the cursor, the composite node index is used as the matching key to implement condition judgment: the first condition is that when the old composite node index has no matching item in the subtree list corresponding to the target Fiber tree, a node cleanup record with deletion mark is appended to the operation log. The second condition is that when the new composite node index has no matching item in the subtree list corresponding to the base Fiber tree, a node distribution record with a creation identifier is appended to the operation log. The third condition is that when there is a matching composite node index in the old and new subtrees, and the comparison of the parameter summary values of the two sides shows a mismatch, a value segment update record with a parameter change identifier is appended to the operation log. The fourth condition is that when there are matching composite node indexes in the old and new subtrees, and the parameter digest values of both are the same but there are differences in the level depth scalar, parent node composite node index, child node pointer relationship or sibling node pointer relationship, a structure update record with a topology change identifier is appended to the operation log.
[0040] Cursor objects `cursor_old` and `cursor_new` are instantiated in the first buffer allocated to the base Fiber tree and the second buffer allocated to the target Fiber tree, respectively. When comparing a logical interval, such as interval 02, the full quantum node list arrays attached to the old and new subtrees are extracted. The composite node index of the node currently pointed to by `cursor_old` is read, for example, `NodeIndex="02MCU1_110_PTOC1"`, and a hash lookup operation is performed in the new tree list array using this composite node index as the key.
[0041] If the key value returns null, meaning there is no matching item in the target Fiber tree, the first judgment condition is triggered. The action type ACTION=DELETE, the composite node index 02MCU1_110_PTOC1, and the current timestamp are encapsulated into a JSON log record format {"Action":"DELETE","Node":"02MCU1_110_PTOC1"}, and then copied into memory and appended to the system's operation log pool.
[0042] When a newly added composite index of cursor_new, such as "02MCU1_110_PIOC1", is read and the hash query fails in the baseline list, the second condition is triggered, and a corresponding distribution log record {"Action":"CREATE","Node":"02MCU1_110_PIOC1","Data":{...}} containing the set of configuration parameters is generated and appended to the log pool.
[0043] For nodes that have successfully achieved bidirectional mapping between the old and new lists, such as the composite node index "02MCU1_110_PDIF1", extract the parameter digest value variables digest_old and digest_new in the old and new states respectively. Then execute the string equality comparison function strcmp(digest_old, digest_new). If the operation returns a non-zero integer result, it indicates that the configuration data has been changed internally.
[0044] Entering the third decision branch, read the changed configuration parameter set from the corresponding node of the target Fiber tree, and generate a difference log record that simultaneously contains a composite node index, a new parameter summary value, and the changed configuration parameter data, for example, {"Action":"UPDATE","Node":"02MCU1_110_PDIF1","NewDigest":"3c4d...","NewData":{"Address":"0x1201","DataType":"FLOAT","CurrentLimit":6.0,"TimeDelay":0.5}}.
[0045] If digest_old and digest_new are the same, but the level depth scalar, parent node composite node index, child node relationship corresponding to child_offset, or sibling node relationship corresponding to sibling_offset are different, then a difference log record is generated that simultaneously contains the composite node index, the topology relationship before the change, and the topology relationship after the change. For example, {"Action":"RELINK","Node":"02MCU1_110_PDIF1","OldParent":"02MCU1_110_PROT1","NewParent":"02MCU1_110_CTRL1"}.
[0046] In an optional embodiment, the step of suspending the comparison task and saving the node pointer if a high-priority task is generated, and resuming the comparison task after the high-priority task is completed, includes: When the system task scheduler detects that a real-time action task with a higher priority than the current comparison task is generated in the embedded main process, it actively triggers a suspension instruction for the comparison background job, causing the task to enter a waiting state. The relative memory offset of the Fiber node pointed to by the current comparison cursor at the time of suspension is jointly encapsulated with the comparison progress status word and saved to the system's context storage area; When the high-priority real-time task is detected to have completed execution and released processing resources, the saved relative memory offset of the Fiber node and the comparison progress status word are read from the context storage area, restored to the working context of the comparison task, and the remaining comparison task flow is continued to be executed from the breakpoint along the Fiber tree chain path.
[0047] When the hardware interrupt service routine detects a real-time control signal in the substation system, such as a trip command, and the task priority is set to 0 (highest), the scheduler sends a global suspend semaphore SIG_SUSPEND to the background comparison job with a priority of 15. Upon recognizing this signal, the interrupt response function of the comparison thread suspends the current CPU execution pipeline.
[0048] Read the relative memory offset of the old Fiber node corresponding to the current old tree cursor `cursor_old` (OldNodeOffset = 0xA140), and read the relative memory offset of the new Fiber node corresponding to the current new tree cursor `cursor_new` (NewNodeOffset = 0xB180). Extract the comparison progress word variable `StatusWord` describing the task status, for example, the high 16 bits store the topology ID (0x0001) and the low 16 bits store the index (0x002A). Combine `OldNodeOffset`, `NewNodeOffset`, and `StatusWord` using a bitmask to construct a context backup structure `ContextBackup`. Use DMA or memory assignment operations to push this structure into the pre-allocated context storage area for saving.
[0049] Once the high-priority real-time control task completes and releases processing resources, the scheduler initiates a context recovery process. The main loop identifies task interruption by reading the suspension flag and immediately jumps to access the context storage area. Deserialization is performed on the ContextBackup structure to extract the retained OldNodeOffset and NewNodeOffset, and cursor_old and cursor_new are reset based on the first and second buffer base addresses, respectively. Simultaneously, StatusWord is parsed to restore register variables and counter states. Task wake-up is then performed, and control flow continues from the breakpoint node at the time of suspension, executing the pointer reading and comparison loop of the chained Fiber tree path to reduce the computational resource waste and latency consumption caused by re-traversal.
[0050] S4, the difference node is encoded into a data packet containing the previous state fingerprint and differential configuration instructions and sent to the target measurement and control device. After the target measurement and control device verifies that the previous state is consistent, it performs incremental update and overwrites the first buffer with the data in the second buffer.
[0051] The main controller summarizes the difference information recorded in the operation log, including newly added nodes, deleted nodes, modified nodes, nodes with topology changes, and newly added and deleted subtrees, and generates corresponding differential configuration instructions based on the difference type. The main controller groups the difference information according to logical intervals and determines a corresponding pre-state fingerprint for each group of difference information. Specifically, for topology subtrees that exist in both the base Fiber tree and the target Fiber tree, the state fingerprint of the root node of the corresponding topology subtree in the first buffer is used as the pre-state fingerprint; for newly added subtrees, the state fingerprint of empty subtrees generated from a preset list of empty nodes is used as the pre-state fingerprint; for deleted subtrees, the state fingerprint of the root node of the topology subtree to be deleted in the first buffer is used as the pre-state fingerprint.
[0052] The main controller encapsulates the logical interval identifier, the previous state fingerprint, and the differential configuration command into a configuration update data packet, and sends it to the corresponding target monitoring and control device through the substation process layer network. Upon receiving the configuration update data packet, the target monitoring and control device recalculates the current state fingerprint of its corresponding logical interval topology subtree; if the target device does not have a corresponding logical interval topology subtree, it generates an empty subtree state fingerprint according to the same rules. The target monitoring and control device compares its current state fingerprint with the previous state fingerprint in the configuration update data packet. If they do not match, the device refuses to execute the update and returns an error message; if they match, it performs an incremental update on the corresponding node or topology subtree according to the differential configuration command.
[0053] Once all target measurement and control devices involved in this round of difference update return a confirmation of successful update, the main controller overwrites the target Fiber tree data in the second buffer into the first buffer, so that the updated target Fiber tree is solidified as the benchmark Fiber tree for the next round of comparison, and clears the second buffer; if any target measurement and control device returns a failure or fails to confirm within a timeout, the original benchmark Fiber tree in the first buffer is retained, and the update failure status is recorded.
[0054] In an optional embodiment, the step of encoding the difference node into a data packet containing the previous state fingerprint and differential configuration instructions and sending it to the target measurement and control device, and the target measurement and control device performing incremental updates after verifying the consistency of the previous state, includes: The difference records in the operation log are grouped according to logical intervals, and each group of difference records is parsed into a differential configuration modification instruction set, and the corresponding previous state fingerprint is determined. The preceding state fingerprint is the state fingerprint of the root node of the corresponding reference topology subtree in the first buffer, or the state fingerprint of a preset empty subtree when there is no corresponding reference topology subtree in the first buffer. The aforementioned pre-state fingerprint and differential configuration modification instruction set are encapsulated into a configuration update data packet and sent to the target measurement and control device; The target measurement and control device calculates the current state fingerprint of the corresponding topological subtree of the local machine. If the local machine does not have a corresponding topological subtree, it generates an empty subtree state fingerprint and compares the current state fingerprint with the previous state fingerprint. If the comparison matches, it performs an incremental update. If the comparison does not match, it refuses to execute and returns an error response.
[0055] During the initialization phase of the distribution process, the configuration host backend program determines the topology subtree to be updated based on the logical interval identifier and reads the fingerprint variable of the root node of the corresponding baseline topology subtree from the first buffer as pre_fingerprint. For scenarios involving newly added subtrees, the configuration host generates an empty subtree state fingerprint according to a preset list of empty nodes and uses it as pre_fingerprint. For scenarios where multiple logical intervals are updated simultaneously, the configuration host sets the interval_id, pre_fingerprint, and diff_cmds fields for each logical interval. The pre_fingerprint is a hash value with a length of 64 hexadecimal characters, such as "a1b2c3d4e5f6...".
[0056] The configuration host inputs the accumulated node creation, node deletion, parameter update, topology change, subtree creation, and subtree deletion log objects from the operation log pool into the serialization engine, converting them into a binary differential instruction set, `diff_cmds`. Specifically, parameter update logs carry the changed configuration parameter data, ensuring `diff_cmds` contains the actual written values; topology change logs carry the changed parent node composite node index, child node pointer relationships, and sibling node pointer relationships, ensuring `diff_cmds` contains the actual heavy chain relationships.
[0057] The configuration host, following the MMS or IEC 61850 communication protocol stack specification, encapsulates interval_id, pre_fingerprint, and diff_cmds into the data payload, calculates a 16-bit CRC cyclic redundancy check code, generates a configuration update data packet, and sends it to the target monitoring and control device via a TCP / IP socket. The target monitoring and control device receives the packet, passes the CRC check, parses the interval_id and pre_fingerprint from the data packet, and calls its local SHA-256 algorithm library to recalculate the local_fingerprint of the corresponding logical interval topology subtree; if the corresponding topology subtree does not exist locally, it generates the local_fingerprint according to the same empty node list rules.
[0058] The target monitoring and control device performs a memcmp(local_fingerprint, pre_fingerprint) comparison operation. If the comparison results match, it indicates that the previous state recorded by the host is consistent with the current state of the device. The target monitoring and control device grants write permissions and, based on diff_cmds, overwrites the target node parameters, creates or deletes nodes, or updates the parent node return pointer, child node pointer, and sibling node pointer of the corresponding node, thereby completing the incremental update. If the comparison results do not match, it is determined that the current configuration of the device is out of sync with the host's baseline configuration. The target monitoring and control device refuses to perform the update, returns a response packet carrying error code 0xEE to the configuration host, and discards this update message to reduce the risk of misaligned distribution affecting the power grid operation.
[0059] In a second embodiment, the present invention also proposes an adaptive remote configuration system for a substation monitoring and control device, comprising the following modules: The calculation module is used to establish a composite node index consisting of equipment location code, voltage level code and logical node number for each measurement and control device and functional virtual point, and to calculate parameter summary value; by setting child node pointer, sibling node pointer and parent node return pointer, the deeply nested topology is transformed into a chain structure of reference Fiber tree and the reference Fiber tree is placed in the first buffer, and the state fingerprint of the reference topology subtree is generated. The generation module is used to generate the target Fiber tree in the second buffer, divide the topology subtrees at logical intervals and generate a state fingerprint for the root node of each topology subtree; and split the comparison task into discrete working units and execute them in a non-blocking background task based on a time-slicing mechanism. The identification module is used to compare the state fingerprint of the root node of the corresponding topological subtree. If the fingerprints are the same, it jumps to the next logical interval. If the fingerprints are different, it extracts the composite node index of the old and new nodes in the topological subtree and the parameter summary value for comparison to identify the difference nodes. If a high-priority task is generated, the comparison task is suspended and the node pointer is saved. The comparison task is resumed after the high-priority task is completed. The update module is used to encode the difference nodes into a data packet containing the previous state fingerprint and differential configuration instructions and send it to the target measurement and control device. After verifying that the previous state is consistent, the target measurement and control device performs an incremental update, and the data in the second buffer overwrites the first buffer.
[0060] The above description represents the preferred embodiments of the present invention. It should be noted that, for those skilled in the art, various improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. An adaptive remote configuration method for a substation monitoring and control device, characterized in that, include: For each measurement and control device and functional virtual point, a composite node index consisting of equipment location code, voltage level code and logical node number is established, and parameter summary values are calculated. By setting child node pointers, sibling node pointers, and parent node return pointers, the deeply nested topology is transformed into a linked base Fiber tree, the base Fiber tree is placed in the first buffer, and the state fingerprint of the base topology subtree is generated. The target Fiber tree is generated in the second buffer, the topology subtree is divided at logical intervals and a state fingerprint is generated for the root node of each topology subtree; the comparison task is split into discrete working units and executed non-blockingly in the background task based on the time-slicing mechanism. Compare the state fingerprints of the root nodes of the corresponding topological subtrees. If the fingerprints are the same, jump to the next logical interval. If the fingerprints are different, extract the composite node index and parameter summary value of the old and new nodes in the topological subtree and compare them to identify the difference nodes. If a high-priority task is generated, the comparison task is suspended and the node pointer is saved. The comparison task is resumed after the high-priority task is completed. The difference node is encoded into a data packet containing the previous state fingerprint and differential configuration instructions and sent to the target measurement and control device. After verifying that the previous state is consistent, the target measurement and control device performs an incremental update, and the data in the second buffer overwrites the data in the first buffer.
2. The adaptive remote configuration method for substation monitoring and control devices according to claim 1, characterized in that, The process of establishing a composite node index consisting of equipment location code, voltage level code, and logical node sequence number for each measurement and control device and functional virtual point, and calculating parameter summary values, includes: Read the equipment configuration file, extract the interval number and the measurement and control device instance identifier in sequence and combine them to generate the equipment location code, the integer voltage level value as the voltage level code, and the logical node unique instance identifier as the logical node sequence number. Use underscores as delimiters to connect the three parts of character data to generate a single composite node index string. The configuration parameter set is extracted from the configuration file of each node. The configuration parameter set includes communication address, data type and fixed value range. The data segment of the configuration parameter set is hashed using the MD5 hash function, and the output feature string of fixed length of 32 hexadecimal characters is saved as the parameter digest value of the node.
3. The adaptive remote configuration method for substation monitoring and control devices according to claim 2, characterized in that, The process of converting a deeply nested topology into a linked-structure baseline Fiber tree by setting child node pointers, sibling node pointers, and parent node return pointers, placing the baseline Fiber tree in a first buffer, and generating a subtree state fingerprint of the baseline topology includes: During the traversal of the tree hierarchy, the child node pointer is established by directly pointing the child node attribute of the current parent node to the relative memory offset of the first next-level derived node belonging to it. The relative memory offset of the sibling node pointer is used to point the adjacent sibling attribute of the currently traversed node to the next derived node at the same parent node level. Record the relative memory offset of the parent node of the traversed node and establish the parent node return pointer; Following the depth-first path and in accordance with the established concatenation order of the three types of pointers, all the scattered multi-dimensional tree nodes are assembled and reorganized into the continuous sequential memory blocks in the first buffer, resulting in a chained Fiber tree structure that supports depth-first queries. After the chain-like Fiber tree structure is constructed, the baseline topology subtree is divided according to the logical interval identifier, and the state fingerprint of the corresponding root node is generated based on the composite node index, level depth, parent node information and parameter summary value of the nodes in each baseline topology subtree.
4. The adaptive remote configuration method for substation monitoring and control devices according to claim 1, characterized in that, The process of generating the target Fiber tree within the second buffer, dividing the topology into subtrees at logical intervals, and generating a state fingerprint for the root node of each subtree includes: Initialize a byte stream buffer for each logical interval topology subtree of the target Fiber tree in the second buffer, following the same state fingerprint generation rules as the baseline Fiber tree in the first buffer. According to the pre-defined chained Fiber tree query path, all subordinate nodes within the current logical interval are read sequentially. When encountering each subordinate node, the composite node index string, the level depth scalar identifying its own level position, the parent node composite node index, and the parameter digest value are extracted according to the established protocol and continuously appended to the tail of the byte stream buffer. After reaching the boundary and completing the extraction step, the SHA-256 information security hash algorithm engine is used to read in all the appended merged byte streams to generate the corresponding fixed-length hash digest value. The fixed-length hash digest value is then filled into a dedicated feature storage field allocated to the root node of the current topology subtree as the state fingerprint of the root node of the topology subtree.
5. The adaptive remote configuration method for substation monitoring and control devices according to claim 1, characterized in that, The step of splitting the comparison task into discrete work units and executing them non-blockingly in background tasks based on a time-slicing mechanism includes: Package all the comparison and verification work belonging to the single logical interval topology subtree into an independent discrete work unit; Configure a background thread for the comparison task in the operating system of the host, and set a fixed time slice threshold as the scheduling benchmark. When a background thread mounts and executes a discrete unit of work, a timer is started synchronously. If the execution time of the current discrete work unit reaches the time slice threshold, the operating system's task scheduling mechanism will be used to actively trigger a context switch, relinquishing the central processing unit's control and transferring it to a ready task or main control flow program in the operating system's scheduling queue, thus avoiding delays to the system's multi-threaded concurrency and real-time control tasks.
6. The adaptive remote configuration method for substation monitoring and control devices according to claim 1, characterized in that, The step of comparing the composite node index of new and old nodes within the extracted topological subtree with the parameter summary value to identify differing nodes includes: Cursor structures are established in the first and second buffers respectively to traverse and compare the old and new subtrees. For the node status extracted by the cursor, the composite node index is used as the matching key to implement condition judgment: the first condition is that when the old composite node index has no matching item in the subtree list corresponding to the target Fiber tree, a node cleanup record with deletion mark is appended to the operation log. The second condition is that when the new composite node index has no matching item in the subtree list corresponding to the base Fiber tree, a node distribution record with a creation identifier is appended to the operation log. The third condition is that when there is a matching composite node index in the old and new subtrees, and the comparison of the parameter summary values of the two sides shows a mismatch, a value segment update record with a parameter change identifier is appended to the operation log. The fourth condition is that when there are matching composite node indexes in the old and new subtrees, and the parameter digest values of both are the same but there are differences in the level depth scalar, parent node composite node index, child node pointer relationship or sibling node pointer relationship, a structure update record with a topology change identifier is appended to the operation log.
7. The adaptive remote configuration method for substation monitoring and control devices according to claim 1, characterized in that, The step of suspending the comparison task and saving the node pointer if a high-priority task is generated, and resuming the comparison task after the high-priority task is completed, includes: When the system task scheduler detects that a real-time action task with a higher priority than the current comparison task is generated in the embedded main process, it actively triggers a suspension instruction for the comparison background job, causing the task to enter a waiting state. The relative memory offset of the Fiber node pointed to by the current comparison cursor at the time of suspension is jointly encapsulated with the comparison progress status word and saved to the system's context storage area; When the high-priority real-time task is detected to have completed execution and released processing resources, the saved relative memory offset of the Fiber node and the comparison progress status word are read from the context storage area, restored to the working context of the comparison task, and the remaining comparison task flow is continued to be executed from the breakpoint along the Fiber tree chain path.
8. The adaptive remote configuration method for substation monitoring and control devices according to claim 1, characterized in that, The process of encoding the difference nodes into a data packet containing the previous state fingerprint and differential configuration instructions and sending it to the target measurement and control device, followed by the target measurement and control device verifying the consistency of the previous state and performing incremental updates, includes: The difference records in the operation log are grouped according to logical intervals, and each group of difference records is parsed into a differential configuration modification instruction set, and the corresponding previous state fingerprint is determined. The preceding state fingerprint is the state fingerprint of the root node of the corresponding reference topology subtree in the first buffer, or the state fingerprint of a preset empty subtree when there is no corresponding reference topology subtree in the first buffer. The aforementioned pre-state fingerprint and differential configuration modification instruction set are encapsulated into a configuration update data packet and sent to the target measurement and control device; The target measurement and control device calculates the current state fingerprint of the corresponding topological subtree of the local machine. If the local machine does not have a corresponding topological subtree, it generates an empty subtree state fingerprint and compares the current state fingerprint with the previous state fingerprint. If the comparison matches, it performs an incremental update. If the comparison does not match, it refuses to execute and returns an error response.
9. An adaptive remote configuration system for a substation monitoring and control device, characterized in that, include: The calculation module is used to establish a composite node index consisting of equipment location code, voltage level code and logical node number for each measurement and control device and functional virtual point, and to calculate parameter summary value; by setting child node pointer, sibling node pointer and parent node return pointer, the deeply nested topology is transformed into a chain structure of reference Fiber tree and the reference Fiber tree is placed in the first buffer, and the state fingerprint of the reference topology subtree is generated. The generation module is used to generate the target Fiber tree in the second buffer, divide the topology subtrees at logical intervals and generate a state fingerprint for the root node of each topology subtree; and split the comparison task into discrete working units and execute them in a non-blocking background task based on a time-slicing mechanism. The identification module is used to compare the state fingerprint of the root node of the corresponding topological subtree. If the fingerprints are the same, it jumps to the next logical interval. If the fingerprints are different, it extracts the composite node index of the old and new nodes in the topological subtree and the parameter summary value for comparison to identify the difference nodes. If a high-priority task is generated, the comparison task is suspended and the node pointer is saved. The comparison task is resumed after the high-priority task is completed. The update module is used to encode the difference nodes into a data packet containing the previous state fingerprint and differential configuration instructions and send it to the target measurement and control device. After verifying that the previous state is consistent, the target measurement and control device performs an incremental update, and the data in the second buffer overwrites the first buffer.
10. The adaptive remote configuration system for substation monitoring and control devices according to claim 9, characterized in that, The process of establishing a composite node index consisting of equipment location code, voltage level code, and logical node sequence number for each measurement and control device and functional virtual point, and calculating parameter summary values, includes: Read the equipment configuration file, extract the interval number and the measurement and control device instance identifier in sequence and combine them to generate the equipment location code, the integer voltage level value as the voltage level code, and the logical node unique instance identifier as the logical node sequence number. Use underscores as delimiters to connect the three parts of character data to generate a single composite node index string. The configuration parameter set is extracted from the configuration file of each node. The configuration parameter set includes communication address, data type and fixed value range. The data segment of the configuration parameter set is hashed using the MD5 hash function, and the output feature string of fixed length of 32 hexadecimal characters is saved as the parameter digest value of the node.