A method and system for half-duplex bus communication ad hoc networking based on the Poisson backoff model
By constructing an RS485 half-duplex multi-node communication model and a Poisson backoff model, the problems of node address configuration relying on manual intervention, frequent signal collisions, and low network success rate in RS485 half-duplex communication are solved. Adaptive backoff and efficient self-organizing network are realized, improving the reliability and efficiency of network formation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGSU WEITENG ECOLOGICAL TECH DEV CO LTD
- Filing Date
- 2025-10-27
- Publication Date
- 2026-07-31
AI Technical Summary
Existing RS485 half-duplex multi-node communication methods suffer from problems such as node address configuration relying on manual intervention, frequent signal collisions, low matching degree between backoff mechanisms and physical layer characteristics, low network success rate, and inability to achieve adaptive backoff and efficient self-organizing networks in multi-node environments.
An RS485 half-duplex multi-node communication model is constructed. The CRC16 algorithm is used to generate temporary communication addresses. Combined with differential voltage detection and Poisson backoff model, backoff parameters are dynamically adjusted. The collision detection and node addressing problems are solved through two-stage networking.
It achieves automatic generation of unique node identifiers, real-time feedback of collision detection, and adaptive adjustment of backoff parameters, thereby improving the reliability and efficiency of network topology, reducing the probability of collisions, and supporting dynamic node access and self-organizing network topology.
Smart Images

Figure CN121262097B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial communication and automation control technology, specifically to a half-duplex bus communication self-organizing network method and system based on the Poisson backoff model. Background Technology
[0002] RS485 bus is widely used in industrial automation and distributed monitoring systems due to its strong anti-interference capabilities, long transmission distance, and simple wiring. Its half-duplex multi-node communication structure can interconnect multiple devices using two differential signal lines, but signal conflicts are prone to occur when multiple nodes are powered on simultaneously or when there is a lack of address allocation mechanisms. Traditional methods often rely on DIP switches or manual configuration of stored addresses, resulting in low node access efficiency, poor network scalability, and difficulty in meeting the requirements of dynamic device access and self-organizing networking.
[0003] Existing communication conflict control methods mostly employ random delay or time-slot polling mechanisms, achieving backoff through transmission delay. These methods are largely based on full-duplex communication environments, relying on carrier sensing for conflict detection, and are not suitable for RS485 half-duplex scenarios. Half-duplex communication lacks real-time channel detection capabilities at the physical layer, and nodes cannot determine the channel occupancy status during transmission. Random backoff values tend to converge, resulting in a high probability of conflict. Some improved solutions introduce master-slave control or fixed synchronization clocks to coordinate transmission, but these are complex to implement and lack scalability. Although differential voltage detection can detect bus conflicts, existing solutions mostly remain at the frame level, failing to achieve accurate detection within a bit period, resulting in limited response speed.
[0004] In current multi-node communication, the backoff algorithm lacks coupling with the physical characteristics of RS485. There is no dynamic correspondence between time slot division, backoff parameters, and node identifiers, resulting in concentrated delay distribution and insufficient backoff randomness. When the number of nodes increases or the network load is high, collisions occur frequently and the self-organizing time is prolonged. At the same time, the traditional networking mechanism of single-stage broadcast lacks adaptive reorganization capability in the case of node non-response or link interference, and the network initialization is incomplete. The RS485 half-duplex bus has not yet formed a unified modeling system between collision detection, backoff calculation, and node addressing, making it difficult to achieve a stable and fast self-organizing process in multi-node communication. Summary of the Invention
[0005] In view of the above-mentioned problems, the present invention is proposed.
[0006] Therefore, the technical problem solved by the present invention is that the existing RS485 half-duplex multi-node communication method has problems such as node address configuration relying on manual intervention, frequent signal collisions, low matching degree between backoff mechanism and physical layer characteristics, low network success rate, and inability to achieve adaptive backoff and efficient self-organizing network in multi-node environment.
[0007] To address the aforementioned technical problems, this invention provides the following technical solution: a self-organizing network method for half-duplex bus communication based on the Poisson backoff model, comprising: constructing an RS485 half-duplex multi-node communication model; reading the unique ID of each node after power-on and generating a temporary communication address using the CRC16 algorithm to establish a unique node identification relationship; performing differential voltage detection based on the RS485 half-duplex multi-node communication model to obtain collision detection results; constructing a Poisson backoff model based on the RS485 half-duplex bus according to the collision detection results, obtaining the time slot length, determining the expected Poisson distribution by combining the node's unique identifier, generating a load correction coefficient and the number of backoff slots, and controlling the frame transmission timing to perform node delayed backoff; and performing a two-stage networking based on the Poisson backoff model, whereby the master node broadcasts a networking command and names the nodes, updates parameters for unresponsive nodes, recalculates backoff, and assigns formal addresses to complete the networking.
[0008] As a preferred embodiment of the half-duplex bus communication self-organizing network method based on the Poisson backoff model described in this invention, the RS485 half-duplex multi-node communication model includes a configuration structure with a transceiver with bus protection function, a differential output voltage range of ±2V~±6V, and an input impedance of not less than 12kΩ, and 120Ω terminating resistors are configured at both ends of the bus.
[0009] As a preferred embodiment of the half-duplex bus communication self-organizing network method based on the Poisson backoff model described in this invention, the differential voltage detection includes: real-time monitoring of the voltage change rate of bus A / B lines, comparing the change rate with a change threshold within one bit period, and executing a timed interrupt to freeze the backoff count when the threshold is exceeded; the change threshold includes determining a collision when the change rate exceeds ±500mV / μs within the period; the timed interrupt freeze includes limiting the collision detection response time to no more than 0.5μs, and the maximum number of collision detections in a single network setup is three.
[0010] As a preferred embodiment of the half-duplex bus communication self-organizing network method based on the Poisson backoff model described in this invention, the Poisson backoff model includes determining the backoff reference period for each node under the half-duplex bus by obtaining the time slot length based on the communication rate, maximum frame length, and frame interval; the time slot length is expressed as:
[0011] ,
[0012] in, This represents the duration of the initial backoff time slot, and is the base unit for calculating the backoff time at each node in the Poisson backoff model. This indicates the maximum data length of a single frame, reflecting the maximum frame capacity for a single data transmission in an RS485 half-duplex bus. Indicates the frame interval, describing the minimum transmission interval between consecutive data frames. This indicates the communication rate; it refers to the physical transmission rate parameter of the 485 bus. It represents the redundancy coefficient, which compensates for signal transmission delay and line propagation error.
[0013] As a preferred embodiment of the half-duplex bus communication ad hoc network method based on the Poisson backoff model described in this invention, the Poisson backoff model further includes: determining the Poisson distribution expectation based on the lower 8 bits of the node's unique identifier, dynamically adjusting the Poisson distribution expectation value based on the number of collision detections, and controlling the node backoff probability distribution; the Poisson distribution expectation is expressed as:
[0014] ,
[0015] When a conflict occurs, the system dynamically adjusts the value, ensuring that the maximum expected value of the Poisson distribution is ≤8. The adjustment formula is as follows:
[0016] ,
[0017] in, This represents the initial value of the expectation of the Poisson distribution. This represents the lower 8 bits of the node's unique identifier (UID) processed using the CRC16 algorithm, ranging from 0 to 255, used to generate the initial value of the node's unique Poisson distribution. This represents the mask constant for the bitwise AND operation, used to limit the range of values for the calculation result, ensuring that the initial values are distributed between 2 and 4, and different nodes... Base value dispersion This represents the dynamically adjusted expectation of the Poisson distribution after a conflict occurs. This represents the conflict correction factor, which is selected based on the conflict frequency range and reflects the expected adjustment magnitude corresponding to the number of conflicts.
[0018] As a preferred embodiment of the half-duplex bus communication self-organizing network method based on the Poisson backoff model described in this invention, the Poisson backoff model further includes: generating a load correction coefficient based on the total number of online nodes and the maximum supported number of nodes, and determining the number of backoff slots by combining the adjusted Poisson distribution expectation and the time slot length; the load correction coefficient is expressed as:
[0019] ,
[0020] in, Indicates the load correction factor. This indicates the total number of online nodes on the bus. Indicates the maximum number of nodes supported by the bus. The smaller the value, the higher the bus load, and the larger the backoff step size needs to be. hour, 0.1.
[0021] As a preferred embodiment of the half-duplex bus communication self-organizing network method based on the Poisson backoff model described in this invention, the two-stage networking includes: the master node broadcasts a networking command for the first time and names the nodes that have joined the network; for nodes that do not respond, it sends an updated Poisson distribution expectation and load correction coefficient to recalculate the number of backoff slots and sends temporary addresses; after receiving all temporary addresses, the master node reallocates formal addresses to complete the self-organizing network process.
[0022] Another objective of this invention is to provide a half-duplex bus communication self-organizing network system based on the Poisson backoff model. This system solves the problems of address allocation relying on manual intervention, delayed collision detection response, and inability to dynamically adjust backoff parameters in current multi-node communication by establishing a scheme that combines the RS485 half-duplex multi-node communication model and the Poisson backoff model.
[0023] As a preferred embodiment of the half-duplex bus communication self-organizing network system based on the Poisson backoff model described in this invention, the system includes: a communication modeling module, a collision detection module, a backoff calculation module, and a network control module. The communication modeling module constructs an RS485 half-duplex multi-node communication model, reads the unique ID of each node after power-on, generates a temporary communication address using the CRC16 algorithm, and establishes a unique node identification relationship. The collision detection module performs differential voltage detection based on the RS485 half-duplex multi-node communication model, monitors the voltage change rate of lines A and B in real time, determines collisions, and outputs the collision detection results. The backoff calculation module constructs a Poisson backoff model based on the collision detection results, calculates the time slot length based on the communication rate, maximum frame length, and frame interval, determines the expected Poisson distribution based on the node's unique identifier, and generates a load correction coefficient and the number of backoff slots. The network control module performs a two-stage network formation based on the Poisson backoff model, with the master node broadcasting a network formation command and calling out nodes, updating parameters for unresponsive nodes, recalculating the backoff time, and assigning official addresses to complete the network formation.
[0024] Another object of the present invention is to provide a half-duplex bus communication self-organizing network device based on the Poisson backoff model, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of a half-duplex bus communication self-organizing network method based on the Poisson backoff model.
[0025] Another object of the present invention is to provide a storage medium for a half-duplex bus communication self-organizing network based on the Poisson backoff model, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the steps of a half-duplex bus communication self-organizing network method based on the Poisson backoff model are implemented.
[0026] The beneficial effects of this invention are as follows: This invention provides a self-organizing network method for half-duplex bus communication based on the Poisson backoff model. By constructing an RS485 half-duplex multi-node communication model and combining it with the Poisson backoff model, a unified closed loop is achieved for node unique identifier generation, collision detection result feedback, and adaptive adjustment of backoff parameters. This invention achieves better results in terms of networking reliability of multi-node communication, reasonable distribution of backoff timing, and self-organization of node addressing. Attached Figure Description
[0027] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. 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.
[0028] Figure 1 The above is an overall flowchart of a half-duplex bus communication self-organizing network method based on the Poisson backoff model provided in Embodiment 1 of the present invention.
[0029] Figure 2 This is a schematic diagram of the bus collision detection principle of a half-duplex bus communication self-organizing network method based on the Poisson backoff model provided in Embodiment 1 of the present invention.
[0030] Figure 3 This is a schematic diagram of the architecture of a half-duplex bus communication self-organizing network method based on the Poisson backoff model provided in Embodiment 1 of the present invention. Detailed Implementation
[0031] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0032] Example 1, referring to Figures 1-3 As an embodiment of the present invention, a half-duplex bus communication self-organizing network method based on the Poisson backoff model is provided, comprising:
[0033] S1: Construct an RS485 half-duplex multi-node communication model. After the node is powered on, read the unique ID and generate a temporary communication address using the CRC16 algorithm to establish a unique identification relationship between the nodes.
[0034] It should be noted that the RS485 half-duplex multi-node communication model includes a transceiver with bus protection, a differential output voltage range of ±2V to ±6V, an input impedance of not less than 12kΩ, and 120Ω terminating resistors at both ends of the bus.
[0035] The RS485 half-duplex multi-node communication model monitoring configuration uses an RS485 transceiver with bus protection. The half-duplex communication rate can be configured from 9600bps to 115200bps. At the same time, the hardware configuration bus monitoring section of the slave node monitors the bus status in real time.
[0036] Bus monitoring includes bus transmission based on shielded twisted pair cable (RVSP 2×0.75mm²), transmission attenuation coefficient set to 0.1dB / 100m (at 9600bps), and signal reflection coefficient not greater than 5% (with 120Ω terminating resistors configured at both ends of the bus).
[0037] It should also be noted that each node includes "send / receive control", "collision detection", and "Poisson backoff calculation". The node address range is set to 1~255 (supporting a maximum of 255 devices in a network). The maximum time for a single network setup is no more than 60 seconds. If multiple collisions are detected and the network setup times out, the node will exit the RS485 half-duplex multi-node communication model and wait for the next network setup command.
[0038] After the node is powered on, it reads the unique ID of the built-in chip through the hardware interface, performs hash processing on the ID, and uses the CRC16 algorithm to compress the long ID into a 16-bit unique node value (unique node identifier), which is used as a temporary communication address (range 0x0001~0xFFFF) to avoid default address conflicts.
[0039] S2: Differential voltage detection is performed based on the RS485 half-duplex multi-node communication model to obtain collision detection results.
[0040] For reference Figures 2-3 As shown, it should be noted that differential voltage detection includes real-time monitoring of the voltage change rate of bus A / B lines, comparing the change rate with a change threshold within one bit period, and executing a timed interrupt freeze backoff count when the threshold is exceeded; the change threshold includes determining a collision when the change rate exceeds ±500mV / μs within the period; the timed interrupt freeze includes limiting the collision detection response time to no more than 0.5μs, and the maximum number of collision detections per network configuration is three.
[0041] Wherein, MCU stands for Microcontroller Unit, which is used to execute the Poisson backoff algorithm, node address generation, collision detection signal acquisition, and self-organizing network control logic; INT0 represents the interrupt freeze signal input port; RXD / TXD represent the Receive Data and Transmit Data signal lines, respectively; ISOGND represents the isolation ground.
[0042] The communication constraints of the RS485 bus self-organizing network are set using the RS485 half-duplex multi-node communication model.
[0043] Communication constraints include load bus constraints and communication rate constraints.
[0044] The load bus constraints include setting the maximum number of nodes on a single 485 bus to no more than 64 (extended through a single repeater, with each repeater isolating 32 nodes).
[0045] The communication rate constraints include dynamic adjustment based on the transmission distance: when the transmission distance is no more than 300 meters, the communication rate is less than or equal to 115200 bps; when the transmission distance is between 300 and 1200 meters, the communication rate is less than or equal to 9600 bps.
[0046] S3: Based on the collision detection results, construct a Poisson backoff model based on RS485 half-duplex bus, obtain the time slot length, determine the expected Poisson distribution by combining the node's unique identifier, generate the load correction coefficient and the number of backoff slots, and control the frame transmission timing to perform node delay backoff.
[0047] It should be noted that the Poisson backoff model includes determining the backoff reference period for each node under a half-duplex bus by obtaining the time slot length based on the communication rate, maximum frame length, and frame interval; the time slot length is expressed as:
[0048] ,
[0049] in, This represents the duration of the initial backoff time slot, and is the base unit for calculating the backoff time at each node in the Poisson backoff model. This indicates the maximum data length of a single frame, reflecting the maximum frame capacity for a single data transmission in an RS485 half-duplex bus. Indicates the frame interval, describing the minimum transmission interval between consecutive data frames. This indicates the communication rate; it refers to the physical transmission rate parameter of the 485 bus. It represents the redundancy coefficient, which compensates for signal transmission delay and line propagation error.
[0050] The Poisson backoff model also includes determining the Poisson distribution expectation based on the lower 8 bits of the node's unique identifier, dynamically adjusting the Poisson distribution expectation value based on the number of collision detections, and controlling the node backoff probability distribution; the Poisson distribution expectation is expressed as:
[0051] ,
[0052] When a conflict occurs, the system dynamically adjusts the value, ensuring that the maximum expected value of the Poisson distribution is ≤8. The adjustment formula is as follows:
[0053] ,
[0054] in, This represents the initial value of the expectation of the Poisson distribution. This represents the lower 8 bits of the node's unique identifier (UID) processed using the CRC16 algorithm, ranging from 0 to 255, used to generate the initial value of the node's unique Poisson distribution. This represents the mask constant for the bitwise AND operation, used to limit the range of values for the calculation result, ensuring that the initial values are distributed between 2 and 4, and different nodes... Base value dispersion This represents the dynamically adjusted expectation of the Poisson distribution after a conflict occurs. This represents the conflict correction factor, which is selected based on the conflict frequency range and reflects the expected adjustment magnitude corresponding to the number of conflicts.
[0055] It should also be noted that the conflict correction factor should be set and selected according to Table 1 below:
[0056]
[0057] Table 1. Conflict Correction Factor Selection Table
[0058] Using the AD sample value as a random number seed, random numbers are generated. The number of backoff slots k is selected by combining the adjusted Poisson distribution expectation value with the random numbers, so that the delays of conflicting nodes are "staggered," as shown in Table 2. The probability distribution table for time is expressed as follows:
[0059]
[0060] Table 2 Probability Distribution Table ( )
[0061] It should also be noted that the time slot length is dynamically updated based on the initial backoff time slot duration, so that the time slot duration for different nodes has the following formula:
[0062] ,
[0063] in, This indicates the duration of the backoff time slot after dynamic updates. This represents the high 8 bits of the node's unique identifier (UID) after processing using the CRC16 algorithm.
[0064] The Poisson backoff model also includes generating a load correction coefficient based on the total number of online nodes and the maximum number of supported nodes, and determining the number of backoff slots by combining the adjusted Poisson distribution expectation and the time slot length; the load correction coefficient is expressed as:
[0065] ,
[0066] in, Indicates the load correction factor. This indicates the total number of online nodes on the bus. Indicates the maximum number of nodes supported by the bus. The smaller the value, the higher the bus load, and the larger the backoff step size needs to be. hour, 0.1.
[0067] S4: Based on the Poisson backoff model, a two-stage networking process is performed. The master node broadcasts the networking command and names the nodes. For nodes that do not respond, the parameters are updated, the backoff is recalculated, and a formal address is assigned to complete the networking.
[0068] It should be noted that the two-stage networking process includes the master node broadcasting the networking command for the first time and naming the nodes that have joined the network. For nodes that do not respond, the master node sends the updated Poisson distribution expectation and load correction coefficient, recalculates the number of backoff slots, and sends temporary addresses. After receiving all temporary addresses, the master node reallocates formal addresses to complete the self-organizing network process.
[0069] Entering the first phase of temporary address communication establishment:
[0070] The master node sends network formation commands via broadcast, and distributes the corresponding information in the command frame based on the number of slave nodes in the network. The value is set, and a timer is started for 60 seconds. After receiving the broadcast command, the slave node reads its own MCU / Soc chip UID, and performs hash processing based on the chip UID and CRC algorithm to generate a 16-bit unique value as a temporary communication address (range 0x0001~0xFFFF).
[0071] From the node based on its own generation Generate based on the Poisson backoff model , and Generate random numbers and look up the table to obtain them. The value, representing the backoff delay for generating temporary address networks, is as follows:
[0072] ,
[0073] in, This indicates the backoff delay for temporary address networking.
[0074] It should also be noted that, starting from the node... To avoid delay time, the bus busy / idle status is monitored during the delay period, each If a transmission conflict is detected, then If a conflict is detected when the delay time expires, it will be handled according to the recorded information. Value, generate the corresponding Synchronous updates for Regenerate And wait for the delay to end.
[0075] After the master node's scheduled time expires, it organizes the received slave node return addresses, sends the roll call command sequentially based on the addresses, and compares the number of "reported" slave nodes with the actual number of slave nodes on the network. If they do not match, it sends a secondary broadcast network formation command, updating the command frame accordingly. The value is issued, and a 60-second timer begins; slave nodes that have already "reported" will not process the secondary broadcast network command; slave nodes not mentioned by the master node will recalculate the expected value of the Poisson distribution and obtain the new value by looking up Table 2. Value, generating a new backoff delay for temporary address networking:
[0076] ,
[0077] in, This indicates a new backoff delay for temporary address networking. This represents the updated load correction factor. This indicates the number of backoff slots after the update.
[0078] In After the delay expires, the master node monitors the bus status and sends its own temporary address when the bus is idle. When the master node receives a new slave node joining the network, it organizes the temporary addresses of the slave nodes and calls them by name in turn, thus ending the first phase.
[0079] Entering the second phase, the network addresses of the slave nodes are reallocated:
[0080] After the master node receives all the temporary addresses of the joining slave nodes, it organizes them and compares them with the preset number of slave nodes in the network. If there is no error, it reorders the temporary addresses of the slave nodes and reassigns an address to each slave node. After the master node completes the assignment, it uses the network address to call the slave nodes one by one. At this point, the current network is completed.
[0081] Example 2 is an embodiment of the present invention, which provides a half-duplex bus communication self-organizing network method based on the Poisson backoff model. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0082] First, consider a multi-node RS485 monitoring network for a certain data acquisition system. There is one master node, and one signal repeater is connected to every 32 slave nodes, for a total of 64 slave nodes. The slave node master control chip is an STM32F103 series, with a communication rate of 9600bps and an initialization time of about 5 seconds.
[0083] Hardware requirements and parameter configuration:
[0084] Hardware requirements include: Slave node: STM32F103 (built-in 96-bit UID, supports AD sampling function);
[0085] 485 transceiver: SP485EN;
[0086] Master node: Industrial gateway with 485 interface;
[0087] Key parameters:
[0088] Range 2~4, from Decide;
[0089] Calculated by the formula, it is approximately 100ms in this case;
[0090] During the temporary address networking phase, 64 nodes read the 96-bit chip UID and calculate the 16-bit... Data (such as node A) The value is 0x1234, for node B. (Each value is 0x5678, and none are repeated); the master node sends the network formation command via broadcast and distributes the value in the command frame according to the number of slave nodes in the network, while simultaneously starting a 60-second timer; 60 slave nodes calculate... A timeout was implemented, with network registration completed within 60 seconds. Four devices failed to return to their temporary addresses within the allotted network time due to competition.
[0091] This represents the result of the node's unique identifier being compressed using a hash or CRC16 algorithm.
[0092] After receiving and parsing the registration frames from 60 slave nodes, the master node performs a roll call for the group of slave nodes. Simultaneously, it compares the number of nodes with the preset network node count, confirms that the number of nodes in the network does not match the preset value, and initiates a secondary network formation. The four slave nodes, having not received the corresponding roll call frames from the master node, enter the secondary network formation logic and recalculate. After the backoff delay ends, the master node resends the registration frame; the master node receives the second registration frames from the four slave nodes and calls the names of the four slave nodes. At this point, the temporary address networking phase ends and all 64 slave nodes have joined the network.
[0093] During the address reallocation phase, after the master node receives all the temporary addresses of the new slave nodes, it organizes them and compares them with the preset number of slave nodes. If there are no errors, it reorders the temporary addresses of the slave nodes and reallocates an address to each slave node. After the master node completes the allocation, it uses the network address to name the slave nodes in sequence and communicates with the slave nodes using a preset standard communication protocol (such as Modbus-RTU). The network is then successfully established.
[0094] Networking Results: This implementation case has undergone hundreds of network tests with a 100% success rate.
[0095] Network setup time: 120s. To ensure a 100% network setup success rate, a secondary network setup function with an algorithm was designed to ensure that network setup can be successfully completed even if there are occasional competition phenomena.
[0096] Conflict rate: The average conflict rate for primary networking is within 15% to 5% (10 / 64 to 2 / 64), while the conflict rate for secondary networking is 0%.
[0097] Current experiments have shown that the current solution significantly reduces the conflict rate, improves networking efficiency, and utilizes the chip's UID, GPIO input, and interrupt functions without requiring additional hardware, resulting in good economic benefits.
[0098] Example 3, an embodiment of the present invention, provides a half-duplex bus communication self-organizing network system based on the Poisson backoff model, including a communication modeling module, a collision detection module, a backoff calculation module, and a network control module.
[0099] The communication modeling module is used to construct an RS485 half-duplex multi-node communication model. After the node is powered on, it reads the unique ID and generates a temporary communication address using the CRC16 algorithm to establish a unique identification relationship between the nodes.
[0100] The collision detection module is used to perform differential voltage detection based on the RS485 half-duplex multi-node communication model, monitor the voltage change rate of lines A and B in real time, determine collisions, and output the collision detection results.
[0101] The backoff calculation module is used to construct a Poisson backoff model based on the collision detection results. It calculates the time slot length based on the communication rate, maximum frame length and frame interval, determines the expected Poisson distribution by combining the node's unique identifier, and generates the load correction coefficient and the number of backoff slots.
[0102] The network control module is used to perform two-stage networking based on the Poisson backoff model. The master node broadcasts the networking command and names the nodes. For nodes that do not respond, the parameters are updated, the backoff time is recalculated, and a formal address is assigned to complete the networking.
[0103] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for half-duplex bus communication ad hoc network based on Poisson backoff model, characterized in that, include: Construct an RS485 half-duplex multi-node communication model. After the node is powered on, read its unique ID and generate a temporary communication address using the CRC16 algorithm to establish a unique identification relationship between the nodes. Differential voltage detection is performed based on an RS485 half-duplex multi-node communication model to obtain collision detection results; Based on the collision detection results, a Poisson backoff model based on RS485 half-duplex bus is constructed. Based on the Poisson backoff model, the expected Poisson distribution, load correction coefficient, and time slot length are generated to determine the number of backoff slots. Based on the number of backoff slots, time slot length, and load correction coefficient, the backoff delay of temporary address networking is generated, and the frame transmission timing is controlled to perform node delay backoff. The Poisson retreat model includes, The time slot length is obtained based on the communication rate, maximum frame length, and frame interval, and the backoff reference period for each node under the half-duplex bus is determined. The length of the time slot is expressed as: , in, This represents the duration of the initial backoff time slot, and is the base unit for calculating the backoff time at each node in the Poisson backoff model. This indicates the maximum data length of a single frame, reflecting the maximum frame capacity for a single data transmission in an RS485 half-duplex bus. Indicates the frame interval, describing the minimum transmission interval between consecutive data frames. This indicates the communication rate; it refers to the physical transmission rate parameter of the 485 bus. This represents the redundancy coefficient, which compensates for signal transmission delay and line propagation error. The Poisson retreat model also includes, The expected value of the Poisson distribution is determined based on the lower 8 bits of the node's unique identifier, and the expected value of the Poisson distribution is dynamically adjusted according to the number of collision detections to control the node backoff probability distribution. The expectation of the Poisson distribution is expressed as: , When a conflict occurs, the system dynamically adjusts the value, ensuring that the maximum expected value of the Poisson distribution is ≤8. The adjustment formula is as follows: , in, This represents the initial value of the expectation of the Poisson distribution. This represents the lower 8 bits of the node's unique identifier (UID) processed using the CRC16 algorithm, ranging from 0 to 255, used to generate the initial value of the node's unique Poisson distribution. This represents the mask constant for the bitwise AND operation, used to limit the range of values for the calculation result, ensuring that the initial values are distributed between 2 and 4, and different nodes... Base value dispersion This represents the dynamically adjusted expectation of the Poisson distribution after a conflict occurs. This represents the conflict correction factor, selected based on the conflict frequency range, reflecting the expected adjustment magnitude corresponding to the number of conflicts. The Poisson retreat model also includes, The load correction coefficient is generated based on the total number of online nodes and the maximum number of supported nodes, and the number of backoff slots is determined according to the adjusted Poisson distribution expectation. The load correction factor is expressed as: , in, Indicates the load correction factor. This indicates the total number of online nodes on the bus. Indicates the maximum number of nodes supported by the bus. The smaller the value, the higher the bus load, and the larger the backoff step size needs to be. At that time, take or set 0.1; Two-stage networking is performed based on the Poisson backoff model. The master node broadcasts the networking command and names the nodes. For nodes that do not respond, the parameters are updated, the backoff is recalculated, and a formal address is assigned to complete the networking. The two-stage networking includes The master node broadcasts the network formation command for the first time and names the nodes that have joined the network. For nodes that do not respond, it sends the updated Poisson distribution expectation and load correction coefficient, recalculates the number of backoff slots, and sends temporary addresses. After receiving all temporary addresses, the master node reallocates formal addresses to complete the self-organizing network process.
2. The Poisson backoff model based half duplex bus communication ad hoc network method of claim 1, wherein: The RS485 half-duplex multi-node communication model includes, It adopts a transceiver with bus protection, a differential output voltage range of ±2V~±6V, and an input impedance of not less than 12kΩ, and is equipped with 120Ω terminating resistors at both ends of the bus.
3. The Poisson backoff model based half duplex bus communication ad hoc network method according to claim 1 or 2, characterized by: The differential voltage detection includes, Real-time monitoring of the voltage change rate of bus A / B lines; comparison of the change rate with a change threshold within one bit cycle; execution of a timed interrupt to freeze the backoff counter when the threshold is exceeded. The change thresholds include determining a conflict when the rate of change within a period exceeds ±500mV / μs; Time-limited interruption and freeze This includes limiting the collision detection response time to no more than 0.5μs and setting the maximum number of collision detections per network session to three.
4. A Poisson backoff model based half duplex bus communication ad hoc network system using the Poisson backoff model based half duplex bus communication ad hoc network method according to any one of claims 1 to 3, characterized by: It includes a communication modeling module, a collision detection module, a backoff calculation module, and a network control module; The communication modeling module is used to construct an RS485 half-duplex multi-node communication model. After the node is powered on, it reads the unique ID and generates a temporary communication address through the CRC16 algorithm to establish a unique identification relationship between the nodes. The collision detection module is used to perform differential voltage detection based on the RS485 half-duplex multi-node communication model, monitor the voltage change rate of lines A / B in real time, determine collisions, and output collision detection results. The backoff calculation module is used to construct a Poisson backoff model based on the collision detection results, calculate the time slot length based on the communication rate, maximum frame length and frame interval, determine the Poisson distribution expectation in combination with the node's unique identifier, and generate the load correction coefficient and the number of backoff slots. The network control module is used to perform two-stage networking based on the Poisson backoff model. The master node broadcasts the networking command and names the nodes. For unresponsive nodes, the parameters are updated, the backoff time is recalculated, and a formal address is assigned to complete the networking.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the half-duplex bus communication self-organizing network method based on the Poisson backoff model as described in any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the half-duplex bus communication self-organizing network method based on the Poisson backoff model as described in any one of claims 1 to 3.