Multi-ring state sensing communication network optimization method
By logically dividing the CAN bus into multiple ring-shaped state sensing networks and combining token passing and heartbeat timeout mechanisms, the message conflict problem of the CAN bus is solved, achieving deterministic communication and high reliability, which is suitable for industrial control scenarios such as fire alarms.
Patent Information
- Application Number
- CN202511775846.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-06
AI Technical Summary
In industrial control systems, the existing CAN bus suffers from message collisions due to the Carrier Sense Multiple Access/Collision Detection (CSMA/CD) mechanism, leading to communication uncertainty and insufficient reliability, especially in fire alarm systems where it may cause alarm message delays. The existing combination of token ring networks and CAN bus solutions increases system complexity and cost.
A multi-ring state-aware communication network optimization method is adopted. By logically dividing a single physical bus into multiple data transmission rings and initializing a ring frame for each ring, combined with a token passing mechanism and a heartbeat timeout mechanism, deterministic communication and dynamic ring reconstruction between nodes are achieved.
While retaining the simplicity and low cost of CAN bus wiring, it introduces the deterministic latency characteristics of token ring networks to avoid message collisions, improve the real-time performance and reliability of communication, and has strong dynamic adaptability and self-healing capabilities, making it suitable for industrial control scenarios with stringent performance requirements.
Smart Images

Figure CN121619218A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial network communication, specifically a multi-ring state-aware communication network optimization method. Background Technology
[0002] The CAN bus is widely used in industrial control due to its high reliability and error detection capabilities. However, its inherent Carrier Sense Multiple Access / Collision Detection (CSMA / CD) mechanism has inherent flaws: when multiple network nodes attempt to send data simultaneously, message collisions are inevitable. After a collision, low-priority messages must back off and wait, potentially experiencing unpredictable long delays. In fire alarm systems, this communication uncertainty is fatal, potentially causing delayed alarm information delivery and missing the optimal response time. To overcome this flaw, existing technologies attempt to introduce the deterministic delay characteristics of token ring networks into the CAN bus. The token passing mechanism fundamentally avoids collisions by allowing nodes to take turns speaking. However, existing solutions often employ a dual-bus redundancy design to implement the physical path of the token ring, which significantly increases the system's hardware complexity, wiring costs, and maintenance difficulty. Summary of the Invention
[0003] This application provides a multi-ring state-aware communication network optimization method, which solves the technical problems of communication uncertainty and insufficient system reliability caused by message conflicts in the prior art.
[0004] To achieve the above objectives, this application adopts the following technical solution: Firstly, a multi-ring state-aware communication network optimization method is provided, applied to a single controller area network (CAN bus) network, including: When the communication system is initialized, the centralized management node on a single physical bus logically divides multiple nodes into multiple data transmission rings, and initializes a ring frame for each transmission ring to control sending permissions. Each node passes a token based on the ring frame. When a node in the ring obtains the token of its own ring, it gains bus transmission permission and constructs a data frame containing the address of the target node to send to the bus for data communication between nodes. Each node continuously monitors the communication status of its neighboring nodes and the transmission ring through a heartbeat mechanism and a ring frame timeout mechanism. When a node failure, node addition, or loss of connection of the centralized management node is detected, the data ring reconstruction process is automatically triggered to update the token transmission path.
[0005] Based on the above technical solutions, the multi-ring state-aware communication network optimization method provided in this application, through a single-bus multi-logic-ring architecture design, retains the advantages of simple wiring and low cost of the CAN bus while introducing the deterministic latency characteristics of the token ring network, fundamentally avoiding message collisions and significantly improving the real-time performance and reliability of communication. This method possesses significant dynamic adaptability; through continuous state awareness and an automated ring reconstruction mechanism, it can achieve rapid self-healing in the event of node failures or network topology changes, ensuring high system availability.
[0006] Furthermore, the ring frame is a custom frame structure, which extends the standard CAN data frame with a ring frame type field for distinguishing frame types, a target node ID field for indicating the direction of token transmission, an origin node ID field for indicating the sending node, a token status field for indicating the token occupancy status, a communication priority field for defining message priority, a data length field for indicating the data length, a main data field for carrying the transmitted data, and a cyclic redundancy check field for error detection.
[0007] Furthermore, once a node obtains the bus transmission permission, it determines whether to send data immediately using a communication priority decision algorithm: When a node's communication priority is higher than a preset threshold, data is sent immediately; otherwise, the data is temporarily held and the token is passed to the next node, while the message waiting time is accumulated. The communication priority decision algorithm is calculated based on multiple factors, including the message's preset priority, the node's current load, the message's waiting time, and the number of hops in the transmission path.
[0008] Furthermore, the formula for calculating the communication priority P is: ;in, Preset priority for messages, This represents the length of the message queue to be sent at the current node. This represents the maximum capacity of the node's message queue. The time a message has been waiting in the queue. Let denot be the number of hops from the source node to the target node within the data transmission ring, α, β, γ, and δ be the weight coefficients of each term, and their sum is 1, and λ be the attenuation coefficient.
[0009] Furthermore, the data communication between the nodes includes: After receiving the ring frame, the current node parses the token status field of the ring frame; When the token status field is idle and the current node has data to be sent, the token status field of the current node is modified to busy, the data to be sent is filled into the main data field, the communication priority field is updated, and then the ring frame is sent to the bus; otherwise, the current node directly passes the ring frame to the next node indicated by the target node ID field.
[0010] Furthermore, the aforementioned heartbeat mechanism refers to: Each node periodically broadcasts a heartbeat message containing its own representation to the bus, and adjacent nodes determine their working status by listening to the continuity of the heartbeat messages; Furthermore, the circular frame timeout mechanism refers to: After a node sends a ring frame, it starts a timer. If no expected activity is detected on the bus within the predetermined timeout period, the ring frame transmission path is determined to be abnormal.
[0011] Furthermore, each node continuously monitors the communication status of neighboring nodes and the transmission ring through a heartbeat mechanism and a ring frame timeout mechanism, including: Each node periodically broadcasts a heartbeat message containing its own ID to the bus; Each node listens to the heartbeat messages of its neighboring nodes within its data transmission ring. If it does not receive a heartbeat message from a neighboring node for several consecutive cycles, it determines that the neighboring node is faulty or out of contact. After each node passes the ring frame to the next node, it starts a timer. If no valid activity from the next node is detected on the bus within a preset time, it is determined that there is a fault in the transmission path of the ring frame. The valid activity includes, but is not limited to, sending data or sending heartbeat messages.
[0012] Furthermore, when the node failure is a centralized management node failure, the surviving nodes elect a new centralized management node according to preset rules. The new centralized management node inherits the ring management function of the original node; wherein, The preset rule is as follows: among the surviving nodes, the node with the smallest node ID and stable online status is preferentially elected as the new centralized management node. The stable online status means that within the preset continuous monitoring period, the node's heartbeat message reception success rate reaches a first predetermined threshold, and the node's response success rate to the centralized management node's query command reaches a second predetermined threshold.
[0013] Furthermore, when the node failure is a non-centralized node failure, the upstream node of the failed node modifies the target node ID in the data transmission ring and passes the token to the downstream node of the failed node, thereby achieving self-healing reconstruction of the ring.
[0014] Furthermore, the data ring reconstruction process includes: The reconstruction process is initiated by the fault detection node or the newly joined node. The fault detection node sends a reconstruction request to the centralized management node, and the newly joined node sends a reconstruction request to other nodes in the data transmission ring. The node that receives the reconstruction request participates in the reconstruction negotiation, and the negotiation content includes at least the node sequence of the new data transmission ring; Based on the negotiation results, the centralized management node or a new centralized management node generates a new ring frame and updates the target node ID field in the ring frame; The new ring frame is distributed to restore the logical path for data transmission.
[0015] Furthermore, there are multiple data transmission rings, and each data transmission ring operates independently and is managed uniformly by the centralized management node; the centralized management node realizes global communication scheduling and fault recovery of the entire network by maintaining the node sequence information of each ring.
[0016] Secondly, a multi-ring state-aware communication network optimization device is provided, comprising: a communication unit and a processing unit; The communication unit is used to send and receive data on a single controller area network bus, including broadcasting heartbeat messages, monitoring the activity of adjacent nodes, and receiving and forwarding ring frames and cross-ring tokens. The processing unit is used to construct and initialize the logical ring, arbitrate cross-ring communication requests according to preset rules, monitor the network status to detect node failures or additions, and trigger and execute the dynamic reconstruction process of the data ring when an anomaly is detected.
[0017] Thirdly, this application provides a multi-ring state-aware communication network optimization device, comprising: a processor and a storage medium; the storage medium includes instructions, and the processor is configured to execute the instructions to implement the method described in the first aspect and any possible implementation thereof. This communication network optimization device may be an electronic device or a chip within an electronic device.
[0018] Fourthly, this application provides a multi-ring state-aware communication network optimization system, including: a ring management module, a communication scheduling module, and a fault-tolerant reconfiguration module; wherein, The ring management module is used to logically divide the data transmission ring and initialize the ring frame by the centralized management node when the system starts up; The communication scheduling module is used to control the transmission of ring frames within the ring and to process the capture and release of tokens by nodes. The fault-tolerant reconstruction module is used to continuously monitor network health through heartbeat and timeout mechanisms, and automatically triggers ring reconstruction to update the token transmission path when a node or path failure is detected.
[0019] Compared with the prior art, the beneficial effects of this application are: This invention provides a solid foundation for precise token passing, state awareness, and multi-priority scheduling by designing a custom ring frame with rich management fields. Based on this ring frame, nodes use a token passing mechanism for deterministic communication within the ring, completely avoiding message collisions common in traditional CAN buses. Simultaneously, a dynamic weighting algorithm is used for communication priority scheduling. This algorithm comprehensively considers multiple factors such as message urgency, node load, waiting time, and transmission distance, achieving intelligent allocation of network bandwidth. This ensures low-latency transmission for high-priority services while effectively preventing the "starvation" of low-priority services, significantly improving network efficiency and fairness. Furthermore, through a dual monitoring mechanism of heartbeat messages and ring frame timeouts, the system can perceive the status of nodes and network paths in real time and accurately. Upon detecting a fault, whether it's a non-centralized node failure or a central management node loss of connection, it triggers a rapid and automatic ring reconstruction and master node election process, ensuring the system possesses strong fault tolerance, self-healing capabilities, and high availability.
[0020] This application ingeniously integrates the determinism of token ring networks, the flexibility of CSMA / CA mechanisms, and the coordination of centralized management on a single physical bus, forming a hybrid network communication method that combines high real-time performance, high reliability, strong dynamic adaptability, and excellent flexibility, making it particularly suitable for industrial control scenarios with stringent performance requirements. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A system architecture diagram of a multi-ring state-aware communication network optimization system provided in this application embodiment; Figure 2 A flowchart illustrating a multi-ring state-aware communication network optimization method provided in this application embodiment; Figure 3 A flowchart illustrating another multi-ring state-aware communication network optimization method provided in this application embodiment; Figure 4 A flowchart illustrating another multi-ring state-aware communication network optimization method provided in this application embodiment; Figure 5 This is a schematic diagram of the communication network optimization device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the hardware structure of the communication network optimization device provided in the embodiments of this application. Detailed Implementation
[0023] Controller Area Network (CAN) bus is a commonly used serial communication protocol in the fire alarm industry. It boasts advantages such as high reliability, real-time performance, and error detection capabilities. However, traditional CAN buses employ a Carrier Sense Multiple Access / Collision Detection (CSMA / CD) mechanism. When multiple nodes attempt to send data simultaneously, message collisions may occur, causing low-priority messages to experience significant delays. For fire alarm control panels, this often results in the alarm information not being delivered in a timely manner, which is often fatal.
[0024] Token ring networks employ a token passing mechanism, avoiding data collisions and exhibiting deterministic latency. While there have been attempts to apply the token ring mechanism to the CAN bus in existing technologies, most employ a dual-bus redundancy design, which undoubtedly increases system complexity and cost.
[0025] This application aims to provide a multi-ring state-aware communication network optimization method to address problems such as communication uncertainty, weak fault recovery capability, and poor dynamic adaptability in existing technologies. This system significantly improves the determinism, reliability, and flexibility of the bus network through an innovative ring management method, making it particularly suitable for applications with high reliability requirements.
[0026] The multi-ring state-aware communication network optimization method provided in this application embodiment can be applied to, for example... Figure 1 In a multi-ring state-aware communication network optimization system shown, such as Figure 1 As shown, the communication system includes: a ring management module, a communication scheduling module, and a fault-tolerant reconfiguration module; wherein, The ring management module is used to logically divide the data transmission ring and initialize the ring frame by the centralized management node when the system starts up; The communication scheduling module is used to control the transmission of ring frames within the ring and to handle the capture and release of tokens by nodes. The fault-tolerant refactoring module is used to continuously monitor network health through heartbeat and timeout mechanisms, and automatically triggers ring refactoring to update the token passing path when a node or path failure is detected.
[0027] To address the problems in existing CAN bus technologies, such as message collisions due to Carrier Sense Multiple Access / Collision Detection (CSMA / CD) mechanism leading to unpredictable delays and high communication uncertainty for low-priority messages, and the fact that existing schemes combining token ring mechanisms with CAN bus often employ dual-bus redundancy designs, significantly increasing system hardware complexity, wiring costs, and maintenance difficulty, while also exhibiting weak network fault recovery capabilities and poor dynamic adaptability, this application provides a multi-ring state-aware communication network optimization method. This method includes: When the communication system is initialized, the centralized management node on a single physical bus logically divides multiple nodes into multiple data transmission rings, and initializes a ring frame for each transmission ring to control sending permissions. Each node passes a token based on a ring frame. When a node in the ring obtains the token for its own ring, it gains bus transmission privileges and constructs a data frame containing the address of the target node to send to the bus for data communication between nodes. Each node continuously monitors the communication status of its neighboring nodes and the transmission ring through a heartbeat mechanism and a ring frame timeout mechanism. When a node failure, node addition, or loss of connection of a centralized management node is detected, the data ring reconstruction process is automatically triggered to update the token transmission path.
[0028] Based on the above technical solutions, this application provides a multi-ring state-aware communication network optimization method. First, through a fusion architecture of a single bus and multiple logical rings, it retains the advantages of traditional CAN bus—simple wiring, low hardware cost, and convenient maintenance—while introducing the deterministic latency characteristics of token ring networks. This eliminates message conflicts at the source, ensuring low-latency transmission of high-priority services and solving the problem of communication uncertainty. Second, through a custom ring frame multi-priority scheduling design, it comprehensively considers factors such as message urgency, node load, waiting time, and transmission distance. While ensuring priority transmission of high-priority messages, it effectively avoids starvation of low-priority messages, achieving intelligent allocation of network bandwidth and improving communication efficiency and fairness. Third, relying on the dual monitoring of the heartbeat mechanism and the ring frame timeout mechanism, the system can perceive the status of adjacent nodes and the smoothness of the transmission ring path in real time and accurately. Once a node failure, the addition of a new node, or the loss of connection of the centralized management node is detected, the data ring reconstruction and master node election process can be automatically triggered, the token transmission path can be quickly updated, and network self-healing can be achieved, greatly enhancing the system's fault tolerance and dynamic adaptability. Finally, the overall solution does not require an additional physical bus, and while controlling costs, it also ensures high real-time performance, high reliability and strong flexibility, making it particularly suitable for scenarios with stringent requirements for communication stability and response speed, such as fire alarms and industrial control.
[0029] In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 3 As shown, the above-mentioned "dividing multiple nodes into multiple data transmission rings and initializing a ring frame for controlling sending permissions for each transmission ring" can be specifically implemented through the following S101, S102, and S103, which are explained in detail below: S101. The node powers on and sends a heartbeat message to declare its online status.
[0030] Among them, nodes are terminal devices in the communication network, such as the area unit node and centralized management node of the fire alarm controller. After powering on, they need to actively broadcast heartbeat messages to the bus to inform other nodes in the network of their online status and basic information.
[0031] In some implementations, the heartbeat message needs to include the node ID, which is a unique identifier for the node, and may also include the node's current initial load status, such as the initial value of the message queue length to be sent. The node sends heartbeat messages at a preset fixed interval, such as once per second, to ensure that neighboring nodes and the centralized management node can stably capture the messages.
[0032] It should be noted that the continuity of heartbeat messages is the core basis for the centralized management node to determine whether a node is online normally. Nodes that fail to send heartbeat messages on schedule will not participate in the subsequent data transmission ring division.
[0033] For example, suppose there are 10 regional nodes (node IDs 1-10) and 1 central management node (node ID 0). After all nodes are powered on, they broadcast a heartbeat message "node ID: X, load: 0" to the CAN bus every second. After 3 cycles, the central management node confirms that all nodes with IDs 0-10 are online normally.
[0034] S102. The centralized management node collects node information and divides multiple data transmission rings according to preset rules and logic.
[0035] The centralized management node listens to the heartbeat messages broadcast on the bus, summarizes the IDs and initial loads of all online nodes, and then groups the nodes according to preset rules, with each group forming an independently operating data transmission ring.
[0036] In some implementations, the partitioning rules can be formulated by combining one or more of the following: node ID order, node load capacity, and service type requirements. For example, partitioning can be done by consecutive segments based on node ID, or by grouping nodes according to their preset service priorities, i.e., high-priority service nodes are grouped into the same ring. At the same time, it is necessary to ensure that the number of nodes in each data transmission ring is relatively balanced to avoid transmission delays caused by too many nodes in a single ring.
[0037] It should be noted that the data transmission ring is a logical-level group, and all rings share a single physical CAN bus, eliminating the need for additional hardware wiring and balancing wiring simplicity with communication efficiency.
[0038] For example, after the centralized management node collects the online information of nodes ID1-10, it divides the data into two rings according to the rule of "every 5 nodes form a ring": nodes 1-5 form data transmission ring 1, and nodes 6-10 form data transmission ring 2. The two rings operate independently, and the node sequence information of each ring is uniformly managed by the centralized management node.
[0039] S103. The centralized management node initializes a ring frame for each data transmission ring and clarifies the sending permission control rules.
[0040] Among them, the ring frame is a custom frame structure, which is extended from the standard CAN data frame. It is used to control the sending permissions of nodes within the ring. During initialization, a unique ring frame needs to be allocated to each data transmission ring, and the initial values of each field need to be assigned.
[0041] In some implementations, the field settings for the circular frame need to include the following core information, with the length and initial value of each field as follows: Ring frame type (4 bits): Initially set to a data token, identifying that the ring frame is used for data transmission; Target Node ID (8 bits): Initially set to the ID of the first node in the corresponding data transmission ring. For example, in the above example, the initial target node ID for ring 1 is 1, and for ring 2 it is 6. Source Node ID (8 bits): Initially set to the ID of the centralized management node, such as 0 in the example above; Token status (2 bits): Initially set to idle, indicating that no node currently holds the sending permission; Communication priority (3 bits): Initially set to 0, the default base priority, and subsequently dynamically updated by the node according to business requirements; Data length (8 bits): Initially set to 0, indicating no initial data transmission; Master data (0-256 bits): Initially empty, indicating no initial content to be transmitted; Cyclic Redundancy Check (CRC) field (16 bits): Initially calculated according to the standard CRC algorithm, a checksum is generated based on the content of the above field for subsequent error detection.
[0042] It should be noted that the field extensions of the ring frame must be compatible with the CAN bus transmission specifications and must not exceed the length limit of the standard CAN frame. At the same time, the initial settings of each field must provide a basis for subsequent token passing and data communication. For example, a token in the "idle" state can be captured by nodes in the ring to obtain sending permission.
[0043] For example, for data transmission ring 1 (nodes 1-5), the ring frame fields initialized by the centralized management node are: ring frame type = 0001 (data token), target node ID = 00000001 (node 1), source node ID = 00000000 (centralized machine), token status = 00 (idle), communication priority = 000, data length = 00000000, main data = empty, CRC checksum = 0x1234 (calculated based on the first 7 fields); the ring frame initialization logic of data transmission ring 2 is the same as that of ring 1, except that the target node ID is initially set to 00000110 (node 6).
[0044] Based on the above technical solution, the logical division of the data transmission ring and the initialization of the ring frame are completed through steps S101-S103. This retains the advantages of simple wiring and low cost of a single CAN bus, while laying the foundation for the subsequent token passing mechanism through logical grouping. The initialized ring frame has a clear permission control field, which enables nodes within the ring to compete for sending permissions in an orderly manner, avoiding message conflicts at the source. At the same time, the design of multiple rings operating independently improves the network's parallel transmission capability.
[0045] In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 4 As shown, the above-mentioned "each node passes a token based on a ring frame. When a node in the ring obtains the token of its own ring, it gains bus transmission permission and constructs a data frame containing the address of the target node to send to the bus for data communication between nodes" can be specifically implemented through the following steps S201, S202, and S203, which are explained in detail below: S201. The ring frame is transmitted sequentially within the data transmission ring, and the node receives and parses the key fields of the ring frame.
[0046] The transmission of the ring frame follows the "target node ID guidance" principle. That is, after each node completes its own processing of the ring frame, it needs to forward it to the next node indicated by the "target node ID field" in the ring frame. After receiving the ring frame, the node first performs legality verification and field parsing to confirm whether it is the target node of the current frame and to determine the token status.
[0047] In some implementations, the operation process of a node after receiving a circular frame includes: CRC check: First, the cyclic redundancy check field of the circular frame is checked. If the check fails (e.g., the field content does not match the calculation result), the frame is determined to be corrupted, discarded directly, and a local retransmission request is triggered to report the frame error to the source node. Target node matching: After the verification is passed, the "target node ID" of the circular frame is compared with its own node ID. Subsequent field parsing is only performed if the two match. If they do not match, the frame is forwarded directly according to the target node ID. Field extraction: Parse the "Token Status Field" (Idle / Busy / Faulty), "Source Node ID Field" (previous sending node), and "Communication Priority Field" (current frame priority) to prepare for subsequent permission judgment.
[0048] It should be noted that the transmission of ring frames is a closed-loop flow within a single ring, meaning that ring frames in the same data transmission ring are only transmitted between nodes within that ring and will not be forwarded across rings, thus avoiding communication conflicts between different rings; at the same time, the forwarding operation must be completed within a preset time to prevent transmission delays caused by frame backlog.
[0049] For example, taking data transmission ring 1 as an example: after the centralized management node initializes the ring frame, it sets the "target node ID" to node 1, and the ring frame is sent to node 1 first; after receiving it, if the CRC check passes and the target ID matches itself, node 1 parses out "token status = idle", and then enters the permission judgment stage.
[0050] S202. The node determines whether to obtain bus transmission permission based on the token status and communication priority.
[0051] The core conditions for a node to obtain sending permission are that "the token is in an idle state" and "it has data to be sent". At the same time, it is necessary to use a communication priority algorithm to determine whether to send immediately, so as to avoid low-priority data occupying the bus for a long time.
[0052] In some implementations, the specific operations of step S202 include: First, check the token status. If the "token status" of the ring frame is "busy", or the node has no data to send, then directly update the "target node ID" to the next node and forward the ring frame; If the sending prerequisites are met, the priority must be calculated using a formula to determine whether to send immediately. The formula is as follows: The meanings of each parameter are as follows: The message has a preset priority, with a value range of 0-1. For example, a fire alarm message is set to 1, and a normal status query is set to 0.3, reflecting the urgency of the message itself. : The current length of the message queue to be sent by the node. Maximum queue capacity It reflects the node load status; the lower the load, the higher the weight, to avoid node overload. Message waiting time (in seconds), λ is the decay coefficient, usually set to 0.5. This reflects the message status as the longer the wait time, the higher the priority, preventing low-priority messages from "starving". The number of hops from the source node to the target node. The fewer the hops, the higher the weight, thus reducing the accumulated latency of long-path transmission. α, β, γ, δ: Weight coefficients for each item, summing to 1. For example, in an industrial scenario, α=0.4, β=0.2, γ=0.3, and δ=0.1 are used to balance the influence of each factor on the priority. If the calculated value P is higher than a preset threshold (e.g., 0.6), the node obtains sending permission and changes the token status to "busy"; if P is lower than the threshold, the data is temporarily stored and accumulated. It then forwards the circular frame to the next node.
[0053] It should be noted that the weighting coefficients and thresholds need to be adjusted according to the actual scenario; for example, the weighting coefficients and thresholds for fire alarm systems need to be increased. The weight α; at the same time, priority calculation must be completed within 1ms to avoid affecting the real-time performance of the bus.
[0054] For example, suppose node 1 has one fire alarm message, then =1, current
[0055] , , , 2. The target node is node 3, with weights α=0.4, β=0.2, γ=0.3, δ=0.1, and λ=0.5. The priority calculation process is as follows: First term: 0.4 × 1 = 0.4; The second term: 0.2 × (1 - 10 / 100) = 0.18; The third term: 0.3 × e^(-0.5 × 0.5) = 0.3 × 0.7788 ≈ 0.2336; Fourth item: 0.1 × 2 = 0.2; The total priority P≈0.4+0.18+0.2336+0.2=1.0136, which is higher than the threshold of 0.6, so node 1 obtains the right to send.
[0056] S203. The node constructs a data frame containing the target node address, sends it to the bus, processes the response, and releases the token.
[0057] The node that obtains sending permission needs to integrate the data to be sent with the target node address into a ring frame, send it to the bus, wait for the target node's response, and release the token after confirming successful transmission, thus changing the state back to "idle" to ensure communication reliability.
[0058] In some implementations, step S203 specifically includes the following operations: First, the node fills the data to be sent into the "Main Data Field" of the circular frame, and explicitly marks the target node address in the header of the "Main Data Field" or the "Target Node ID Field" (with supplementary extension bits); at the same time, it updates the "Source Node ID Field" to its own ID and the "Data Length Field" to the number of bytes of data to be sent. The updated ring frame is sent to the CAN bus, and an acknowledgment timer is started at the same time. After the target node receives the ring frame, it verifies that the target address is consistent with its own ID, copies the contents of the "master data field", and then constructs an "acknowledgment frame" (containing the source node ID and acknowledgment identifier) and sends it to the bus. If the sending node receives an acknowledgment frame before the timer expires, it confirms that the data transmission was successful, changes the "token status" of the ring frame back to "idle", updates the "target node ID" to the next node, and forwards the ring frame to node 2. If no acknowledgment is received, it retransmits twice. If it still fails, it triggers a fault alarm process.
[0059] It should be noted that the target node address must correspond to the node ID within the data transmission ring. The target node cannot be specified across rings. If cross-ring communication is required, it must be scheduled through a centralized management node. At the same time, the response mechanism is the key to ensuring that data is not lost. The number of retransmissions when no response is received needs to be set according to the scenario, such as 3 retransmissions for critical business and 1 retransmission for ordinary business.
[0060] For example, Node 1 constructs a data frame: "Fire Alarm: Zone A, Temperature 85℃" (16 bytes) is filled in the "Master Data Field", "Target Node ID" is set to 3, and "Data Length" is set to 16; after being sent to the bus, Node 3 receives and returns an acknowledgment frame, including "Node 1: Data Received"; after Node 1 confirms the acknowledgment, it changes the token status to "Idle", updates the target node ID to 2, and forwards the ring frame to Node 2, completing one data communication.
[0061] Based on the above technical solution, S201-S203 achieves coordinated token passing and data communication through ordered transmission, priority judgment, and reliable transmission. On the one hand, the directional transmission of ring frames and token status control fundamentally avoid message conflicts in traditional CAN buses; on the other hand, based on a multi-factor communication priority algorithm and response mechanism, it ensures both low-latency transmission of high-urgency services and reliable data communication, making it particularly suitable for scenarios with stringent real-time and stability requirements, such as industrial control and fire alarm systems.
[0062] In one possible implementation of this application embodiment, the above-mentioned "each node continuously detects the communication status of adjacent nodes and the transmission ring through a heartbeat mechanism and a ring frame timeout mechanism" can be specifically implemented through the following S301, S302 and S303, which are described in detail below: S301. Nodes periodically send heartbeat messages through a heartbeat mechanism to monitor the online status of neighboring nodes.
[0063] The heartbeat mechanism is the core method for detecting whether adjacent nodes are operating normally. Through two-way interaction of actively sending and passively listening, it ensures that node failures can be quickly identified. Each node needs to periodically broadcast a heartbeat message containing its own identifier, while focusing on listening to the heartbeat messages of adjacent nodes within its data transmission ring to determine their continuity.
[0064] In some implementations, the specific operational procedures for status monitoring via a heartbeat mechanism include: First, construct and send a heartbeat message. The heartbeat message includes, but is not limited to, the following information: node ID, current node load status (such as the length of the message queue to be sent). ), timestamp; the sending period is set to a preset fixed value (e.g., 1 second / time), and must be sent during the bus idle period.
[0065] Each node only listens to its directly adjacent nodes within its data transmission ring. For example, in ring 1, the adjacent nodes of node 2 are node 1 and node 3. It does not need to listen to all nodes in the ring, thus reducing resource consumption.
[0066] If a node does not receive a heartbeat message from its neighboring node within three consecutive transmission cycles, a preliminary fault determination is triggered. Subsequently, a warning of the neighboring node's loss of connection is sent to the centralized management node, and a secondary confirmation is initiated. If there is still no response, the neighboring node is ultimately determined to be faulty.
[0067] It should be noted that the timestamp of the heartbeat message is used to avoid interference from old messages in the judgment. That is, if the timestamp of the heartbeat message received by the node differs from the current time by more than 2 cycles, it is judged as an invalid message and is not included in the status judgment. At the same time, the node itself may not be able to send heartbeats when it is faulty. Therefore, "no heartbeat" is the core indicator of node failure, but it is necessary to eliminate message delays caused by temporary bus congestion through secondary confirmation.
[0068] For example, taking node 2 of data transmission ring 1 (nodes 1-5) as an example: Node 2 sends a heartbeat message to the bus every second with the message "Node ID: 2, Load: 5, Timestamp: 2024-10-01 10:00:01"; at the same time, it listens for the heartbeats of nodes 1 and 3. If it does not receive a heartbeat from node 1 between 10:00:01 and 10:00:03, node 2 first sends a "Node 1 disconnection warning" to the central management node, and then sends two query messages to node 1. If there is still no response at 10:00:04, then node 1 is determined to be faulty.
[0069] S302. The node monitors the path communication status of the transmission ring through the ring frame timeout mechanism.
[0070] The ring frame timeout mechanism is used to determine whether the data transmission path is unobstructed. It monitors the continuity of ring frame transmission through a timer. If no valid activity of the next node is detected within a preset time after a node sends a ring frame, it is determined that there is a fault in the transmission path, such as a next node failure or frame loss.
[0071] In some implementations, the specific operational procedures for determining the path communication status through the ring frame timeout mechanism include: After a node forwards the ring frame to the next node, it immediately starts a ring frame timeout timer; and the timer duration T is dynamically set according to the number of nodes in the transmission ring, as shown in the formula: Where n is the total number of nodes in the data transmission ring; t is the average forwarding time of a single node; The preset redundancy time can be fixed at 50ms to deal with temporary bus delays.
[0072] Within the timer's set duration, determine whether valid activity for the next node has been detected. Valid activity includes: ① The next node forwards the circular frame. For example, a node can capture the change of the "target node ID" of the frame by listening to the bus. When the next node 3 forwards the frame to node 4, node 2 can detect that the target ID of the frame has changed from 3 to 4; ② The next node sends a heartbeat message. For example, if the next node has no circular frame to forward, but still sends a heartbeat normally, it is also considered that the path is open.
[0073] If no valid activity of the next node 3 is detected when the timer expires, the transmission path from node 2 to node 3 is determined to be faulty. At this time, node 2 needs to send a path fault report to the centralized management node and suspend the ring frame forwarding to avoid invalid frames occupying the bus.
[0074] It should be noted that the timer duration cannot be set fixedly. If there are many nodes in the ring (e.g., 10 nodes), a fixed short duration will lead to frequent false alarms; a fixed long duration will delay fault detection. Therefore, a dynamic calculation formula can balance detection accuracy and false alarm rate. At the same time, valid activity includes heartbeat messages, which can cover scenarios where the next node is not forwarding data but is operating normally, avoiding false path faults.
[0075] The detection results of S303 and node integration mechanisms are used to generate a communication status report and submit it.
[0076] The detection results of a single mechanism may have limitations. For example, the heartbeat mechanism cannot determine path congestion, and the timeout mechanism cannot distinguish between node failure and frame loss. Therefore, it is necessary to integrate the two types of results to form a complete report of "node status + path status" and report it to the centralized management node to provide a basis for subsequent ring reconstruction.
[0077] In some implementations, the specific operation flow of step S303 includes: State classification and integration rules: If the heartbeat mechanism determines that an adjacent node is faulty, and the timeout mechanism detects that the transmission path of that node has timed out, then the fault is confirmed as an adjacent node. If the heartbeat mechanism receives a heartbeat from a neighboring node, but the timeout mechanism detects a path timeout, then it integrates "transmission path congestion / frame loss, i.e. the node is normal but the path is abnormal"; If neither mechanism detects an anomaly, the communication status is considered normal.
[0078] After a node reports an anomaly, it needs to wait for confirmation from the centralized management node. If no confirmation is received, the report needs to be resent twice to ensure that the centralized management node can obtain fault information in a timely manner.
[0079] In some implementations, the status report may include: the node's own ID, the detection timestamp, the status of adjacent nodes (normal / faulty), the status of the transmission path (smooth / congested / faulty), and the specific identifier of the faulty node / path (such as "Node 1 faulty" or "Node 2→3 path congested").
[0080] Based on the above technical solutions, S301-S303 achieves comprehensive, high-precision, and low-false-judgment monitoring of communication status through a heartbeat mechanism and a ring frame timeout mechanism. The heartbeat mechanism focuses on the linearity of the node itself, while the timeout mechanism focuses on the smoothness of the path; the two complement each other, covering core anomaly scenarios such as node failure, path congestion, and frame loss. Simultaneously, through designs such as dynamic timers, secondary confirmation, and status integration, the false-judgment rate can be further reduced, ensuring that the centralized management node can grasp the network status in real time and accurately. This lays the foundation for the rapid triggering of subsequent data ring reconstruction, making it particularly suitable for industrial scenarios with extremely high requirements for timely fault response, such as fire alarm systems.
[0081] In one possible implementation of this application embodiment, the above-mentioned "automatically triggering the data ring reconstruction process and updating the token transmission path when a node failure, node addition, or loss of connection of the centralized management node is detected" specifically includes the following S401 to S403: S401. Detect abnormal scenarios and trigger the initiation of a reconstruction request.
[0082] The reconstruction process involves a node that detects an anomaly or a newly added node initiating a reconstruction request. The request must include key information such as the anomaly type or the node ID involved, providing a basis for subsequent negotiations.
[0083] In some implementations, the logic for initiating refactoring requests in different scenarios is as follows: In a non-centralized node failure scenario, the request is initiated by the upstream node of the failed node. The request content must include: the exception type ("node failure"), the ID of the failed node, the current node sequence, and the ID of the upstream node. New node joining scenario: The request is initiated by the new node itself. The request content must include: exception type ("node joining"), new node ID, initial load value of the new node, and the transport ring to which it is expected to join; Centralized management node disconnection scenario: The request is jointly initiated by the surviving nodes within the ring. The request content must include: the exception type ("centralized machine disconnected"), a list of initiating node IDs, and the current health status of the node.
[0084] It should be noted that the reconstruction request must be transmitted with high priority to ensure that the request can skip ordinary data frames and be received by nodes in the ring or the backup central unit first; at the same time, the request must be accompanied by a CRC check code to avoid false triggering of reconstruction due to corruption of the request frame.
[0085] For example, in data transmission ring 1 (nodes 1-5), if node 1 confirms that node 2 is faulty through the heartbeat mechanism and the ring frame timeout mechanism, it then constructs a reconstruction request, including: "Abnormal type: node fault; fault ID: 2; current sequence: 1→2→3→4→5; initiation ID: 1; CRC: 0x4567", and then sends it to the bus with high priority.
[0086] S402. Nodes within the ring participate in the reconstruction negotiation to determine the node sequence of the new data transmission ring.
[0087] Among them, the reconstruction negotiation is the core of the reconstruction process. It is necessary to determine whether the negotiation leader is the centralized management node or the newly elected centralized machine based on the type of anomaly, and generate a new node sequence without faults or redundancy through node voting or rule judgment to ensure a smooth token transmission path.
[0088] In some implementations, the negotiation logic for different exception scenarios is as follows: When the centralized management node is functioning normally (non-centralized node failure / new node addition): After receiving the reconfiguration request, the central unit sends a negotiation notification to all surviving nodes in the ring, requesting each node to report its own health status, including whether it is online and its load status. The central server aggregates the feedback results and adjusts the sequence according to the principle of "ascending node ID + load balancing": if a node is faulty, the faulty node is directly removed; if a new node is added, the new node is inserted into the position with the lowest load. The central machine broadcasts the new sequence to all nodes within the ring and initiates a confirmation vote. If more than 90% of the nodes respond in agreement, the new sequence takes effect. When the centralized management node loses connection: First, a new centralized node election is performed. The election rule is: among the surviving nodes, the node with the smallest node ID and stable online status is elected first. Stable online status requires meeting two conditions: ① Heartbeat message reception success rate = (Actual reception count / Expected reception count) ≥ First predetermined threshold, such as 90%. ② The success rate of responding to historical query commands from the centralized machine = (number of successful responses / number of queries) ≥ the second predetermined threshold, such as 85%; The new central server leads the negotiation, generating a new sequence according to the above-mentioned "remove faults / insert new nodes" logic. The subsequent process is the same as when the central server is working normally.
[0089] It should be noted that the negotiation process must be completed within a preset time limit to avoid communication interruption due to excessive reconstruction time; at the same time, the new sequence must ensure closed-loop nature and meet the basic requirements for token circular transmission.
[0090] For example, when node 2 of ring 1 fails, but the central unit is normal: After receiving the reconstruction request from node 1, the central machine sends a health status query to nodes 1, 3, 4, and 5. Nodes 1 (online, load 5), 3 (online, load 3), 4 (online, load 4), and 5 (online, load 2) are reporting normal results. The central machine generates a new sequence "1→3→4→5→1", and after broadcasting it, it receives agreement feedback from 4 nodes, at which point the new sequence takes effect.
[0091] S403. Generate a new circular frame and distribute it, update the token passing path, and resume communication.
[0092] Once the new node sequence is determined, a ring frame adapted to the new sequence needs to be generated, key fields such as target node ID and node sequence information are updated, and the frame is distributed to all nodes in the ring to finally update the token transmission path and restore data communication.
[0093] In some implementation methods, the specific operation process includes: First, a new frame is generated by the central machine or a new central machine according to a custom frame structure, and the core fields are updated as follows: Target Node ID: Set to the "first node" of the new sequence. For example, in the new sequence of ring 1, 1→3→4→5→1, the target node ID is set to 1. Ring frame type: If it is for fault reconstruction, set it to "control token" and the identification frame is used for path update; if it is for node addition, set it to "data token". Extended additional fields: Add a "New Node Sequence Field" to help nodes confirm their paths; CRC checksum: Recalculated based on the new field; Then, a broadcast + confirmation mechanism is adopted. The central unit sends the new frame to all nodes in the ring. Each node needs to send back frame reception confirmation after receiving it. If a node does not send back a confirmation, the central unit needs to retransmit twice to ensure 100% node coverage. When a node receives a new frame, it updates the "token passing path" stored locally and sets the token status of the new frame to "idle", thus starting a new round of token passing; at this time, data communication resumes according to the new path.
[0094] It should be noted that the fields of the new circular frame must be compatible with the original frame to avoid reconstruction failure due to the inability of the node to recognize the frame structure; at the same time, test communication must be performed after the path is updated to verify whether the new path is smooth. If the test fails, the S401-S403 process must be retried.
[0095] Based on the aforementioned technical solutions S401-S403, through request initiation, negotiation sequencing, and frame update recovery processes, adaptive reconstruction of the data ring is achieved under different abnormal scenarios: whether it is node failure, new node addition, or central machine disconnection, the token transmission path can be quickly updated through explicit triggering logic, orderly negotiation mechanism, and reliable frame updates; the entire process requires no manual intervention and the reconstruction is time-consuming, effectively ensuring the continuity and reliability of communication. This dynamic reconstruction capability enables the system to avoid communication interruption even when facing node anomalies in scenarios such as industrial control and fire alarms, significantly improving the network's fault tolerance and self-healing capabilities.
[0096] The foregoing mainly describes the solutions of the embodiments of this application from the perspective of device implementation. It is understood that each device, such as a communication network optimization device, includes at least one of the hardware structures and software modules corresponding to the execution of each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software-driven hardware manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0097] This application embodiment can divide the communication network optimization device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0098] When using integrated units, Figure 5 A possible structural schematic diagram of the communication network optimization device (referred to as communication network optimization device 50) involved in the above embodiments is shown. The communication network optimization device 50 includes a processing unit 501 and a communication unit 502, and may also include a storage unit 503. Figure 5 The schematic diagram shown can be used to illustrate the structure of the communication network optimization device involved in the above embodiments.
[0099] when Figure 5 The schematic diagram shown illustrates the structure of the communication network optimization device involved in the above embodiments. The processing unit 501 is used to control and manage the operation of the communication network optimization device, the communication unit 502 is used for the communication network optimization device to communicate with other devices, and the storage unit 503 is used to store the program code and data of the communication network optimization device.
[0100] For example, the communication unit 502 is used to broadcast the heartbeat message of this node on a single CAN bus to announce its online status; to listen to the heartbeat messages of adjacent nodes in its data transmission ring and capture the ring frame transmitted on the bus; to receive and forward the ring frame to the next node and transmit the ring frame according to the "target node ID" guide; and also to send a reconfiguration request to the central management node when a node failure or a new node is detected, and to receive feedback information from other nodes during the reconfiguration negotiation process.
[0101] The processing unit 501 is used to control the centralized management node to logically group online nodes and divide them into multiple independent data transmission rings during the communication system initialization phase; to initialize a custom-structured ring frame for each data transmission ring, configuring core fields such as ring frame type, target node ID, and token status; to monitor the transmission status of the ring frame, parse the token status field of the ring frame, and determine whether the node has bus transmission permission; and to decide whether the node should immediately send data after obtaining the token based on the node's pending data status and communication priority rules, so as to avoid wasting bus resources.
[0102] In one possible implementation, the processing unit 501 is also used to continuously monitor the working status of adjacent nodes and the path smoothness of the transmission ring through the coordination of the heartbeat mechanism and the ring frame timeout mechanism; when no heartbeat is received from adjacent nodes for several consecutive cycles, or when no effective activity is detected during the ring frame transmission timeout, the node is determined to be faulty or the path is abnormal; it is also used to control the surviving nodes to elect a new centralized management node according to the preset rule of "the node ID is the smallest and the online status is stable" when the centralized management node is disconnected, and to ensure that the new node inherits the ring management, scheduling and fault recovery functions of the original node.
[0103] In one possible implementation, the communication unit 502 is further configured to receive new node sequence information broadcast by the centralized management node or the new centralized management node, as well as newly generated ring frames, during the data ring reconstruction process; to provide feedback to the centralized management node with confirmation information on the new node sequence to ensure consensus on the reconstruction scheme; and to forward the ring frames according to the new token passing path after reconstruction is completed, thereby restoring data communication between nodes. The processing unit 501 is further configured to, in the case of node failure, control the upstream node of the failed node to modify the target node ID of the data transmission ring, skipping the failed node's updated token passing path; and in the case of a new node joining, adjust the node sequence of the original data transmission ring, insert the new node into the appropriate position, generate a new ring frame, and synchronize it to all nodes in the ring to ensure that the new node is integrated into the communication network.
[0104] The processing unit 501 can be a processor or a controller, and the communication unit 502 can be a communication interface, transceiver, transceiver circuit, transceiver device, etc. The term "communication interface" is a general term and may include one or more interfaces. The storage unit 503 can be a memory. When the communication network optimization device 50 is a chip, the processing unit 501 can be a processor or a controller, and the communication unit 502 can be an input interface and / or an output interface, pins, or circuits, etc. The storage unit 503 can be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit located outside the chip (e.g., read-only memory (ROM), random access memory (RAM, etc.).
[0105] The communication unit can also be called a transceiver unit. The antenna and control circuit with transceiver functions in the communication network optimization device 50 can be considered as the communication unit 502 of the communication network optimization device 50, and the processor with processing functions can be considered as the processing unit 501 of the communication network optimization device 50. Optionally, the device in the communication unit 502 that implements the receiving function can be considered as a communication unit, which is used to execute the receiving steps in the embodiments of this application. The communication unit can be a receiver, a receiver circuit, etc. The device in the communication unit 502 that implements the transmitting function can be considered as a transmitting unit, which is used to execute the transmitting steps in the embodiments of this application. The transmitting unit can be a transmitter, a transmitter, a transmitting circuit, etc.
[0106] Figure 5 If the integrated units in the process are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. Storage media for storing computer software products include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0107] Figure 5 The units in the process can also be called modules; for example, a processing unit can be called a processing module.
[0108] This application embodiment also provides a hardware structure diagram of a multi-ring state-aware communication network optimization device (denoted as communication network optimization device 60), see [link to diagram]. Figure 6 The communication network optimization device 60 includes a processor 601, and optionally, a memory 602 connected to the processor 601.
[0109] In the first possible implementation, see Figure 6 The communication network optimization device 60 also includes a transceiver 603. The processor 601, memory 602, and transceiver 603 are connected via a bus. The transceiver 603 is used to communicate with other devices or communication networks. Optionally, the transceiver 603 may include a transmitter and a receiver. The device in the transceiver 603 that implements the receiving function can be considered as a receiver, which is used to perform the receiving steps in the embodiments of this application. The device in the transceiver 603 that implements the transmitting function can be considered as a transmitter, which is used to perform the transmitting steps in the embodiments of this application.
[0110] Based on the first possible implementation method Figure 6 The schematic diagram shown can be used to illustrate the structure of the communication network optimization device involved in the above embodiments.
[0111] in, Figure 6 The system chip in the communication network optimization device can also be illustrated. In this case, the actions performed by the aforementioned communication network optimization device can be implemented by the system chip. The specific actions performed can be found above and will not be repeated here.
[0112] In implementation, each step of the method provided in this embodiment can be completed by integrated logic circuits in the processor or by instructions in software form. The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0113] This application also provides a computer-readable storage medium including instructions that, when run on a computer, cause the computer to perform any of the methods described above.
[0114] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described above.
[0115] This application also provides a chip including a processor and an interface circuit. The interface circuit is coupled to the processor. The processor is used to run computer programs or instructions to implement the above-described method. The interface circuit is used to communicate with other modules outside the chip.
[0116] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.
[0117] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0118] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0119] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and modifications.
Claims
1. A method for multi-ring state-aware communication network optimization, the method comprising: determining a plurality of rings in a network; determining a plurality of states for each ring; and determining a plurality of state-aware network optimization parameters for each ring. The application relates to a communication system, comprising: When the communication system is initialized, a plurality of nodes are logically divided into a plurality of data transmission rings by a centralized management node on a single physical bus, and a ring frame for controlling sending authority is initialized for each transmission ring; Each node performs token passing based on the ring frame, and when a node in the ring obtains the token of the ring, the node obtains the sending authority of the bus, constructs a data frame containing the address of a target node, and sends the data frame to the bus to perform data communication between nodes; Each node continuously detects the communication state of adjacent nodes and the transmission ring through a heartbeat mechanism and a ring frame timeout mechanism; When a node fault, node joining or the centralized management node disconnection is detected, a data ring reconstruction process is automatically triggered to update the token passing path.
2. The method of claim 1, wherein, The ring frame is a self-defined frame structure which extends a ring frame type field for distinguishing frame types, a target node ID field for indicating the token passing direction, an original node ID field for indicating the sending node, a token state field for indicating the token occupation state, a communication priority field for defining the message priority, a data length field for indicating the data length, a main data field for carrying transmission data and a cyclic redundancy check field for error detection on the basis of a standard CAN data frame.
3. The method of claim 1, wherein, When a node obtains the sending authority of the bus, a communication priority decision algorithm is used to determine whether to immediately send data, comprising: When the communication priority of the node is higher than a preset threshold, data is immediately sent; otherwise, the data is temporarily reserved and the token is passed to the next node, and the waiting time of the message is accumulated; The communication priority decision algorithm is based on a plurality of factors including the preset priority of the message, the current load of the node, the waiting time of the message and the hop count of the transmission path.
4. The method of claim 3, wherein, The calculation formula of the communication priority P is: ; wherein, is a preset priority of the message, is a length of a to-be-sent message queue of the current node, is a maximum capacity of the node message queue, is a time for which the message has been waiting in the queue, is a hop count from a source node to a target node in the data transmission ring, α, β, γ, δ are weight coefficients, and the sum is 1, and λ is a decay coefficient.
5. The method of claim 1, wherein, The data communication between nodes comprises: After a current node receives the ring frame, the token state field of the ring frame is analyzed; When the token state field is idle and the current node has data to be sent, the token state field of the current node is modified to busy, the data to be sent is filled into the main data field, the communication priority field is updated, and then the ring frame is sent to the bus; otherwise, the current node directly passes the ring frame to the next node indicated by the target node ID field.
6. The method of claim 1, wherein, Each node continuously monitors the communication state of adjacent nodes and the transmission ring through a heartbeat mechanism and a ring frame timeout mechanism, comprising: Each node periodically broadcasts a heartbeat message containing the ID of the node to the bus; Each node listens to the heartbeat message of adjacent nodes in the data transmission ring to which the node belongs, and when the heartbeat message of the adjacent nodes is not received in continuous multiple periods, it is determined that the adjacent nodes are faulty or disconnection; After each node passes the ring frame to the next node, a timer is started, and when no valid activity from the next node on the bus is listened to within a preset time, it is determined that the transmission path of the ring frame is faulty; the valid activity includes sending data or sending a heartbeat message.
7. The method of claim 1, wherein, When the node fault is a centralized management node fault, a new centralized management node is elected according to a preset rule by the surviving nodes, and the new centralized management node inherits the ring management function of the original node; wherein, The preset rule is that in the live nodes, the node with the smallest node ID and the most stable online state is preferentially elected as the new centralized management node, and the most stable online state means that in a preset continuous monitoring period, the node heartbeat packet receiving success rate reaches a first predetermined threshold, and the node response success rate to the centralized management node query command reaches a second predetermined threshold.
8. The method of claim 1, wherein, When the node failure is a non-centralized node failure, the target node ID in the data transmission ring is modified by the upstream node of the failed node, the token is passed to the downstream node of the failed node, and self-healing reconstruction of the ring is realized.
9. The method of claim 1, wherein, The data ring reconstruction process includes: The reconstruction process is initiated by a fault detection node or a new joining node, and the fault detection node sends a reconstruction request to the centralized management node, and the new joining node sends a reconstruction request to other nodes in the data transmission ring; The nodes receiving the reconstruction request participate in reconstruction negotiation, and the negotiation content at least includes the node sequence of the new data transmission ring; The centralized management node or the new centralized management node generates a new ring frame according to the negotiation result, and updates the target node ID field in the ring frame; The new ring frame is distributed to restore the logical path of data transmission.
10. The method of claim 1, wherein, The number of the data transmission rings is multiple, and each data transmission ring independently runs and is uniformly managed by the centralized management node; the centralized management node realizes the global communication scheduling and fault recovery of the whole network by maintaining the node sequence information of each ring.
Citation Information
Cited By
Multi-master one-slave multi-monitoring weighing communication networking method and system
CN122002329A
Scheduling method and device of multi-node communication system and multi-node communication system
CN122137768A