A method and system for fast isolation and self-recovery of abnormal nodes in an MSTP network
Patent Information
- Application Number
- CN202611099993.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-09-22
AI Technical Summary
[0005]尽管上述方案在一定程度上改善了MSTP网络的故障处理能力,但仍存在以下核心技术问题未得到根本解决:
[0030]1、本发明通过滑动窗口统计驱动的自适应超时,使超时阈值随节点实际响应特性动态调整,相较现有固定超时方案,可显著减少误判率,同时将真故障的隔离延迟保持在秒级;同时,结合分布式健康位图共识机制,实现多节点并行观察与协同判定,使隔离决策在一轮令牌循环内即可完成,隔离速度与网络规模几乎解耦。
Smart Images

Figure CN122802340A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fieldbus communication technology, and in particular to a method and system for rapid isolation and self-recovery of abnormal nodes in an MSTP network. Background Technology
[0002] BACnet MSTP is a token-passing data link layer protocol based on the RS-485 physical layer. Due to its determinism, low cost, and high reliability, it has become the mainstream standard for communication between controllers and field devices in building automation systems (including HVAC, lighting, security, and other subsystems). An MSTP network consists of multiple master nodes (MAC addresses 0–127) and optional slave nodes (MAC addresses 128–254). Master nodes pass media access rights to each other via token frames in ascending order of MAC address; only the node holding the token can initiate data transmission.
[0003] In the ANSI / ASHRAE 135 standard, the detection and isolation of abnormal nodes mainly rely on fixed timeout parameters (such as Tusage_timeout, APDU_timeout) and a fixed number of retries (such as Nretry_token). When a node fails to respond within the specified timeout period, the token holder will retry a fixed number of times. After the retries are exhausted, a new available node is searched starting from the next address through the PollForMaster (PFM) mechanism. However, this traditional mechanism has significant efficiency defects in scenarios with large network sizes (more than 30 master nodes) or intermittent failures, which can easily lead to token ring performance degradation or even network paralysis.
[0004] To address these issues, various improvement solutions have been proposed in the industry. For example, one company proposed enhancing the fault handling logic in the MSTP state machine. When a DER (Data Expecting Reply) message times out, the target MAC address is immediately marked as non-communication, and PFM messages are used to quickly verify whether the faulty device has recovered. Subsequent DER messages for nodes already marked as faulty are discarded, reducing the token ring degradation time in typical fault scenarios from approximately 15 minutes to 3–4 seconds. Another technical solution determines the device's operating status by analyzing the type and destination address of reference data packets, reducing unnecessary token and polling control frame transmissions. Furthermore, other solutions improve network stability by optimizing the PFM execution cycle and using host polling to locate faulty nodes.
[0005] Although the above solutions have improved the fault handling capabilities of MSTP networks to some extent, the following core technical problems remain unresolved:
[0006] First, fixed timeout and retry parameters cannot adapt to dynamic network environments. Existing standards and improvement schemes all use preset fixed timeout parameters and fixed number of retries, which cannot be dynamically adjusted according to network load fluctuations, changes in electromagnetic interference, or differences in node performance. When the network load is high or transient interference exists, fixed parameters can easily misjudge occasional communication delays as node failures; while when a node does fail, excessively long timeouts can lead to untimely fault isolation, causing a degradation in token ring performance.
[0007] Second, fault determination relies solely on single-point information and lacks a network-wide collaborative mechanism. In existing solutions, fault determination is made independently by the current token holder, and other nodes cannot share fault information. In scenarios where multiple nodes fail simultaneously or the network topology is large, global convergence to a consistent isolation decision takes a long time. During this period, each node will continue to attempt to transmit data to the failed node, resulting in a serious waste of bandwidth resources and even triggering cascading failures.
[0008] Third, the binary switching mode used for node recovery is prone to causing network instability. In existing solutions, once an isolated node resumes communication, it immediately participates in token passing at full functionality. In intermittent fault scenarios (such as periodic communication interruptions caused by line moisture, transient electromagnetic interference, etc.), nodes may repeatedly switch between online and offline states. Each state switch triggers token ring rearrangement or PFM scanning, causing significant fluctuations in overall network throughput and affecting normal business communication.
[0009] Fourth, there is a lack of differentiated fault handling strategies. Existing solutions use the same timeout, retry, and isolation parameters for all MSTP master nodes, failing to consider the differences in the functional roles of nodes within the network. Using the same fault handling strategy for core nodes undertaking critical control tasks and ordinary nodes only responsible for data acquisition cannot achieve an optimal balance between reliability and real-time performance.
[0010] In summary, existing MSTP network anomaly handling technologies cannot simultaneously meet the requirements of rapid fault isolation, accurate fault diagnosis, and stable network recovery. There is an urgent need for an anomaly handling method that can adapt to dynamic network environments, support distributed collaborative decision-making, and achieve progressive self-recovery in order to improve the stability and reliability of large-scale MSTP networks.
[0011] Therefore, how to provide a method and system for rapid isolation and self-recovery of abnormal nodes in an MSTP network is an urgent problem to be solved. Summary of the Invention
[0012] This invention provides a method and system for rapid isolation and self-recovery of abnormal nodes in an MSTP network, in order to solve the aforementioned technical problems existing in the prior art.
[0013] According to a first aspect of the present invention, a method for rapid isolation and self-recovery of abnormal nodes in an MSTP network is provided.
[0014] In one embodiment, a method for rapid isolation and self-recovery of abnormal nodes in an MSTP network includes:
[0015] Based on the historical response latency data of the target node, a timeout threshold is dynamically generated, and it is determined whether the actual response time exceeds the timeout threshold. If not, the historical response latency data is updated and token passing continues; if so, the current response latency data is output.
[0016] Based on the current response delay data, calculate the number of consecutive timeouts of the target node, and make a judgment based on the network deterioration conditions and consecutive timeout conditions, and execute a differentiated processing strategy based on the judgment results;
[0017] Based on the execution results of the differentiated processing strategy, a target fault marker is generated, the fault isolation process is initiated to calculate the consensus threshold, and the token ring rearrangement operation is triggered after the fault isolation meets the consensus threshold, and the isolation trigger signal is output.
[0018] Based on the isolation trigger signal, the isolated node executes a progressive multi-stage self-recovery process based on the token passing feature to achieve rapid isolation and self-recovery of abnormal nodes.
[0019] According to a second aspect of the present invention, a rapid isolation and self-recovery system for abnormal nodes in an MSTP network is provided.
[0020] In one embodiment, a rapid isolation and self-recovery system for abnormal nodes in an MSTP network includes:
[0021] The timeout determination module is used to dynamically generate a timeout threshold based on the historical response delay data of the target node, and determine whether the actual response time exceeds the timeout threshold. If not, the historical response delay data is updated and token passing continues; if so, the current response delay data is output.
[0022] The differential processing module is used to calculate the number of consecutive timeouts of the target node based on the current response latency data, and to make a judgment based on the network deterioration conditions and consecutive timeout conditions, and to execute a differential processing strategy based on the judgment results.
[0023] The isolation trigger module is used to generate target fault markers based on the execution results of the differentiated processing strategy, start the fault isolation process, calculate the consensus threshold, and trigger the token ring rearrangement operation after the fault isolation meets the consensus threshold, and output the isolation trigger signal.
[0024] The self-recovery module is used to execute a progressive, multi-stage self-recovery process based on token passing characteristics of the isolated node according to the isolation trigger signal, so as to achieve rapid isolation and self-recovery of abnormal nodes.
[0025] According to a third aspect of the present invention, a computer device is provided.
[0026] In some embodiments, the computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described above.
[0027] According to a fourth aspect of the present invention, a computer-readable storage medium is provided.
[0028] In one embodiment, a computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the above method.
[0029] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:
[0030] 1. This invention uses an adaptive timeout driven by sliding window statistics to dynamically adjust the timeout threshold according to the actual response characteristics of the node. Compared with the existing fixed timeout scheme, it can significantly reduce the false judgment rate and keep the isolation delay of real faults at the second level. At the same time, combined with the distributed health bitmap consensus mechanism, it realizes parallel observation and collaborative judgment of multiple nodes, so that the isolation decision can be completed within one round of token cycle, and the isolation speed is almost decoupled from the network scale.
[0031] 2. This invention eliminates interference based on a token passing specific mechanism. Through lightweight probe warning, global cyclic verification access, end-point quota trial and distributed synchronization, it achieves zero-intrusion recovery and error prevention isolation, thereby minimizing disturbances to the ring network timing. In addition, it adopts a hierarchical role strategy, giving key nodes such as gateways and routers more lenient judgment thresholds and more conservative isolation strategies, further improving the stability of the core network.
[0032] 3. All enhancement mechanisms of this invention run on the standard MSTP state machine and use the Reserved field to carry health bitmap information. This design not only ensures the efficient operation of the system, but also maintains complete transparent compatibility with traditional nodes that do not support this enhancement, effectively balancing the advancement of technology with the smooth transition of engineering deployment.
[0033] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0035] Figure 1 This is a flowchart illustrating an exemplary embodiment;
[0036] Figure 2 This is a principle block diagram illustrated according to an exemplary embodiment;
[0037] Figure 3 This is a schematic diagram of the structure of a computer device according to an exemplary embodiment;
[0038] Figure 4 This is a hierarchical block diagram of a system architecture illustrated according to an exemplary embodiment;
[0039] Figure 5 This is a flowchart illustrating the process from token passing to exception isolation and then to gradual recovery, according to an exemplary embodiment. Detailed Implementation
[0040] The following description and accompanying drawings fully illustrate specific embodiments described herein to enable those skilled in the art to practice them. Some portions and features of certain embodiments may be included in or replace portions and features of other embodiments. The scope of the embodiments herein includes the entire scope of the claims and all available equivalents thereof. The various embodiments described herein are presented in a progressive manner, with each embodiment focusing on its differences from other embodiments; similar or identical parts between embodiments can be referred to interchangeably.
[0041] The modules in the apparatus or system of this application can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0042] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0043] Figure 1 An embodiment of a rapid isolation and self-recovery method for abnormal nodes in an MSTP network according to the present invention is shown.
[0044] In this optional embodiment, the method for rapid isolation and self-recovery of abnormal nodes in an MSTP network includes:
[0045] Step S101: Based on the historical response delay data of the target node, dynamically generate a timeout threshold and determine whether the actual response time exceeds the timeout threshold. If not, update the historical response delay data and continue to execute token passing; if so, output the current response delay data.
[0046] In this optional embodiment, a timeout threshold is dynamically generated based on the historical response latency data of the target node, and it is determined whether the actual response time exceeds the timeout threshold. If not, the historical response latency data is updated, and token passing continues; if so, the current response latency data is output, including:
[0047] Maintain a sliding window of a preset size for each target node and record historical response latency data to calculate the mean and standard deviation of response latency;
[0048] Based on the mean and standard deviation of response delay, combined with the sensitivity coefficient, preset timeout upper limit and preset timeout lower limit, the timeout threshold is dynamically generated.
[0049] Collect the actual response time of the target node and compare the actual response time with the timeout threshold;
[0050] If the actual response time does not exceed the timeout threshold, record the current actual response time, update the historical response latency data using the exponentially weighted moving average technique, and continue to execute the token passing; if the actual response time exceeds the timeout threshold, output the current response latency data.
[0051] The expression for the timeout threshold is:
[0052] ;
[0053] In the formula, Indicates the timeout threshold; Indicates the lower limit of timeout; Indicates the timeout limit; This represents the average response delay; Indicates the sensitivity coefficient; This represents the standard deviation of the response delay.
[0054] It should be added that a sliding window of size W is maintained for each adjacent master node to record the response latency history {d1,d2,...,d} of the most recent W successful interactions. w}; Average response time calculated online and standard deviation Generate dynamic timeout threshold ,in This is the sensitivity coefficient (default 3.0). and These are the lower and upper timeout limits, respectively. When the actual response time t...response ≤T dynamic Under normal circumstances, the token holder receives the response frame from the target node, and ATE delays this response by d. new =t response Enter the sliding window and update the statistics using the Exponentially Weighted Moving Average (EWMA) method: μ new =β·d new +(1−β)·μ old (β is the attenuation coefficient, default 0.1), then σ² is recalculated. new After completing the statistical update, the token holder continues the normal token transfer process, processes the response data (if any), sends the data to be sent to the node (if any), and then passes the token to the next-hop MAC address. When the actual response time t... response >T dynamic When a timeout occurs, a timeout event is triggered, initiating the joint timeout-retry decision-making phase. When the number of samples within the window is insufficient (less than W...),... min When (a), use the preset default timeout value T. default When the target node is a critical node, k is multiplied by a relaxation factor α (α>1) to make the timeout of the critical node more lenient and reduce the probability of false isolation.
[0055] Step S102: Based on the current response delay data, calculate the number of consecutive timeouts of the target node, and make a judgment based on the network deterioration conditions and consecutive timeout conditions, and execute a differentiated processing strategy based on the judgment results.
[0056] In this optional embodiment, performing network degradation determination based on network degradation conditions includes:
[0057] Based on the current response delay data, obtain the response delay variance of the current sliding window and the response delay variance of the previous sliding window, and determine whether a single sliding window meets the network degradation condition.
[0058] If a single sliding window satisfies the network degradation condition, and a preset number of consecutive sliding windows all satisfy the network degradation condition, then the network is determined to be degraded.
[0059] If a single sliding window does not meet the network degradation condition, or if a preset number of consecutive sliding windows do not all meet the network degradation condition, it is determined that no network degradation has occurred, and a continuous timeout judgment is executed.
[0060] The expression for the network degradation condition is as follows:
[0061] ;
[0062] In the formula, This represents the variance of the response delay of the current sliding window; Indicates the trend threshold; This represents the variance of the response delay of the previous sliding window.
[0063] In this optional embodiment, the differential processing strategy based on the determination result includes:
[0064] When network degradation is detected, the timeout increment is calculated and combined with the preset joint cost function to determine the priority to increase the timeout threshold while keeping the current number of retries unchanged.
[0065] When the network is not determined to be deteriorating but the continuous timeout condition is met, the number of retries is reduced first. If the number of retries after reduction is lower than the preset threshold, the retry process is skipped. If the number of retries after reduction is greater than the preset threshold, the number of retries after reduction is used as the new number of retries, the current timeout threshold is maintained, and the retry process is executed.
[0066] If the network is not determined to be deteriorated and the continuous timeout condition is not met, the current timeout threshold and number of retries remain unchanged, and the retry process is executed.
[0067] In this optional embodiment, the retry process includes:
[0068] The token holder resends the token frame to the target node and waits for the target node's response within the current timeout threshold;
[0069] If a valid response is received from the target node within the waiting time, the historical response delay data is updated, the consecutive timeout count of the target node is reset, and token passing continues.
[0070] If no valid response is received from the target node within the waiting time, the consecutive timeout count of the target node will be accumulated, and the network degradation judgment and consecutive timeout judgment will be re-executed. Based on the judgment result, a differentiated strategy will be implemented.
[0071] It should be added that the response delay variance σ² of the current window is obtained from ATE. new The variance σ² of the previous window old Determine whether the deterioration condition is met: σ² new >γ·σ² old Where γ is the trend threshold (default 1.5); to eliminate instantaneous fluctuations, this condition must be met continuously over N consecutive N periods. trend If all three conditions are met within a window (default 3), it is considered a precursor to network degradation; the value of σ² is directly derived from the sliding window statistics updated by ATE after each normal response, and ATE recalculates synchronously after each update of μ. And when a timeout occurs, the current σ² will be... new and the previous window σ² old This information is also passed to JOM. The number of consecutive timeouts (C) for this target node is counted. consec Each time a timeout occurs for the target node, Cconsec Add 1; each time the target node responds normally, C consec Reset to 0; when C consec ≥C timeout When the default value is 3, the response is considered completely interrupted. Define the joint cost function C(T,R)=T·R+λ / T (T is the timeout value, R is the number of retries, and λ is the balancing factor, defaulting to 1.0). Based on the decision result, execute the following policy branch:
[0072] Strategy A: Early signs of deterioration. When network degradation is detected, prioritize increasing the timeout rather than retrying. Calculate... Choose the option that satisfies C(T) current +ΔT,R current ) <C(T current ,R current The +1) strategy, i.e., increasing the timeout threshold to T new =T current +ΔT, keeping the number of retries constant, and T new Feedback to ATE for T update dynamic .
[0073] Strategy B: Completely interrupt the response. When network degradation is not determined but the continuous timeout condition is met, prioritize reducing retries to accelerate isolation. If R new =0, skip retries and proceed directly to the fault marking process; if R new >0, with R new Set the number of retries and maintain the current timeout threshold to perform retries.
[0074] Strategy C: Intermediate state. When the network is not determined to be deteriorating and the continuous timeout condition is not met, the standard retry strategy is executed, i.e., the current time T is maintained. dynamic If R remains unchanged, perform a retry.
[0075] If the strategy decision requires a retry (R) new >0), the token holder resends the token frame to the target node, waiting for T dynamic After assessing the response, if the retry is successful, update the ATE statistics according to the normal path and reset C. consec If the retry still times out, then C consec Continue accumulating, returning to the step of network degradation determination; if the policy determination is not to retry (R... new If the value is 0, proceed directly to the next step.
[0076] Step S103: Based on the execution result of the differentiated processing strategy, generate a target fault marker, start the fault isolation process to calculate the consensus threshold, and trigger the token ring rearrangement operation after the fault isolation meets the consensus threshold, and output the isolation trigger signal.
[0077] In this optional embodiment, initiating a fault isolation process to calculate the consensus threshold includes:
[0078] Add the media access control address corresponding to the target fault node to the preset target fault list, and generate a fault bitmap based on the addition result;
[0079] Using the preset local node as the token holder, read the bitmap carried in the current token frame, and perform a bitwise OR operation with the fault bitmap to obtain the initial updated bitmap;
[0080] The initial updated bitmap is passed to the next node, and a bitwise OR operation is performed with the target fault list to obtain the secondary updated bitmap;
[0081] The number of target faulty nodes and currently active nodes in the second-update bitmap is counted, and the consensus threshold for the corresponding target node is generated based on the statistical results.
[0082] In this optional embodiment, the consensus threshold includes: a first node, a second node, and a third node;
[0083] The number of active nodes that is greater than two-thirds of the number of target faulty nodes is taken as the first node;
[0084] The number of active nodes that is greater than half the number of target faulty nodes is used as the second node;
[0085] The number of active nodes that is more than one-third of the target faulty nodes is used as the third node.
[0086] It should be added that the specific content and structure of the health bitmap are as follows: A 16-byte (128-bit) health status bitmap area is defined in the Reserved field of the MSTP token frame. Bit[0] is a reserved bit (always 0), and bits[1] to bit
[127] correspond to the master nodes with MAC addresses 1 to 127 respectively. The value of each bit is: 0 = normal (HEALTHY), 1 = suspected fault (SUSPECT). This bitmap is jointly maintained by each master node during the token transmission process. It adopts "OR logic" aggregation. After any node sets a bit to 1, the bitmap is passed around with the token frame. Other nodes keep the bit set to 1 after reading it (that is, the bit set to 1 will not be cleared by any node alone). The clearing of bits in the bitmap is only performed uniformly by HBM after triggering isolation or after the node completes the gradual recovery.
[0087] The specific implementation steps of distributed collaborative isolation are as follows: Each master node maintains a local list of suspected faults. When the node acts as a token holder, if the ATE determines that a target node has timed out and the JOM decision is not to retry (or retry exhaustion), the MAC address of the target node is added to the local list of suspected faults. When assembling the token frame, the token holder sets the bitmap corresponding to each MAC address in the local list of suspected faults to 1. Specifically, it reads the existing bitmap value in the current token frame, performs a bitwise OR operation with the local bitmap, and writes it to the Reserved field of the token frame; at the same time, it keeps the bit corresponding to the current node's own MAC address at 0 (a node can declare itself normal, but cannot declare itself faulty; fault determination is made by other nodes). The token frame carries the updated bitmap and passes it to the next node. After receiving the token, the next node reads all the markers in the bitmap, performs an OR operation with the local list of suspected faults, and updates the bitmap again. As the token circulates on the ring, the observation information of each node regarding faults is gradually aggregated into the bitmap. After updating the bitmap, each node counts the number N bits in the bitmap that are 1. fault (That is, the total number of bits with a value of 1 in the health bitmap, representing the number of nodes currently marked as potentially faulty), and also counting the number N of currently known active master nodes. active N active The determination method is as follows: each node maintains an active node set, initially empty; during token passing, for each valid token frame received from MAC address M, M is added to the active node set; if a certain MAC address exceeds N... active_timeout (Number of rounds for removing active nodes after timeout, default 5 rounds) If a node does not appear in the token frame source address during a round of token cycling, it will be removed from the active node set. N active =|Set of active nodes|. When N fault >N active When the threshold is 2 (more than half), distributed consensus is achieved. At this point: RSM first adjusts the isolation threshold according to the role of the target nodes. Critical nodes (gateways, routers, BBMDs) require N... fault >2 / 3·N active A regular node (DDC controller) requires N fault >N active / 2; Low-priority nodes (end-point sensor controllers) only require N fault >N active / 3. Once the corresponding threshold is met, HBM notifies the MSTP state machine to perform token ring rearrangement: the MAC address of the faulty node is removed from the token passing sequence, and the token holder skips the faulty node and directly passes it to the nearest normal node after the faulty node. HBM also clears the bitmap bit corresponding to the faulty node to zero (because the node has been formally isolated and no longer needs bitmap voting) to avoid the bits of the isolated node interfering with the determination of other subsequent nodes.
[0088] In addition, the main nodes in the network are divided into three levels according to their functional roles: critical nodes (gateways, routers, BBMD): k multiplied by α (default 1.5), isolation requires the consent of more than 2 / 3 of the nodes; ordinary nodes (DDC controller): standard k value (default 3.0), isolation requires the consent of more than half of the nodes; low priority nodes (end sensor controller): k multiplied by 0.8, isolation only requires the consent of more than 1 / 3 of the nodes.
[0089] Step S104: Based on the isolation trigger signal, the isolated node executes a progressive multi-stage self-recovery process based on the token passing characteristic to achieve rapid isolation and self-recovery of the abnormal node.
[0090] In this optional embodiment, the progressive multi-stage self-recovery process is divided into warning period, observation period, trial period and full-function state in order of increasing degree of intrusion into the token ring;
[0091] During the warning period, the token holder verifies the communication capability of the isolated node with the minimum probe frame and determines whether the probe times out continuously. If so, and the preset isolation threshold is reached, the node enters the observation period; otherwise, the warning is lifted and the isolated node resumes its communication state.
[0092] During the observation period, the receiving capability of the isolated nodes and the health status of the global token ring are verified through token cycle integrity. After witnessing all active nodes and the completion of the preset number of full token cycles, the trial period begins.
[0093] During the trial period, the isolated node is inserted at the end of the token sequence, and the maximum time for holding the token each time is limited. It is determined whether a timeout occurs within a preset number of token cycles. If not, it enters the full-function state and completes the self-recovery process; if so, it reverts to the observation period.
[0094] In this optional embodiment, before entering the full-function state, the recovery parameters are adaptively adjusted according to the historical failure frequency of the isolated node, and during the phase migration, a single round of recovery notification flag is written through the token frame retention field to update the token passing sequence and complete the self-recovery process.
[0095] It is important to note that the self-recovery mechanism of this invention differs fundamentally from the generalized phased recovery methods in existing technologies: the entry conditions, behavioral constraints, and exit criteria for each phase are deeply bound to the specific mechanism of MSTP token passing, and cannot be established outside the token ring operating environment. Specifically, in a token passing network, a node's recovery from an isolated state to a fully functional state is not merely a matter of restarting communication; it means that the node rejoins the token receiving sequence, regains token ownership, and regains the ability to initiate data transmission. These three aspects correspond to different degrees of intrusion into the token ring. The recovery phases are designed according to the degree of intrusion into the token ring, from low to high. Each phase is constrained by minimizing the disturbance to the token ring at that stage, and the exit criterion for each stage is a token ring-level integrity verification, rather than a local communication verification of the node itself.
[0096] 1. Probe token warning period, corresponding to zero token ring intrusion: Before HBM reaches consensus and formally triggers isolation, when N fault Reaching N active / 3 If the isolation threshold is not reached, a warning period is initiated. The core operation during the warning period is not a simple priority reduction, but rather the introduction of a ProbeToken mechanism: the token holder no longer sends a complete token frame (including data payload) to the target node, but instead sends a minimal probe frame containing only a header and a health bitmap (approximately 1 / 5 the length of a complete token frame, only 8–12 bytes). The target node only needs to wait for the probe timeout T. probe (Default 5ms, much shorter than normal T) dynamic A single ACK frame is sufficient to respond within a short timeframe. If the response is successful, the local suspected count for that node is decremented by 1; if the probe times out, the local suspected count continues to accumulate. The purpose of the probe token design is to continuously verify the basic communication capabilities of the target node (frame header CRC checksum and short ACK) with minimal time cost. Because the probe frame is extremely short, even if the target node does not respond, it will not significantly slow down the token ring rhythm. The probe does not contain data payload or token passing rights. Even if the target node replies with an ACK, it cannot obtain the token or send data (zero intrusion), thus securely distinguishing between two situations: a node transceiver is normal but may have logical abnormalities, and a node is completely disconnected. This mechanism is unique to MSTP token passing networks; the concept of a token holder sending a probe frame without a token to a target node does not exist in other network types (such as TCP / IP). Warning period exit condition: N consecutive observe_warn The probe successfully completes 10 times (default) until it returns to normal (warning lifted); continuous probe timeout C timeout Next and N fault Reaching the isolation threshold triggers formal isolation.
[0097] 2. Token Cycle Integrity Observation Period, Corresponding to Token Ring Intrusion-Free: After the isolated node enters the observation period, its recovery criterion is not simply receiving N consecutive token frames, but must complete the Token Cycle Integrity Check: the node must successfully receive at least one token frame from each active node in the current active node set, which is equivalent to witnessing at least one complete, error-free token cycle; specifically implemented as follows: PRSM maintains a Witnessed Bitmap (128 bits) for the isolated node, initialized with all 0s; during the observation period, for each successfully received and correctly CRC-checked token frame from MAC address M, bit[M] is set to 1; when the number of bits set to 1 in the Witnessed Bitmap reaches N... active Time (i.e., all active nodes are witnessed), counts one complete token cycle, continuously completing N rounds. observe_cycle After a complete token cycle (default 3 rounds), the observation period is passed, and the trial period begins. The significance of token cycle integrity verification is that it not only verifies the normal operation of the isolated node's own receiving channel but also verifies the health of the entire token ring. If the token ring itself has other faults (such as other nodes also experiencing intermittent failures, token loss, etc.), the isolated node will be unable to complete a full cycle and will thus be correctly prevented from recovering. This verification mechanism cannot be generalized to a universal health check for other network types. It relies on the unique MSTP structural characteristic of each node in the token ring taking turns holding the token in ascending order. In TCP / IP or star topology networks, there is no concept of witnessing all active nodes completing a token cycle.
[0098] 3. Trial period for end-of-token quota, corresponding to low token ring intrusion: After the observation period, the PRSM notifies the MSTP state machine to re-insert the node into the token passing sequence. The insertion strategy is not to restore it to its original MAC address position (which would disrupt the currently stable token ring order), but to forcibly insert it at the very end of the token sequence (i.e., after the largest active MAC address in the current ring), ensuring it is the last node accessed in each token cycle. The purpose of the end-of-token insertion strategy is: if the trial node fails again (timeout) during the trial period, because it is at the end of the token sequence, its failure only affects the last segment of the current token cycle, and the next cycle starts normally from the smallest MAC address, minimizing the impact. Because it is at the end, the trial node usually needs to wait the longest to obtain a token, naturally limiting its data transmission frequency, forming a double constraint in conjunction with the quota limit (maximum Serial frames per round). The data transmission quota of the trial node is bound to the token holding time: the maximum holding time of the trial node for each token is hard-limited to T. trial_hold(Default 10ms, enough to send only one short data frame), the token is automatically relinquished upon timeout; this hard limit on token holding time replaces a simple frame quota, because the transmission time of data frames of different lengths varies greatly, and simply limiting the frame count cannot precisely control the token holding time, which is a key parameter affecting the real-time performance of the token ring. Exit condition: M trial There were no timeouts within each token cycle and the token holding time never exceeded T. trial_hold Enter full functionality; if a timeout occurs during this period, revert to the observation period.
[0099] 4. Token Ring Aware Recovery Parameter Adaptation: PRSM maintains a historical fault frequency counter F for each node. history Record the node in the past T history The total number of times isolated within the time window, before entering full functionality, PRSM according to F history Adaptive adjustment of subsequent recovery parameters: If F history ≥F high (Default 3 times / hour): Indicates that the node has a persistent intermittent fault, and the N required for the next observation period will be [number missing]. observe_cycle Increase it to η times the original (η=1.5), and additionally require all key nodes (gateways / routers) in the witness bitmap to be witnessed (because the passage of token frames from key nodes is a necessary condition for the token ring to be healthy); if F history =0: Use the default parameter. Where F high This is the high-frequency fault threshold, representing the upper limit of the number of times a node can be isolated per unit time (hour). The default value is 3 times / hour. Exceeding this threshold indicates that the node has a persistent intermittent fault. The core of this adaptive mechanism is to use the token ring's structural information (node role classification) to differentiate and adjust the recovery threshold, rather than simply uniformly amplifying the parameters.
[0100] 5. Distributed recovery synchronization carried by token frames: When an isolated node migrates from the observation period to the trial period, and from the trial period to full functionality, PRSM writes a recovery notification flag to the Reserved field during the next token pass: it flips the node's bit to 0 and uses a reserved bit to write the RECOVERING flag (this flag is only valid in the next token cycle and is automatically cleared after being read); after the receiving node reads this flag, it reintegrates the recovered node into the token pass sequence in the next token pass; the irreplaceable nature of this mechanism is that the carrier of recovery information is the token frame itself, and the token frame is both a communication right certificate and a network state synchronization channel. This dual role is unique to token passing networks.
[0101] In addition, the state transition condition is: from normal to warning period: N fault >N active / 3 but did not reach the isolation threshold; warning period to normal: N consecutive days observe_warn The probe was successful, N fault Falling back to N active / 3 or less; Warning period to isolation (observation period): Probe timeout C timeout Next and N fault Reaching the isolation threshold; Isolation to observation period: Automatically enters when HBM triggers isolation; Observation period to trial period: N consecutive days. observe_cycle Complete token cycle integrity verification passed; Observation period to observation period (hold): During this period, any CRC error or token frame loss has been witnessed, and bitmap reset has been observed; Trial period to full functionality: M trial There was no timeout during the round, and the token holding time never exceeded T. trial_hold Trial period to observation period: If a timeout or token holding timeout occurs during this period, rollback and reset will be performed. history Add 1; Full functionality to observation period: isolated by HBM again.
[0102] Figure 2 An embodiment of a rapid isolation and self-recovery system for abnormal nodes in an MSTP network according to the present invention is shown.
[0103] In this optional embodiment, the MSTP network abnormal node rapid isolation and self-recovery system includes:
[0104] The timeout judgment module 201 is used to dynamically generate a timeout threshold based on the historical response delay data of the target node, and determine whether the actual response time exceeds the timeout threshold. If not, the historical response delay data is updated and token passing continues; if so, the current response delay data is output.
[0105] The differential processing module 202 is used to calculate the number of consecutive timeouts of the target node based on the current response delay data, and make a judgment based on the network deterioration conditions and consecutive timeout conditions, and execute a differential processing strategy based on the judgment result.
[0106] The isolation trigger module 203 is used to generate a target fault marker based on the execution result of the differentiated processing strategy, start the fault isolation process to calculate the consensus threshold, and trigger the token ring rearrangement operation after the fault isolation meets the consensus threshold, and output the isolation trigger signal.
[0107] The self-recovery module 204 is used to execute a progressive multi-stage self-recovery process based on the token passing characteristics of the isolated node according to the isolation trigger signal, so as to achieve rapid isolation and self-recovery of abnormal nodes.
[0108] It should be added that, such as Figure 4As shown, this invention adds an enhancement layer to the standard BACnetMSTP protocol stack. The overall architecture is divided into four layers from top to bottom, and the data flow and control flow between each layer are as follows:
[0109] 1. Application Layer: This layer runs BACnet application protocols (such as reading and writing attributes, subscribing to COV, etc.) and interacts with the lower layer through the service interface provided by the MSTP state machine. The application layer is unaware of the existence of the enhancement layer, and all enhancement logic is transparent to the upper layer.
[0110] 2. Enhancement Layer of the Invention: This layer is the core of the invention and contains five functional modules that work closely together: The Adaptive Timeout Engine (ATE) is located at the front of the enhancement layer and interacts bidirectionally with the MSTP state machine below it: it receives the timestamps of each token transfer and response from the state machine and outputs the timeout threshold to the state machine; The Joint Timeout-Retry Optimization Model (JOM) is bidirectionally interconnected with the ATE: The ATE provides the JOM with the statistical characteristics of the response latency (mean μ, standard deviation σ), and the JOM feeds back the optimized combination (dynamic timeout value, number of retries) to the ATE; The Distributed Health Bitmap Manager (HBM) connects both the JOM and MSTP. Components: The JOM receives the decision output (no retry / retry exhaustion) as the basis for fault marking, and reads / writes the health bitmap area in the token frame from the state machine; The Hierarchical Role Policy Manager (RSM) receives the isolation output of HBM, adjusts the timeout sensitivity coefficient k and consensus threshold according to the role classification (critical / normal / low priority), and outputs the role differentiation parameters to ATE and HBM respectively; The Progressive Recovery State Machine (PRSM) receives the isolation trigger signal from the RSM, and interacts bidirectionally with the MSTP component: reads the token reception event for stage transition determination, and outputs the current token participation permission (no permission / restricted / full permission) to the state machine.
[0111] 3. Standard MSTP Data Link Layer: This layer consists of the MSTP state machine and its supporting modules defined by the standard BACnet, comprising three components: the MSTP state machine (controlling token passing, frame sending, frame receiving, and other state transitions), the frame transceiver module (responsible for frame assembly and parsing), and the timer management module (managing timers). usage_ timeout, T frame_ (Standard timers such as abort); each module of the enhancement layer is embedded through the interface exposed by the state machine without modifying the internal logic of the state machine; the frame transceiver module interacts with the physical bus through an RS-485 transceiver.
[0112] 4. Physical Layer: The RS-485 transceiver connects all nodes in the network via a twisted-pair shared bus and is responsible for sending and receiving differential signals.
[0113] The main data and control flow between layers is as follows: the application layer sends data requests, the MSTP state machine determines the sending timing based on the current token holding state, the ATE calculates the timeout threshold of the target node and injects it into the state machine before sending, the frame is assembled (including the health bitmap), and the RS-485 transceiver sends differential signals; the receiving direction is reversed: the RS-485 transceiver receives signals, the frame is parsed (extracting the health bitmap), the MSTP state machine processes tokens / data, the ATE records the response delay, the HBM updates the bitmap, and the state machine executes token passing or isolation actions; solid arrows represent data flow (main flow), and dashed arrows represent control flow or parameter flow.
[0114] like Figure 5 As shown, the entire process of this invention is divided into four stages, and the specific steps of each stage are as follows:
[0115] Phase 1, Adaptive Detection:
[0116] Step A-1: After the current token holder is ready, determine the next MAC address (in ascending order) and call ATE to calculate the dynamic timeout threshold T for this target node. dynamic .
[0117] Step A-2: ATE retrieves historical delays from the sliding window and calculates the mean. and standard deviation ,generate Insufficient sample size W min Use T default If it is a critical node (gateway / router / BBMD), multiply k by the relaxation factor α (α>1).
[0118] Step B: The token holder sends a token frame (carrying the current health bitmap) to the target node, initiating T. dynamic A timer is used to wait for a response from the target node.
[0119] Step C: At T dynamic Did a valid response arrive before the timeout? If so (a frame was received), step C-1 proceeds normally, and the interaction is successful. ATE input delay d new EWMA Update Then recalculate σ². The process jumps to the normal token passing follow-up steps (response processing, data sending, etc.), and this round ends. The next round of token passing returns to A-1. If not (no frame received), step C-2 times out, and proceeds to stage two: joint decision-making and marking.
[0120] Phase Two: Joint Decision-Making and Labeling
[0121] Step D: JOM intervenes and makes a decision based on the current network status.
[0122] Step D-1: Early signs of deterioration: If σ² new >γ·σ² old (Continuously increasing variance) is considered a precursor to deterioration; therefore, the timeout threshold ΔT should be increased instead of increasing the number of retries. New parameters (T) are generated. dynamic +ΔT (the number of retries remains unchanged) is fed back to ATE.
[0123] Step D-2 response completely interrupted: If the variance is not abnormal but the number of consecutive timeouts is greater than C timeout If the response is determined to be completely interrupted, priority should be given to reducing the number of retries to accelerate isolation. new =max(0,R otd -1) (may decrease to 0).
[0124] Step D-3 Other cases: Retry according to the standard strategy.
[0125] Step E: Should a retry be performed? If yes (retry required), in step E-1, the token holder retrys sending the token (or sends a PFM probe), while HBM updates the corresponding bit flag in its local bitmap (this is only a local flag and does not trigger isolation). Return to step B and wait again using the parameters adjusted by JOM. If no (no retry or retry exhaustion), in step E-2, i.e., step F: HBM sets the bit in the bitmap corresponding to the MAC address of the target node to 1 (suspected failure) and writes the updated complete bitmap to the Reserved field of the next token frame. This flag will be broadcast to all nodes in the network along with the token, entering phase three: distributed collaborative isolation.
[0126] Phase 3, Distributed Cooperative Isolation:
[0127] Step G: As the token is passed cyclically in MAC address order, each master node receiving the token reads the health bitmap and synchronously updates its observed node status based on the timeout event of its local ATE. Each node independently counts the number N bits in the bitmap that are 1. fault .
[0128] Step H: N fault Does it exceed N? active / 2 (More than half of the nodes are active); If not (less than half), proceed to step H-1, consensus has not yet been reached, continue the normal token passing process. The token is passed to the next active node. Return to Phase 1: Return to A-1. If yes (more than half), proceed to step H-2, RSM confirms the isolation type according to the target node's role: low-priority nodes are isolated immediately; critical nodes need to wait for an additional round of token cycle confirmation. Isolation is triggered after confirmation.
[0129] Step I: HBM instructs the MSTP state machine to perform token ring rearrangement, removing the MAC address of the faulty node from the token passing sequence. The token holder skips the faulty node and passes the token to the nearest normal node after the faulty node, entering Phase 4, gradual recovery.
[0130] Phase Four: Gradual Recovery
[0131] Step J: Simultaneously with the isolation action, PRSM starts, and the isolated node enters the first phase, the observation period. The node passively listens to the RS-485 bus, receives token frames but does not participate in token passing, and does not send any data.
[0132] Step K: The isolated node continuously listens during the observation period. Each time it successfully receives and correctly parses a token frame, the observation counter is incremented by 1. It is then determined whether the number of consecutive correct receptions has reached N. observe (Default 20); If not (not reached), proceed to step K-1, remain in the observation period, and continue listening. If any timeout or CRC error occurs during the listening period, reset the counter to zero and restart counting (to prevent false recovery caused by intermittent failures); return to step K and continue listening. If (reaching N) observe In step K-2, or step L, the isolated node enters the trial period. PRSM notifies the MSTP state machine to re-add the node to the token passing sequence, but imposes a data sending quota limit, allowing a maximum of S data to be sent per token cycle. trial Frame data (default 1 frame). Trial period lasts M. trial Token cycles (default 100).
[0133] Step M: Did a timeout event occur during the trial period? If yes (timeout occurred), in step M-1, PRSM rolls the node state back to the observation period, and the observation counter is reset to zero. Re-enter step J. If no timeout occurred, in step M-2, i.e., step N, the trial period is passed, and the node enters the third stage, i.e., the full-function state. PRSM removes the quota restriction, and the node regains normal token passing permissions (can send any number of data frames). If the node is isolated by HBM again in the full-function state, its state returns to the observation period (step J). The entire process forms a complete closed loop.
[0134] To facilitate understanding of the above technical solutions of the present invention, the following further explains the above technical solutions of the present invention from the perspective of architecture and principle, as follows:
[0135] This invention adds an enhancement layer on top of the standard BACnet MSTP data link layer state machine. This enhancement layer contains five functional modules: Adaptive Timeout Engine (ATE); Joint Timeout-Retry Optimization Model (JOM); Distributed Health Bitmap Manager (HBM); Hierarchical Role Policy Manager (RSM); and Progressive Recovery State Machine (PRSM). These modules work collaboratively to achieve rapid detection, distributed collaborative isolation, and smooth self-recovery of abnormal nodes without changing the standard frame format (using the Reserved field in the frame to carry the health bitmap). The overall architecture is divided into four layers from top to bottom: Application Layer (BACnet application protocol), this invention's enhancement layer, Standard MSTP data link layer (state machine, frame transmission and reception, timer management), and Physical Layer (RS-485 transceiver).
[0136] 1. Adaptive Timeout Engine (ATE): Maintains a sliding window of size W for each adjacent master node, recording the response latency of the most recent W successful interactions; calculates μ and σ online, and generates... Normal processing path (t) response ≤T dynamic ): Record d new Updated in EWMA format Recalculate σ² and continue the normal token passing process. Timeout handling path (t) response >T dynamic ): Trigger a timeout event, setting the current μ, σ², and σ² of the previous window. old Passed to JOM. When there are insufficient samples in the window ( <W min When using T default The critical node k is multiplied by α. ATE obtains the timestamp from the state machine, outputs the statistics to JOM, and notifies HBM of timeout events.
[0137] 2. Joint Optimization Model (JOM) with Timeout and Retry: Define C(T,R) = T·R + λ / T, and execute the decision-making process. Input: The current window variance σ² provided by ATE. new σ² of the previous window old Number of consecutive timeouts C consec Output: Optimized timeout threshold T new and the number of retries R new The threshold for the rate of change of variance is γ=1.5, requiring continuous N... trend =3 windows satisfy the subsequent triggering of deterioration precursors, continuous timeout threshold C timeout =3. Strategy A: T new =T current +ΔT, Strategy B: JOM receives the statistical characteristics output by ATE and feeds back the optimized parameters to ATE and the state machine.
[0138] 3. Distributed Health Bitmap Manager (HBM): Manages a 16-byte (128-bit) health bitmap. Bits [1–127] are mapped to MAC1–127, and bits [0] are reserved. OR logic aggregation is used, and bits already set to 1 are not cleared (only HBM clears them uniformly after isolation or recovery). N active Statistics: Each node maintains a set of active nodes; upon receiving a valid token frame from a MACM, M is added to the active set; if a MAC does not appear in more than 5 token cycles, it is removed from the active set, and N is... active = Size of the currently active set. When N fault Reaching N active If the isolation threshold is not reached (e.g., / 3), a warning period (soft degradation) is triggered; if the isolation threshold is reached, formal isolation is triggered. The HBM receives timeout events from the ATE, achieves distributed sharing through token frames, and outputs isolation decisions to the state machine and RSM.
[0139] 4. Hierarchical Role Policy Manager (RSM): Three-level role classification and corresponding k-values and isolation thresholds. During initialization, the RSM determines the role classification, outputs the classification parameters to ATE (adjust k) and HBM (adjust consensus threshold), and passes the isolation decision to the RSM.
[0140] 5. Progressive Recovery State Machine (PRSM): Manages the multi-stage state transitions of isolated nodes, with each stage bound to a specific MSTP token passing mechanism.
[0141] Probe token warning period: The token holder sends a minimum probe frame (frame header and health bitmap only, 8-12 bytes, excluding token passing rights) to the target node. The target node then... probe (Default 5ms) Reply with ACK; N consecutive times observe_warn The probe was successful, and the warning was lifted; the probe timed out continuously and N fault Upon reaching the threshold, formal isolation is initiated. Token cycle integrity observation period: Nodes maintain a 128-bit witnessed bitmap, setting bit[M] to 1 upon receiving a token frame from MACM; when all N... active Each active node being witnessed constitutes one complete cycle; N consecutive cycles... observe_cycle The entire cycle (default 3) passes until the trial period, and any errors reset the bitmap. Token sequence end quota trial period: Nodes inserted at the very end of the token sequence (after the maximum active MAC) have a hard limit of T tokens held each time. trial_hold (Default 10ms), duration M trial The round has no timeout and no holding timeout has expired, allowing full functionality to be restored (normal permissions are restored). Token ring-aware parameter adaptive: Before entering full functionality, if F... history ≥F high N observe_cycle and Mtrial Multiply by η, and additionally require all critical nodes to be witnessed. Token frames carry recovery synchronization: During phase migration, the RECOVERING flag is written to the Reserved field (valid for one round), and the dual role of token frames is used to complete the full network recovery synchronization.
[0142] The PRSM receives the isolation / early warning trigger signal from the RSM and notifies the state machine of the state transition. Key technical parameters are shown in Table 1, and all parameters are configurable preset values. Furthermore, the enhancement mechanisms all run on top of the standard BACnet MSTP data link layer state machine, utilizing the Reserved field in the standard frame format to carry the health bitmap and recovery notification flags, ensuring transparent compatibility with traditional nodes that do not support enhancements.
[0143] Table 1. Example of Key Technical Parameters
[0144] Scenario Description: A building automation system uses a BACnetMSTP bus to connect 48 master nodes (including 2 gateways, 12 DDC controllers, and 34 end-point sensor controllers). The bus length is approximately 800 meters, and the communication baud rate is 38400bps. Fault Simulation: Node 15 (end-point sensor controller) is simulated to experience intermittent faults, alternating between 30 seconds of normal operation and 10 seconds of silence. Comparative Example (Standard Scheme): T usage_timeout =40ms, N retry_token =1, each failure requires an 80ms timeout and retry, PFM recovery takes approximately 120–150ms, with an oscillation occurring every 40 seconds under a 30 / 10 second cycle, resulting in a throughput decrease of approximately 25%. The proposed solution: W=50, k=3.0, β=0.1, C timeout =3, N trend =3, γ=1.5, N observe =20, M trial =100, F high =3, η=1.5. During normal operation, ATE establishes stable statistics (μ≈12ms, σ≈3ms), T dynamic ≈21ms. First failure: C consec After accumulating to 3, strategy B is triggered, R. new =0, skip retries and mark directly. After one round of token circulation (about 0.8 seconds), more than 24 nodes mark bit
[15] =1, HBM triggers isolation. Node 15 enters the observation period, trial period, and full function period, due to F history =1 (<3), restore parameters using default values. If frequent failures continue, F history After accumulating ≥3, N observe Automatically adjusted to 30, M trialThe value was adjusted to 150, enabling more stringent recovery verification for frequently failing nodes. Technical results: Network throughput fluctuations were reduced by approximately 80% (throughput decrease from 25% to 5%), the initial isolation time was shortened from approximately 120–150 ms to approximately 0.8 seconds, and post-isolation recovery was stable and oscillating-free.
[0145] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores static and dynamic information data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the above method embodiments.
[0146] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0147] In addition, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0148] In addition, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0149] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0150] This invention is not limited to the structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this invention is limited only by the appended claims.
Claims
1. A method for rapid isolation and self-recovery of abnormal nodes in an MSTP network, characterized in that, The method includes: Based on the historical response latency data of the target node, a timeout threshold is dynamically generated, and it is determined whether the actual response time exceeds the timeout threshold. If not, the historical response latency data is updated and token passing continues; if so, the current response latency data is output. Based on the current response delay data, calculate the number of consecutive timeouts of the target node, and make a judgment based on the network deterioration conditions and consecutive timeout conditions, and execute a differentiated processing strategy based on the judgment results; Based on the execution results of the differentiated processing strategy, a target fault marker is generated, the fault isolation process is initiated to calculate the consensus threshold, and the token ring rearrangement operation is triggered after the fault isolation meets the consensus threshold, and the isolation trigger signal is output. Based on the isolation trigger signal, the isolated node executes a progressive multi-stage self-recovery process based on the token passing feature to achieve rapid isolation and self-recovery of abnormal nodes.
2. The method for rapid isolation and self-recovery of abnormal nodes in an MSTP network according to claim 1, characterized in that, The process involves dynamically generating a timeout threshold based on the target node's historical response delay data, determining whether the actual response time exceeds the timeout threshold, and if not, updating the historical response delay data and continuing to execute the token transfer. If so, the current response latency data will be output, including: Maintain a sliding window of a preset size for each target node and record historical response latency data to calculate the mean and standard deviation of response latency; Based on the mean and standard deviation of response delay, combined with the sensitivity coefficient, preset timeout upper limit and preset timeout lower limit, the timeout threshold is dynamically generated. Collect the actual response time of the target node and compare the actual response time with the timeout threshold; If the actual response time does not exceed the timeout threshold, record the current actual response time, update the historical response latency data using the exponentially weighted moving average technique, and continue to execute the token passing; if the actual response time exceeds the timeout threshold, output the current response latency data. The expression for the timeout threshold is: ; In the formula, Indicates the timeout threshold; Indicates the lower limit of timeout; Indicates the timeout limit; This represents the average response delay; Indicates the sensitivity coefficient; This represents the standard deviation of the response delay.
3. The method for rapid isolation and self-recovery of abnormal nodes in an MSTP network according to claim 1, characterized in that, Based on the network degradation conditions, the network degradation determination process includes: Based on the current response delay data, obtain the response delay variance of the current sliding window and the response delay variance of the previous sliding window, and determine whether a single sliding window meets the network degradation condition. If a single sliding window satisfies the network degradation condition, and a preset number of consecutive sliding windows all satisfy the network degradation condition, then the network is determined to be degraded. If a single sliding window does not meet the network degradation condition, or if a preset number of consecutive sliding windows do not all meet the network degradation condition, it is determined that no network degradation has occurred, and a continuous timeout judgment is executed. The expression for the network degradation condition is as follows: ; In the formula, This represents the variance of the response delay of the current sliding window; Indicates the trend threshold; This represents the variance of the response delay of the previous sliding window.
4. The method for rapid isolation and self-recovery of abnormal nodes in an MSTP network according to claim 3, characterized in that, The differential processing strategy based on the determination result includes: When network degradation is detected, the timeout increment is calculated and combined with the preset joint cost function to determine the priority to increase the timeout threshold while keeping the current number of retries unchanged. When the network is not determined to be deteriorating but the continuous timeout condition is met, the number of retries is reduced first. If the number of retries after reduction is lower than the preset threshold, the retry process is skipped. If the number of retries after reduction is greater than the preset threshold, the number of retries after reduction is used as the new number of retries, the current timeout threshold is maintained, and the retry process is executed. If the network is not determined to be deteriorated and the continuous timeout condition is not met, the current timeout threshold and number of retries remain unchanged, and the retry process is executed.
5. The method for rapid isolation and self-recovery of abnormal nodes in an MSTP network according to claim 4, characterized in that, The retry process includes: The token holder resends the token frame to the target node and waits for the target node's response within the current timeout threshold; If a valid response is received from the target node within the waiting time, the historical response delay data is updated, the consecutive timeout count of the target node is reset, and token passing continues. If no valid response is received from the target node within the waiting time, the consecutive timeout count of the target node will be accumulated, and the network degradation judgment and consecutive timeout judgment will be re-executed. Based on the judgment result, a differentiated strategy will be implemented.
6. The method for rapid isolation and self-recovery of abnormal nodes in an MSTP network according to claim 1, characterized in that, The process of initiating fault isolation to calculate the consensus threshold includes: Add the media access control address corresponding to the target fault node to the preset target fault list, and generate a fault bitmap based on the addition result; Using the preset local node as the token holder, read the bitmap carried in the current token frame, and perform a bitwise OR operation with the fault bitmap to obtain the initial updated bitmap; The initial updated bitmap is passed to the next node, and a bitwise OR operation is performed with the target fault list to obtain the secondary updated bitmap; The number of target faulty nodes and currently active nodes in the second-update bitmap is counted, and the consensus threshold for the corresponding target node is generated based on the statistical results.
7. The method for rapid isolation and self-recovery of abnormal nodes in an MSTP network according to claim 6, characterized in that, The consensus threshold includes: the first node, the second node, and the third node; The number of active nodes that is greater than two-thirds of the number of target faulty nodes is taken as the first node; The number of active nodes that is greater than half the number of target faulty nodes is used as the second node; The number of active nodes that is more than one-third of the target faulty nodes is used as the third node.
8. The method for rapid isolation and self-recovery of abnormal nodes in an MSTP network according to claim 1, characterized in that, The progressive multi-stage self-recovery process is divided into four stages in order of increasing intrusion into the token ring: warning period, observation period, trial period, and full-function state. During the warning period, the token holder verifies the communication capability of the isolated node with the minimum probe frame and determines whether the probe times out continuously. If so, and the preset isolation threshold is reached, the node enters the observation period; otherwise, the warning is lifted and the isolated node resumes its communication state. During the observation period, the receiving capability of the isolated nodes and the health status of the global token ring are verified through token cycle integrity. After witnessing all active nodes and the completion of the preset number of full token cycles, the trial period begins. During the trial period, the isolated node is inserted at the end of the token sequence, and the maximum time for holding the token each time is limited. It is determined whether a timeout occurs within a preset number of token cycles. If not, it enters the full-function state and completes the self-recovery process. If so, then revert to the observation period.
9. The method for rapid isolation and self-recovery of abnormal nodes in an MSTP network according to claim 8, characterized in that, Before entering full-function state, the recovery parameters are adaptively adjusted according to the historical failure frequency of the isolated node, and during the phase migration, a single round of recovery notification flag is written through the token frame retention field to update the token passing sequence and complete the self-recovery process.
10. A rapid isolation and self-recovery system for abnormal nodes in an MSTP network, characterized in that, The system includes: The timeout determination module is used to dynamically generate a timeout threshold based on the historical response delay data of the target node, and determine whether the actual response time exceeds the timeout threshold. If not, the historical response delay data is updated and token passing continues; if so, the current response delay data is output. The differential processing module is used to calculate the number of consecutive timeouts of the target node based on the current response latency data, and to make a judgment based on the network deterioration conditions and consecutive timeout conditions, and to execute a differential processing strategy based on the judgment results. The isolation trigger module is used to generate target fault markers based on the execution results of the differentiated processing strategy, start the fault isolation process, calculate the consensus threshold, and trigger the token ring rearrangement operation after the fault isolation meets the consensus threshold, and output the isolation trigger signal. The self-recovery module is used to execute a progressive, multi-stage self-recovery process based on token passing characteristics of the isolated node according to the isolation trigger signal, so as to achieve rapid isolation and self-recovery of abnormal nodes.