Dynamic priority based multi-node serial bus polling scheduling method and system
Patent Information
- Application Number
- CN202611416040.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]如果上述问题不能得到有效解决,主站在一个轮询周期内本应采回的多个从站模组数据会出现成片丢失,操作人员在监控画面上看到的是数据时有时无、刷新忽快忽慢,难以判断究竟是哪一个从站模组真正发生了故障,也难以判断数据丢失是设备问题还是总线时序问题
[0030]本申请的有益效果:本申请由轮询主控单元记录各从站模组的轮询请求发送时刻、响应到达时刻、通信成功标识、数据更新频率标识和功能重要性等级并汇集为时延状态表,把分散的时序数据与配置参数集中存放于同一数据结构,为后续通信成功率统计、响应时延波动幅度计算与动态优先级融合提供口径一致、来源统一的数据基础,避免了重复发起采集与数据口径不一的问题。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of bus scheduling technology, specifically to a method and system for multi-node serial bus polling scheduling based on dynamic priority. Background Technology
[0002] In existing RS485 bus polling scheduling methods, the master station typically sends polling requests to each slave module connected to the same pair of differential signal lines according to a pre-set polling order and interval. The requested slave module returns a data frame, and the master station receives the data frame before initiating polling for the next slave module, thus completing the periodic data acquisition from multiple slave modules on the bus. However, in actual field operation, the response delay experienced by each slave module from receiving the polling request to returning a data frame is inconsistent, and the response delay of the same slave module can fluctuate depending on its own load and field interference. After sending a polling request, the master station waits for a response within a fixed expected window. If the response from the previous slave module is delayed beyond the expected window, the delayed response will meet the bus occupancy caused by the next polling initiated by the master station on the timeline. This results in the same pair of differential signal lines being driven by two signal sources at the same time, causing the received data frame to be discarded due to a checksum error.
[0003] For example, in a power distribution monitoring site, a single 485 bus may simultaneously connect an energy metering module and multiple temperature and humidity monitoring modules. The register data frames returned by the energy metering module are often long, occupying the bus for an extended period. When the master station initiates the next polling cycle at a consistent pace, the tail of the delayed data frame from the energy metering module may coincide with the header of the next data frame returned by the temperature and humidity monitoring module. The master station will discard the combined data as an erroneous frame, resulting in the loss of both energy metering and temperature / humidity data. Another example is when a 485 bus passes near a frequency converter, and a slave module experiences interference causing its response time to fluctuate. If the master station continues to poll at fixed intervals, the delayed response from this slave module will repeatedly collide with the responses from adjacent slave modules, causing even normally communicating adjacent slave modules to frequently lose frames.
[0004] If the above problems are not effectively resolved, the master station will experience large-scale data loss from multiple slave modules that should be retrieved within a single polling cycle. Operators will see intermittent data display and inconsistent refresh rates on the monitoring screen, making it difficult to determine which slave module is truly malfunctioning, or whether the data loss is due to a device issue or a bus timing problem. Therefore, it is necessary to resolve the signal collision problem that repeatedly occurs at the response window boundaries of the slave modules on the 485 bus due to differences and fluctuations in response latency.
[0005] In view of this, this application proposes a multi-node serial bus polling scheduling method and system based on dynamic priority. Summary of the Invention
[0006] To achieve the above objectives, this application provides a multi-node serial bus polling scheduling method and system based on dynamic priority, the specific technical solution of which is as follows:
[0007] Firstly, this application provides a multi-node serial bus polling scheduling method based on dynamic priority, including:
[0008] The polling master control unit records the polling request sending time, response arrival time, communication success identifier, data update frequency identifier, and functional importance level of each slave module on the 485 bus, and compiles the recorded content into a delay status table according to the bus address of the slave module.
[0009] The communication success rate and response latency fluctuation of each slave module are determined based on the latency status table, and the communication success rate, data update frequency identifier and functional importance level are weighted and integrated into a dynamic priority.
[0010] A response window is defined for each slave module. A protection interval is configured for each slave module after the response delay fluctuation. The polling initiation time of each slave module is arranged from high to low according to dynamic priority. The protection interval of the subsequent slave module is reduced and the reduced time is added to the protection interval of the preceding slave module.
[0011] According to the polling initiation time after the arrangement, a polling request is initiated to each slave module, the measured response delay and communication success flag are written back to the delay status table, and the protection interval and polling initiation time of subsequent polling cycles are updated.
[0012] Preferably, the recording of the polling request sending time and response arrival time of each slave module on the 485 bus includes: the polling request sending time and response arrival time are taken from the timing unit inside the polling master control unit; the timing unit continues to count after the system is powered on, so that the polling request sending time and response arrival time are under the same time base.
[0013] Preferably, the step of collecting the recorded content into a delay status table according to the bus address of the slave module includes: each record in the delay status table corresponds to a slave module, and the fields of the record include the bus address of the slave module, the polling request sending time, the response arrival time, the communication success identifier, the data update frequency identifier, and the functional importance level; the time field and the communication success identifier field in the delay status table are refreshed in a rolling manner according to the polling cycle, and the earlier record is overwritten by the newly arrived record.
[0014] Preferably, the method for determining the communication success identifier includes: after the polling master control unit sends a polling request, it sets a waiting window. When the slave module returns a data frame within the waiting window and the verification is successful, the corresponding polling communication success identifier is recorded as successful; if the data frame returned by the slave module fails verification, or if no valid data frame is returned until the end of the waiting window, the communication success identifier is recorded as failed, and the corresponding response arrival time is recorded as invalid.
[0015] Preferably, determining the communication success rate of each slave module includes: polling the master control unit to count the communication success flags of each slave module within a sliding window, and comparing the number of successful flags with the total number of polls to obtain the communication success rate of the slave module; the length of the sliding window is determined according to the polling cycle length of the 485 bus and the number of connected slave modules.
[0016] Preferably, determining the response delay fluctuation range of each slave module includes: the polling master control unit subtracts the response arrival time from the polling request sending time within the same polling cycle to obtain the response delay of the slave module in the corresponding polling cycle; the dispersion of the response delay within the sliding window is used to characterize the response delay fluctuation range of the slave module, and the response delay fluctuation range is used as an indicator to measure the timing stability of the slave module.
[0017] Preferably, the step of weightedly integrating communication success rate, data update frequency identifier, and functional importance level into a dynamic priority includes: linearly mapping the data update frequency identifier and functional importance level according to their respective configured upper and lower limits to obtain normalized data update frequency identifier and normalized functional importance level; and weightedly summing the communication success rate, normalized data update frequency identifier, and normalized functional importance level to obtain the dynamic priority of the slave module.
[0018] Preferably, the weighting coefficients used in the weighted summation include: the weighting coefficient corresponding to the communication success rate, the weighting coefficient corresponding to the data update frequency identifier, and the weighting coefficient corresponding to the functional importance level, the sum of which is constrained to 1; each weighting coefficient is determined according to the degree of emphasis on communication quality, data timeliness, and functional importance in the scenario served by the 485 bus.
[0019] Preferred methods for updating dynamic priorities by weighted fusion include: recalculating the dynamic priority after each polling cycle by updating the latency status table, so that the communication success rate and response latency fluctuations reflect the bus status in the recent period; when multiple slave modules have the same dynamic priority value, the order of the slave modules' bus addresses is used as a supplementary basis for sorting, so that the sorting result remains unique.
[0020] Preferably, the step of defining a response window for each slave module and configuring a protection interval after the response window according to the response delay fluctuation amplitude includes: defining a response window for the slave module according to the expected response delay of the slave module, wherein the expected response delay is obtained by adding the average response delay within the sliding window to the time margin; and determining the protection interval of the slave module according to the response delay fluctuation amplitude of the slave module, wherein the protection interval configured for the slave module with a large response delay fluctuation amplitude is longer than that for the slave module with a small response delay fluctuation amplitude.
[0021] Preferably, configuring the protection interval after the response window includes: the protection interval is set on one side after the response window, without leaving space before the response window; the protection interval includes a basic protection interval covering the 485 bus transmit / receive switching and the minimum inter-frame idle time, and an additional protection duration calculated based on the fluctuation of the response delay.
[0022] Preferably, the polling initiation times of each slave module are arranged from high to low according to dynamic priority, including: the polling initiation times of slave modules with high dynamic priority are arranged first, and the polling initiation times of slave modules with low dynamic priority are arranged later; the interval between the end point of the response window of the previous slave module and the start point of the response window of the next slave module in two adjacent slave modules is not less than the protection interval located after the response window of the previous slave module, and the arranged polling initiation times are organized into a polling scheduling sequence.
[0023] Preferably, the reduction of the protection interval of the subsequent slave module and the addition of the reduced duration to the protection interval of the preceding slave module include: reducing a portion of the duration from the protection interval of the subsequent low dynamic priority slave module and adding it to the protection interval of the preceding high dynamic priority slave module, while keeping the total protection duration on the bus unchanged before and after the transfer; the protection interval of the slave module after the reduction is not lower than the lower limit of the protection interval, and the amount of addition to the high dynamic priority slave module does not exceed the upper limit of the addition.
[0024] Preferably, the activation conditions for adding the reduced duration to the protection interval of the preceding slave station module include: when the response delay fluctuation amplitude of the high dynamic priority slave station module is greater than that of the low dynamic priority slave station module, the protection duration is shifted from the side with smaller response delay fluctuation amplitude to the side with larger response delay fluctuation amplitude; when the protection interval of the low dynamic priority slave station module is reduced to the lower limit of the protection interval, the reduction is stopped with the lower limit of the protection interval as the boundary.
[0025] Secondly, this application also provides a multi-node serial bus polling scheduling system based on dynamic priority, which is used to implement the multi-node serial bus polling scheduling method based on dynamic priority, including: a status recording module, a priority fusion module, an interval scheduling module, and a write-back update module.
[0026] The status recording module is used by the polling master control unit to record the polling request sending time, response arrival time, communication success identifier, data update frequency identifier and functional importance level of each slave module on the 485 bus, and to collect the recorded content into a delay status table according to the bus address of the slave module.
[0027] The priority fusion module is used to determine the communication success rate and response delay fluctuation of each slave module based on the delay status table, and to weight and fuse the communication success rate, data update frequency identifier and functional importance level into a dynamic priority.
[0028] The interval scheduling module is used to define a response window for each slave module, configure a protection interval for each slave module after the response window according to the response delay fluctuation amplitude, arrange the polling initiation time of each slave module from high to low according to dynamic priority, reduce the protection interval of subsequent slave modules, and add the reduced duration to the protection interval of preceding slave modules.
[0029] The write-back update module is used to send polling requests to each slave module according to the polling initiation time after the arrangement, write back the measured response delay and communication success flag to the delay status table, and update the protection interval and polling initiation time of subsequent polling cycles.
[0030] The beneficial effects of this application are as follows: This application uses a polling master control unit to record the polling request sending time, response arrival time, communication success identifier, data update frequency identifier, and functional importance level of each slave module and aggregates them into a latency status table. This centralizes the scattered time-series data and configuration parameters into the same data structure, providing a consistent and unified data foundation for subsequent communication success rate statistics, response latency fluctuation amplitude calculation, and dynamic priority fusion, thus avoiding the problems of repeated data collection and inconsistent data standards.
[0031] This application determines the communication success rate and response delay fluctuation based on the delay status table and weights them into a dynamic priority. It converts link quality, data timeliness, and functional importance into a single value under the same dimension, so that the demand for bus time resources of each slave module can be measured under a unified standard. This overcomes the shortcomings of fixed polling, which cannot distinguish between the communication quality and functional importance of slave modules.
[0032] This application configures protection intervals after the response window according to the response delay fluctuation amplitude, arranges the polling initiation time according to dynamic priority, and redistributes protection intervals between the preceding and following slave modules. This transfers the limited protection time from slave modules with small response delay fluctuation amplitudes to slave modules with large response delay fluctuation amplitudes and high dynamic priority. Without increasing the total bus protection time, it separates adjacent responses on the time axis and reduces signal collisions at the response window boundaries.
[0033] This application initiates polling requests according to the polling initiation time after the arrangement, writes the measured response delay and communication success flag back to the delay status table and updates it periodically, and feeds back the measured results of each polling to the priority calculation and protection interval configuration of the subsequent cycle, so that the polling timing continuously and adaptively adjusts with the changes in bus operating conditions, making up for the shortcomings of static configuration that cannot follow the increase or decrease of slave modules, load changes and interference fluctuations.
[0034] The technical solution of this application incorporates the communication success rate, data update frequency identification, and functional importance level of the slave module into a unified dynamic priority, and accordingly performs differentiated configuration and reallocation of the limited protection time on the bus. In the field of 485 bus multi-module communication, there is no need to add wiring or replace transceivers. It can reduce signal collisions at the response window boundary, maintain the polling timing determinism of important slave modules, and improve the real-time performance and reliability of bus communication in building automation, power distribution monitoring, and production line equipment networking. Attached Figure Description
[0035] Figure 1 Flowchart of the multi-node serial bus polling scheduling method based on dynamic priority provided in this application;
[0036] Figure 2 A topology diagram of 485 bus multi-module communication provided in this application;
[0037] Figure 3 A schematic diagram of the response delay fluctuation amplitude provided in this application;
[0038] Figure 4 A weighted fusion diagram of dynamic priority provided for this application;
[0039] Figure 5 A schematic diagram of the protection interval following the response window provided in this application;
[0040] Figure 6 A schematic diagram of the write-back closed loop for the measured results provided in this application;
[0041] Figure 7 The structure diagram of the multi-node serial bus polling scheduling system based on dynamic priority provided in this application. Detailed Implementation
[0042] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0043] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0044] Secondly, the term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of this application. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single embodiment or an embodiment selectively excluded from other embodiments.
[0045] Example 1
[0046] Reference Figures 1 to 6 This is the first embodiment of the present application, such as Figure 1 As shown, a multi-node serial bus polling scheduling method based on dynamic priority is provided.
[0047] The RS-485 bus is a commonly used serial communication bus in industrial settings. It transmits signals over a pair of twisted differential signal lines, using the voltage difference between the two lines as the logic level criterion. Common-mode interference superimposed on the two lines is canceled out during differential reception, enabling stable transmission at medium to low baud rates over distances of hundreds or even thousands of meters. It is widely used in building automation, power distribution monitoring, and production line equipment networking. In engineering applications, RS-485 buses typically use a two-wire half-duplex connection, sharing the same pair of differential signal lines for both transmission and reception. Only one node is allowed to drive the bus at a time, and the RS-485 transceiver requires a switching time when switching from transmit to receive mode.
[0048] Multiple nodes can be connected to the same pair of differential signal lines, presenting a multi-point access topology. To ensure orderly time-division multiplexing of transmission and reception on the same pair of signal lines, a master-slave polling mechanism is commonly used in engineering. A master station is located on the bus, and the remaining nodes act as slave stations, each assigned a unique bus address. The master station sends polling requests one by one according to the address. Slave stations whose addresses match return data frames, while those with mismatched addresses remain in receiving mode, thus ensuring that only one slave station occupies the bus at any given time. Data exchange on the bus typically follows a Modbus-RTU-like communication protocol. A minimum specified number of characters of free space must be maintained between adjacent data frames, and the receiver uses this free space to demarcate the boundaries of data frames.
[0049] As the number of connected slave modules increases, the response delay experienced by each slave module from receiving a polling request to returning a response varies and fluctuates with the slave module load and field interference. After the master station sends a polling request, it waits for a response within the expected time window. If the response of the previous slave module is delayed beyond the expected window, the tail of the delayed response will overlap with the bus occupancy caused by the subsequent polling on the time axis. The two signal sources drive the same pair of differential signal lines at the same time, and the level on the bus no longer corresponds to the valid data of either side. The data frame received by the receiver is discarded due to check errors, resulting in response loss, data frame errors, and polling clock disorder. Furthermore, the more slave modules connected, the more frequently signal collisions occur at the response window boundary. The signal collisions at the response window boundary are referred to as boundary overlap in the following text.
[0050] Existing 485 bus polling methods mostly employ a fixed polling order and fixed polling interval, polling all slave modules on the bus sequentially without considering the differences and fluctuations in the response latency of slave modules. The intervals allocated to slave modules with stable responses are too large, wasting bus time, while the intervals allocated to slave modules with large response fluctuations are insufficient to accommodate delayed responses. Furthermore, the fixed method does not differentiate between slave modules based on data timeliness and functional importance; slave modules responsible for protection interlocking and requiring fast data updates are polled at the same pace as those used only for auxiliary display and requiring slower data updates. This embodiment aims to address the issue of reducing signal collisions at the response window boundaries on a 485 bus with numerous connected slave modules and significant differences in their response latency, while maintaining the polling sequence of slave modules performing important functions and being time-sensitive.
[0051] The multi-node serial bus polling scheduling method based on dynamic priority provided in this embodiment is applied to a half-duplex communication system with one polling master control unit as the master station and multiple slave modules connected to the same pair of 485 differential signal lines. The polling master control unit executes steps S1 to S4. The polling master control unit performs both conventional polling and transmitting functions and schedules the polling timing of each slave module on the bus. The entire method in this embodiment uses a delay status table maintained by the polling master control unit as its data foundation. It measures the slave module's demand for bus time resources using a dynamic priority derived from the slave module's communication success rate, data update frequency identifier, and functional importance level. It configures a protection interval after the response window based on the response delay fluctuation amplitude and concentrates the limited protection time on timing-sensitive slave modules through the redistribution of protection intervals among them. Ultimately, it reduces collisions at the response window boundaries without increasing the total bus protection time.
[0052] Figure 2 This demonstrates the topology of multi-module communication via a 485 bus. Figure 2On the left is the polling master control unit, which serves as the master station. A pair of 485 differential signal lines are led out to the right, with terminating resistors connected to both ends of the bus. Several slave modules are connected to the same pair of differential signal lines, labeled as energy metering, temperature and humidity monitoring, motion control, safety interlocking, etc. The end is indicated by a dashed line to show more slave modules. Figure 2 The master station polls each slave module one by one according to its address, and notes that each slave module has a unique bus address and only one slave module is busy at any given time.
[0053] Step S1: The polling master control unit records the polling request sending time, response arrival time, communication success identifier, data update frequency identifier, and functional importance level of each slave module on the 485 bus, and aggregates the recorded content into a delay status table according to the bus address of the slave module.
[0054] When recording timing data, the polling master control unit records the time of sending the polling request each time it sends a polling request to a slave module; and records the time of arrival of the response when it receives a data frame returned by the slave module. The time of sending the polling request and the time of arrival of the response are taken from the timing unit inside the polling master control unit. The timing unit continues to count after the system is powered on. The two times are under the same time base, and the time difference can be directly obtained by subtracting them without the need for conversion.
[0055] The success of a polling operation is determined based on two conditions: the data frame verification result and whether a response is returned within the waiting window. After issuing a polling request, the polling master unit maintains a waiting window. When the slave module returns a data frame within the waiting window and the verification passes, the communication success flag for the corresponding poll is marked as successful. If the data frame returned by the slave module fails verification, or if no valid data frame is returned by the end of the waiting window, the communication success flag is marked as failed, and the corresponding response arrival time is marked as invalid. The communication success flag is stored as a single bit, requiring minimal storage space and facilitating accumulation in subsequent statistics.
[0056] The data update frequency identifier and functional importance level are not collected in real time during the polling process, but are determined by field configuration during the 485 bus networking and debugging phase, and stored in the polling master control unit as inherent attributes of the slave modules in subsequent calculations. The data update frequency identifier indicates how quickly the data collected by the slave module changes over time. Slave modules such as power metering and motion control update data faster, so their data update frequency identifier values are higher; slave modules such as temperature and humidity monitoring update data slower, so their data update frequency identifier values are lower. The functional importance level indicates the importance of the slave module in the system. Slave modules related to safety interlocking and protection actions have higher functional importance values, while slave modules used only for auxiliary display have lower functional importance values.
[0057] The polling master control unit establishes a delay status table based on the bus addresses of the slave modules, centrally storing timing data and configuration parameters. Each record in the delay status table corresponds to a slave module, and the record's fields include the slave module's bus address, the time of sending polling requests and the time of receiving responses for the most recent polling cycles, the corresponding communication success flag, and the configured data update frequency flag and functional importance level. As polling progresses, the time field and the communication success flag field in the delay status table are refreshed according to the polling cycle, storing only records from the most recent period; earlier records are overwritten by newly arrived records, thus keeping the storage size of the delay status table within a fixed range.
[0058] A unified delay status table is maintained on the polling master control unit side. The timing data and configuration parameters of each slave module are centrally stored in the same data structure. Subsequent steps directly read from the delay status table during processing, eliminating the need to repeatedly initiate polling to obtain the same data. Centralized storage also ensures that the source of timing data and configuration parameters remains consistent, avoiding the use of different data in different steps. The delay status table recorded and maintained in step S1 provides a unified data source for subsequent communication success rate statistics, response delay fluctuation calculation, and dynamic priority fusion.
[0059] Step S2: Determine the communication success rate and response delay fluctuation of each slave module based on the delay status table, and weight and merge the communication success rate, data update frequency identifier and functional importance level into a dynamic priority.
[0060] Specifically, first, the time field in the latency status table is restored to the response latency. For any slave module, the polling master unit subtracts the response arrival time from the polling request sending time within the same polling cycle to obtain the slave module's response latency for the corresponding polling cycle. The response latency can be expressed as... ,in This is the serial number of the slave module. This represents the sequence number of the polling cycle within the sliding window. For the first The slave module in the first The polling request sending time for each polling cycle For the first The slave module in the first The response arrival time for each polling cycle. For the first The slave module in the first Response latency per polling cycle.
[0061] In 485 bus half-duplex communication, the response latency of a slave module is composed of the processing time after receiving a polling request, the framing time, and the data frame transmission time on the bus, and varies with the baud rate, data frame length, and slave module load. The polling master unit does not distinguish whether the response latency comes from processing, framing, or transmission; it only uses the difference between the polling request sending time and the response arrival time as the response latency, using a uniform method to characterize the performance of each slave module on the time axis. Polling cycles that mark successful communication as failure and response arrival times as invalid are not included in the response latency calculation to avoid invalid times contaminating the statistical results.
[0062] To determine the communication success rate, the polling master control unit counts the communication success flags for each slave module within a sliding window. The ratio of the number of successful flags to the total number of polls is used to obtain the communication success rate of the slave module. The communication success rate can be expressed as... ,in For the first The number of successful communications between each slave module within the sliding window is recorded as the number of successful communications. For the first The total number of polling times for each slave module within the sliding window. For the first The communication success rate of each slave module. The communication success rate reflects the current link quality of the slave module. Slave modules with good link contact and less interference have a higher communication success rate, while slave modules with oxidized wiring and more interference have a lower communication success rate.
[0063] The length of the sliding window is determined by the polling cycle length of the 485 bus and the number of connected slave modules. If the sliding window length is too small, the statistical results of communication success rate and response latency fluctuations will jump with the success or failure of individual data frames, resulting in unstable statistical results. If the sliding window length is too large, the statistical results will be slower to follow changes in bus conditions, and changes in slave module conditions will not be reflected in the statistical results for a long time. The sliding window length needs to strike a balance between statistical stability and speed of follow-up. For example, for a 485 bus with dozens of connected slave modules, the sliding window length can be taken as the 15 most recent polling cycles, that is, each slave module participates in the statistics based on the records of the most recent 15 polling cycles.
[0064] The response delay fluctuation amplitude is used to characterize the temporal dispersion of the response returned by the slave module, and is a key indicator that needs to be determined in step S2. Considering that the response delay of the slave module on the 485 bus is affected by the internal processing time of the slave module, bus load, and electrical interference, the dispersion of the response delay should not be characterized solely by single response delay or average response delay. Even slave modules with a small average response delay may still experience individual responses that are significantly delayed, and these delayed responses are the source of collisions at the response window boundaries. The average response delay alone cannot reflect this possibility of delay. The response delay fluctuation amplitude measures the response delay from the perspective of dispersion; a large dispersion means that the slave module's response time fluctuates greatly and the possibility of delay is high. The response delay fluctuation amplitude can be characterized by the standard deviation of the response delay within the sliding window, which can be expressed as... The successful communication within the summation traversal of the sliding window is marked as successful. One polling cycle, For the first Each slave module is within the sliding window. The average response latency over a successful polling cycle, i.e., the average response latency within the sliding window. For the first The response latency fluctuation of each slave module and The meaning is consistent with the previous text. The response delay fluctuation amplitude, as an indicator for measuring the timing stability of the slave module, is reserved separately for use in step S3 when configuring the protection interval.
[0065] Figure 3 Using a timeline to compare the two slave modules, we can explain the meaning of the response delay fluctuation amplitude. Figure 3 The top module shows a stable response, with multiple response arrival times appearing together on the timeline from the time the polling request was sent, indicating small fluctuations. The bottom module shows a fluctuating response, with multiple response arrival times appearing scattered on the timeline from the time the polling request was sent, indicating large fluctuations. Figure 3 The following notes indicate that this metric is obtained within a sliding window based on the degree of dispersion of the arrival time of each response relative to the sending time of the polling request.
[0066] To incorporate the communication success rate, data update frequency identifier, and functional importance level—which have inconsistent value ranges—into the same priority evaluation, the polling master control unit first performs dimensional processing on all three. The communication success rate, inherently between 0 and 1, requires no further normalization. The data update frequency identifier and functional importance level are discrete levels obtained through configuration, with value ranges inconsistent with the communication success rate, and need to be mapped to a range of 0 to 1. The normalization of the data update frequency identifier can employ a linear mapping between the configured value and its upper and lower limits, which can be expressed as: ,in For the first The configuration value of the data update frequency identifier for each slave module. This serves as the lower limit for the value of the data update frequency identifier. This represents the upper limit of the data update frequency identifier. For the first The normalized data update frequency identifier for each slave station module. The normalization of functional importance levels can also use the same form of linear mapping, which can be expressed as... ,in For the first The configuration values for the functional importance level of each slave station module. This represents the lower limit of the functional importance level. This represents the upper limit of the functional importance level. For the first The functional importance level of each station module after normalization.
[0067] The upper and lower limits of the normalization values are set according to the level range used during configuration, and are taken from the minimum and maximum levels agreed upon for the two parameters during field networking. For example, when both the data update frequency identifier and the functional importance level are configured according to integer levels from 1 to 5, normalization uses 1 as the lower limit and 5 as the upper limit for linear mapping. The configuration value of level 1 is mapped to 0, the configuration value of level 5 is mapped to 1, and levels between the two are mapped proportionally to the range of 0 to 1.
[0068] After completing the dimensional processing, the polling master control unit performs a weighted sum of the three normalized parameters to obtain the dynamic priority of the slave module. The dynamic priority can be expressed as... ,in The weighting coefficient corresponding to the communication success rate. The weight coefficients are used to indicate the update frequency of the normalized data. These are the weighting coefficients corresponding to the normalized functional importance levels. For the first The dynamic priority of each slave module. The dynamic priority converts link quality, data timeliness and functional importance into a numerical value. Slave modules with higher values have a greater demand for bus time resources and are arranged first when polling is initiated.
[0069] Figure 4 This demonstrates the composition of dynamic priorities. Figure 4The left side of the middle section contains three inputs: communication success rate, data update frequency identifier, and functional importance level. Each input is labeled with the link quality, data timeliness, and functional importance it reflects. The three inputs are connected to the weighted fusion node in the middle section through their respective weights and are fused under the same scale. The right side outputs the dynamic priority. Figure 4 The following notes indicate that the three weights are set according to the emphasis of the service scenario, and their sum is a fixed value. The larger the output value, the greater the demand for bus time resources.
[0070] The weighting coefficients in the dynamic priority calculation formula are determined according to the emphasis placed on communication quality, data timeliness, and functional importance by the scenarios served by the 485 bus. The sum of the three weighting coefficients is constrained to 1 to ensure that the dynamic priority value still falls between 0 and 1. The stronger the emphasis on functional importance by the scenario, the larger the weighting coefficient corresponding to the functional importance level; the stronger the emphasis on data timeliness by the scenario, the larger the weighting coefficient corresponding to the data update frequency identifier; in scenarios with more bus interference and greater fluctuations in link quality, the weighting coefficient corresponding to communication success rate is larger. For example, in a scenario that balances data acquisition and status monitoring, the weighting coefficient corresponding to communication success rate can be 0.3, the weighting coefficient corresponding to the data update frequency identifier can be 0.3, and the weighting coefficient corresponding to the functional importance level can be 0.4.
[0071] Dynamic priority is not calculated once, but recalculated after each polling cycle when the latency status table is refreshed. This ensures that the communication success rate and response latency fluctuations always reflect the bus status over a recent period. When a slave module experiences consecutive communication failures over a period of time, the communication success rate decreases, and the dynamic priority of the slave module decreases accordingly. When the slave module's communication returns to a stable state, the communication success rate recovers, and the dynamic priority recovers accordingly. This cycle-by-cycle recalculation ensures that the dynamic priority follows the changes in bus operating conditions, rather than remaining at the static value set at the initial stage of network deployment.
[0072] When multiple slave modules calculate the same dynamic priority value, the polling master unit uses the order of the slave modules' bus addresses as a supplementary basis for sorting, ensuring the sorting result remains unique and preventing repeated sorting of slave modules with the same dynamic priority between adjacent polling cycles, which would cause fluctuations in the polling initiation time. After processing in step S2, the polling master unit measures the demand for bus time resources of each slave module under the same dimension, obtains the dynamic priority updated cycle by cycle, and outputs the response delay fluctuation amplitude, which characterizes the timing stability of the slave modules. Both results are provided to step S3 for configuring the protection interval and arranging the polling initiation time.
[0073] Step S3: Define a response window for each slave module, configure a protection interval for each slave module after the response delay fluctuation range, arrange the polling initiation time of each slave module from high to low according to dynamic priority, reduce the protection interval of subsequent slave modules, and add the reduced duration to the protection interval of preceding slave modules.
[0074] First, a response window is defined on the 485 bus for each slave module. The response window refers to the time period from the issuance of the polling request to the expected completion of the slave module's response; it defines the expected time period occupied by the slave module on the bus. The length of the response window is determined according to the expected response delay of the slave module. The expected response delay can be obtained by adding the average response delay within the sliding window to a time margin. The length of the response window is taken as the expected response delay, which can be expressed as: ,in As a time margin, For the first Response window length of each slave module The meaning is consistent with the previous text. The time margin is used to cover the normal deviations beyond the average response delay, so that in most cases the response from the slave module can return within the response window. The start point of the response window is the polling initiation time, and the end point is the expected response completion time.
[0075] Due to fluctuations in response latency, the actual return time of a slave module's response may fall after the expected boundary of the response window. If a subsequent polling request is sent too early, the start of the response from the later slave module will meet the tail of the delayed response from the earlier slave module on the 485 bus, resulting in the boundary overlap scenario mentioned earlier. To reduce boundary overlap, the polling master unit leaves a protection interval after the response window of each slave module, delaying the initiation time of the later polling request by a certain period to accommodate the out-of-bounds portion caused by response latency fluctuations. The protection interval separates the tail of the response from the earlier slave module from the header of the response from the later slave module on the time axis.
[0076] It's important to note that the protection interval is set on one side after the response window, rather than being allocated before it. This is because timing conflicts on the 485 bus arise from the delayed arrival of responses relative to the expected boundary. Late responses simply extend further down the timeline, and the period before the response window does not present any collision risk associated with late responses. By concentrating the protection duration after the response window, the limited protection time is used to cover the actual time the response might extend into, rather than being distributed across the non-collision-prone preceding period. This ensures more efficient use of the equal amount of protection time. If the protection interval were evenly allocated before and after the response window, the protection time at the front would not help reduce boundary overlap, while the protection time at the back, intended to accommodate late responses, would be reduced.
[0077] Figure 5 The timeline illustrates the positional relationship between the protection interval and the response window; the response window begins at the time the polling is initiated, the window endpoint is the window boundary, the protection interval is immediately following the window boundary, and no additional protection interval is set before the window; the protection interval is used to accommodate the extension of late responses, and the next response begins after it. Figure 5 The expected response time period is indicated in parentheses.
[0078] The length of the protection interval is determined based on the response delay fluctuation amplitude of the slave station module. Slave station modules with larger response delay fluctuation amplitudes are more likely to be late, and are configured with longer protection intervals; slave station modules with smaller response delay fluctuation amplitudes are configured with shorter protection intervals. The relationship between the protection interval and the response delay fluctuation amplitude can be expressed as follows: ,in This is the proportionality coefficient for the change in the protection interval as the response delay fluctuation amplitude varies. Based on the protection interval, For the first The protection interval of each station module This refers to the response delay fluctuation amplitude mentioned above. The basic protection interval is used to cover the fixed time occupied by the 485 bus transmit / receive switching and the minimum idle time between frames, and the proportional coefficient is used to convert the response delay fluctuation amplitude into an additional protection duration.
[0079] The basic protection interval is determined by the switching time required for the 485 bus transceiver to switch from transmitting to receiving and the minimum inter-frame idle time specified by the communication protocol. The sum of these two is taken as an incompressible fixed duration. Taking the Modbus-RTU protocol as an example, a minimum of 3.5 character transmission times must be maintained between data frames. For example, on a 485 bus with a baud rate of 9600, the basic protection interval can be set to the duration corresponding to 3.5 character transmission times. The scaling factor is determined based on the impact of response delay fluctuations on the probability of boundary overlap. If the scaling factor is too small, a delayed response may still exceed the protection interval; if the scaling factor is too large, the bus time occupied by the protection interval will be too long. For example, a scaling factor of 3 can be taken, meaning the additional protection duration is 3 times the amplitude of the response delay fluctuation.
[0080] After determining the protection interval for each slave module, the polling master control unit arranges the polling initiation times of each slave module in descending order of dynamic priority obtained in step S2. Slave modules with higher dynamic priority are arranged first, followed by those with lower dynamic priority. The polling master control unit sequentially assigns a response window and the protection interval following the response window to each slave module, ensuring that the interval between the end of the response window of one slave module and the beginning of the response window of the next slave module is not less than the protection interval following the response window of the previous slave module, thus separating adjacent responses on the time axis. The polling master control unit organizes the arranged polling initiation times of each slave module into a polling scheduling sequence. Each item in the polling scheduling sequence corresponds to a slave module and its corresponding polling initiation time, response window, and protection interval. The sequence starts with the slave module with the highest dynamic priority and ends with the slave module with the lowest dynamic priority.
[0081] Based on the polling initiation time arranged according to dynamic priority, step S3 further redistributes the protection intervals of each slave module. Considering that the total protection time available for the 485 bus within the same time period is limited, if the protection intervals of all slave modules are lengthened to cope with response delay fluctuations, the effective time for bus response will be reduced, and the number of polls that can be completed per unit time will decrease. In order to provide sufficient boundary margins for timing-sensitive slave modules without increasing the total protection time, the polling master control unit redistributes the protection intervals during the arrangement process. That is, a portion of the protection interval is reduced from the protection intervals of the lower dynamic priority slave modules arranged later (i.e., subsequent slave modules) and added to the protection intervals of the higher dynamic priority slave modules arranged earlier (i.e., preceding slave modules). The redistribution simply transfers the protection time between slave modules, and the total protection time on the bus before and after the transfer remains unchanged.
[0082] Protection interval redistribution proceeds in ascending order of dynamic priority. The modules with the lowest dynamic priority are reduced, while those with the highest dynamic priority are added. To prevent frequent boundary overlap of low-priority slave modules due to protection interval reduction, the protection interval of the reduced slave modules is not lower than the set lower limit. To prevent high-priority slave modules from consuming excessive protection time, the amount of addition to high-priority slave modules does not exceed the set upper limit. The lower and upper limits of protection intervals together constrain redistribution within a reasonable range, ensuring that redistribution does not reduce the protection time of low-priority slave modules to insufficient coverage of fixed timing overhead, nor does it indiscriminately add protection intervals to high-priority slave modules.
[0083] The lower limit of the protection interval is determined based on the fixed time required for the minimum idle time between 485 bus transmit / receive switching and inter-frame transitions. Its value is consistent with the basic protection interval, ensuring that any slave module retains sufficient protection time to cover the fixed timing overhead after reallocation, preventing immediate boundary overlap due to reduction. The upper limit of the supplement is determined based on the boundary margin that a single response from a high-dynamic-priority slave module can tolerate, preventing the protection interval of a single slave module from being excessively long and encroaching on the bus time of other slave modules. For example, the lower limit of the protection interval can be equal to the basic protection interval, and the upper limit of the supplement for a single high-dynamic-priority slave module can be one times the basic protection interval. That is, after supplementation, the protection interval of the high-dynamic-priority slave module does not exceed the sum of the original protection interval and one times the basic protection interval.
[0084] Protection interval reallocation is initiated when the distribution of response delay fluctuation amplitude becomes uneven. When the response delay fluctuation amplitude of a slave module with higher dynamic priority is greater than that of a slave module with lower dynamic priority, the high dynamic priority slave module has a greater need for boundary margin than the low dynamic priority slave module. Reallocation shifts the protection duration from the side with less demand to the side with greater demand. When the response delay fluctuation amplitudes of each slave module are similar, the transfer amount of reallocation approaches zero. Each slave module maintains the protection interval configured according to its own response delay fluctuation amplitude. Reallocation is based on the distribution of response delay fluctuation amplitude, allocating the protection duration to the slave module that needs it most.
[0085] When the protection intervals of the lowest-priority slave modules are reduced to the lower limit of the protection interval, and this is still insufficient to meet the replenishment needs of higher-priority slave modules, the polling master control unit stops further reduction at the lower limit of the protection interval. The replenishment amount of higher-priority slave modules is determined according to the actual transferable duration, and no longer exceeds the lower limit of the protection interval. Through the restriction processing based on the lower limit of the protection interval and the upper limit of replenishment, the basic timing safety of the low-priority slave modules is preserved, and the replenishment of high-priority slave modules is completed within the transferable range, and the reallocation will not exceed the constraints.
[0086] For example, suppose five slave modules are connected to a 485 bus. After sorting them according to dynamic priority from high to low, the slave module with the highest dynamic priority has a larger response delay fluctuation, and the protection interval is calculated to be 2 milliseconds based on the relationship between the protection interval and the response delay fluctuation. The slave module with the lowest dynamic priority has a smaller response delay fluctuation, and the calculated protection interval is 0.8 milliseconds. With a lower limit of 0.5 milliseconds for the protection interval and an upper limit of one times the basic protection interval for a single slave module, the polling master unit reduces the 0.3 milliseconds from the 0.8 millisecond protection interval of the slave module with the lowest dynamic priority, lowering its protection interval to 0.5 milliseconds. This reduced 0.3 milliseconds is then added to the protection interval of the slave module with the highest dynamic priority, increasing its protection interval to 2.3 milliseconds. After this reallocation, the slave module with the highest dynamic priority gains more margin at the response window boundary, while the total protection duration of the five slave modules on the 485 bus remains unchanged.
[0087] The protection intervals are redistributed according to dynamic priority, decreasing from low to high and increasing from high to low, concentrating the limited protection time on the 485 bus towards timing-sensitive and important slave modules. Since the redistribution only transfers protection time between slave modules, the total protection time on the bus does not continuously increase with increased response delay fluctuations, maintaining the number of polling times per unit time, and ensuring the effective response time of the bus is not reduced due to fluctuations. When the 485 bus is interfered with and the response delay fluctuations of each slave module increase, the slave modules with higher dynamic priority gain more boundary margin through redistribution, reducing the possibility of overlap at the response window boundaries and stabilizing timing performance. Therefore, the more fluctuating the bus operating conditions, the more the polling timing determinism of the slave modules performing important functions is maintained, rather than deteriorating with increased fluctuations. The protection intervals of each slave module output in step S3 and the polling initiation time after the arrangement serve as the basis for actually initiating polling in step S4.
[0088] Step S4: Initiate polling requests to each slave module according to the polling initiation time after the arrangement, write the measured response delay and communication success flag back to the delay status table, and update the protection interval and polling initiation time of subsequent polling cycles.
[0089] According to the polling scheduling sequence obtained in step S3, the polling master control unit initiates polling for each slave module. At the polling initiation time corresponding to each slave module, the polling master control unit sends a polling request to each slave module and retains the corresponding protection interval between two adjacent polling initiation times. After sending each polling request, the polling master control unit waits for the response from the corresponding slave module, records the response arrival time, and gives a communication success identifier for the corresponding polling based on the data frame verification result and whether it returns within the waiting window.
[0090] For each polling cycle, the polling master unit uses the difference between the response arrival time and the polling request sending time as the measured response latency, and writes it back to the corresponding slave module's record in the latency status table along with the obtained communication success flag. During the write-back, the data from the earliest polling cycle is overwritten according to the length of the sliding window, ensuring that the latency status table always stores the most recent time-series data and communication results. The write-back of the measured response latency keeps the response latency sequence in the latency status table updated with each polling cycle, and the write-back of the communication success flag keeps the statistical basis of the communication success rate updated with each polling cycle.
[0091] Figure 6 This demonstrates the write-back closed loop in step S4. Figure 6 The upper part initiates a polling request to the slave module, thereby obtaining the measured response delay and communication success flag for this polling, and writes both back to the delay status table; after the left loop label is written back, it drives the subsequent cycles to rearrange, and the right label is rolled over by the sliding window to cover the earliest record. Figure 6 The following notes indicate that the protection interval and polling initiation time are updated periodically after the write-back, forming a closed loop.
[0092] After the latency status table is updated, the polling master control unit re-executes steps S2 and S3 in the next polling cycle. Based on the refreshed communication success rate and response latency fluctuation, it recalculates the dynamic priority of each slave module, reconfigures the protection interval of each slave module, reallocates the protection interval, and rearranges the polling initiation time. The protection interval and polling initiation time are updated cycle by cycle according to the operating status of the 485 bus, rather than remaining at a value calculated in a certain cycle. After the operating conditions change, the updated protection interval and polling initiation time can be reflected in subsequent polling cycles.
[0093] It should be noted that when a slave module fails to return a valid response for several consecutive polling cycles, the polling master unit marks the corresponding slave module as offline in the delay status table. When scheduling polling initiation times, it reserves a probing period for the offline slave module, without allocating supplementary protection time to it, thus preventing the offline slave module from occupying bus time that could be allocated to online slave modules. The number of consecutive non-response cycles used to determine offline status is set according to the polling cycle length of the 485 bus. A value that is too small may misjudge slave modules that occasionally drop frames as offline, while a value that is too large may delay marking slave modules that have been offline for extended periods. For example, three consecutive polling cycles without a valid response can be used as the condition for marking as offline. When the offline slave module returns a valid response during the probing period, the polling master unit removes the offline mark, and the corresponding slave module re-participates in dynamic priority calculation and protection interval reallocation.
[0094] The measured response delay and communication success flag are written back to the delay status table and drive the rearrangement in subsequent cycles. Polling scheduling no longer relies on a one-time static configuration, but is continuously adjusted according to changes in the communication quality and timing stability of each slave module on the 485 bus. The addition or removal of slave modules, load changes, and interference fluctuations that occur during 485 bus operation are all reflected in the dynamic priority and protection interval through the write-back, making the polling timing adapt to the current operating conditions. When a slave module experiences increased response delay fluctuations due to poor contact or interference, the written-back data allows the slave module to obtain a longer protection interval or more boundary margin in subsequent cycles. When the communication of the slave module returns to stability, the written-back data causes the protection interval and boundary margin of the slave module to decrease. Steps S1 to S4 form a closed loop. Steps S1 and S4 are responsible for the acquisition and writing back of timing data, while steps S2 and S3 are responsible for the calculation of dynamic priority and the arrangement of polling timing. The measured response delay obtained from the writing back is used as the input for the next round of calculation. After multiple polling cycles, the polling timing tends to a relatively stable arrangement according to the bus operating conditions.
[0095] Combining steps S1 to S4, this embodiment uses the delay status table maintained by the polling master control unit as the data foundation. It measures the bus time resource requirements of each slave module by using a dynamic priority derived from the fusion of communication success rate, data update frequency identifier, and functional importance level. A protection interval located after the response window is configured based on the response delay fluctuation amplitude. Through the redistribution of protection intervals among slave modules, the limited protection duration is concentrated on time-sensitive, high-dynamic-priority slave modules. Without increasing the total bus protection duration, adjacent responses are separated on the time axis, reducing signal collisions at the response window boundaries on the 485 bus. When bus operating conditions fluctuate, the polling timing of slave modules performing important functions remains relatively stable, maintaining the real-time performance and reliability of bus communication. With the write-back and cycle-by-cycle update in step S4, polling scheduling can adaptively adjust according to the bus operating status. This method is suitable for 485 bus multi-module communication scenarios with a large number of connected slave modules and significant differences in response delay among them.
[0096] The values given above for the number of slave modules, baud rate, sliding window length, weighting coefficient, basic protection interval, proportional coefficient, lower limit of protection interval, upper limit of supplementary protection interval, and number of offline judgment cycles are all exemplary values used to illustrate the setting method of each parameter and do not constitute a limitation on the range of values. Without departing from the methodological concept, implementation methods obtained by adjusting each parameter according to the actual baud rate of the 485 bus, the number of connected slave modules, and the field interference situation still fall within the scope of the method described in this embodiment.
[0097] Example 2
[0098] Reference Figure 7 This is the second embodiment of the present application, which provides a multi-node serial bus polling scheduling system based on dynamic priority.
[0099] The system includes: a status recording module, a priority fusion module, an interval scheduling module, and a write-back update module.
[0100] The status recording module is used by the polling master control unit to record the polling request sending time, response arrival time, communication success identifier, data update frequency identifier, and functional importance level of each slave module on the 485 bus, and to aggregate the recorded content into a delay status table according to the bus address of the slave module.
[0101] The priority fusion module is used to determine the communication success rate and response delay fluctuation of each slave module based on the delay status table, and to weight and fuse the communication success rate, data update frequency identifier and functional importance level into a dynamic priority.
[0102] The interval scheduling module is used to define a response window for each slave module, configure a protection interval for each slave module after the response delay fluctuation range, arrange the polling initiation time of each slave module from high to low according to dynamic priority, reduce the protection interval of subsequent slave modules, and add the reduced duration to the protection interval of preceding slave modules.
[0103] The write-back update module is used to send polling requests to each slave module according to the polling initiation time after the arrangement, write back the measured response delay and communication success flag to the delay status table, and update the protection interval and polling initiation time of subsequent polling cycles.
[0104] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0105] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of this application without departing from the spirit and scope of protection of the claims. All of these variations are within the protection scope of this application.
[0106] It should be noted that the collection, storage, and use of all personal information involved in the technical solution of this application must be carried out only after obtaining the explicit authorization and separate consent of the information subject. The processing of personal information-related data strictly complies with the requirements of currently effective national laws, regulations, and relevant standards and specifications. The collected personal information is limited to use within the specific purpose necessary to achieve the technical solution of this application, and no processing beyond that purpose will be performed. Necessary technical and management measures will be taken to ensure the security of personal information.
Claims
1. A multi-node serial bus polling scheduling method based on dynamic priority, characterized in that, include: The polling master control unit records the polling request sending time, response arrival time, communication success identifier, data update frequency identifier, and functional importance level of each slave module on the 485 bus, and compiles the recorded content into a delay status table according to the bus address of the slave module. The communication success rate and response latency fluctuation of each slave module are determined based on the latency status table, and the communication success rate, data update frequency identifier and functional importance level are weighted and integrated into a dynamic priority. A response window is defined for each slave module. A protection interval is configured for each slave module after the response delay fluctuation. The polling initiation time of each slave module is arranged from high to low according to dynamic priority. The protection interval of the subsequent slave module is reduced and the reduced time is added to the protection interval of the preceding slave module. According to the polling initiation time after the arrangement, a polling request is initiated to each slave module, the measured response delay and communication success flag are written back to the delay status table, and the protection interval and polling initiation time of subsequent polling cycles are updated.
2. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 1, characterized in that, The time of sending polling requests and the time of receiving responses from each slave module on the 485 bus are recorded, including: The polling request sending time and response arrival time are taken from the timing unit inside the polling master control unit; The timing unit continues to count after the system is powered on, ensuring that the time when the polling request is sent and the time when the response arrives are on the same time base.
3. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 1, characterized in that, The step of compiling the recorded content into a delay status table according to the bus address of the slave module includes: Each record in the delay status table corresponds to a slave module. The fields of the record include the slave module's bus address, polling request sending time, response arrival time, communication success identifier, data update frequency identifier, and functional importance level. The time field and communication success flag field in the delay status table are refreshed on a rolling basis according to the polling cycle, and the earlier records are overwritten by the newly arrived records.
4. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 2, characterized in that, The methods for determining a successful communication include: After the polling master unit sends a polling request, it sets a waiting window. When the slave module returns a data frame within the waiting window and the verification is successful, it records the corresponding polling communication success flag as successful. If the data frame returned by the slave module fails to verify, or if no valid data frame is returned before the waiting window ends, the communication success flag is marked as failure, and the corresponding response arrival time is marked as invalid.
5. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 1, characterized in that, The determination of the communication success rate of each slave module includes: The polling master control unit counts the communication success flags of each slave module within a sliding window, and calculates the communication success rate of the slave module by comparing the number of successful messages with the total number of polls. The length of the sliding window is determined by the polling cycle length of the 485 bus and the number of connected slave modules.
6. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 1, characterized in that, Determining the response delay fluctuation range of each slave module includes: The polling master control unit subtracts the response arrival time from the polling request sending time within the same polling cycle to obtain the response delay of the slave module in the corresponding polling cycle; The dispersion of response delay within a sliding window is used to characterize the response delay fluctuation amplitude of the slave module, and the response delay fluctuation amplitude is used as an indicator to measure the timing stability of the slave module.
7. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 1, characterized in that, The weighted fusion of communication success rate, data update frequency identifier, and functional importance level into a dynamic priority includes: A linear mapping is performed between the data update frequency identifier and the functional importance level according to their respective configuration values, resulting in normalized data update frequency identifier and normalized functional importance level. The dynamic priority of the slave module is obtained by weighted summing of the communication success rate, the normalized data update frequency identifier, and the normalized functional importance level.
8. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 7, characterized in that, The weighting coefficients used in the weighted summation include: The sum of the weighting coefficients corresponding to communication success rate, data update frequency identifier, and functional importance level is constrained to 1. Each weighting coefficient is determined according to the emphasis placed on communication quality, data timeliness, and functional importance in the scenarios served by the 485 bus.
9. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 1, characterized in that, Weighted fusion for dynamic priority updates includes: After each polling cycle ends, the dynamic priority is recalculated by refreshing the latency status table, so that the communication success rate and response latency fluctuations reflect the bus status in the recent period. When multiple slave modules have the same dynamic priority value, the order of the slave modules' bus addresses is used as a supplementary criterion for sorting, so that the sorting result remains unique.
10. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 1, characterized in that, The steps of defining a response window for each slave module and configuring a protection interval after the response delay fluctuation include: The response window for the slave module is defined according to the expected response delay of the slave module. The expected response delay is obtained by adding the average response delay within the sliding window to the time margin. The protection interval of the slave station module is determined according to the response delay fluctuation amplitude of the slave station module. The protection interval configured for the slave station module with a large response delay fluctuation amplitude is longer than that configured for the slave station module with a small response delay fluctuation amplitude.
11. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 10, characterized in that, The configuration of the protection interval after the response window includes: The protection interval is set to one side after the response window, rather than before it; The protection interval includes a basic protection interval covering 485 bus transmit / receive switching and minimum inter-frame idle time, as well as an additional protection duration calculated based on the fluctuation of response delay.
12. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 1, characterized in that, The polling initiation time for arranging each slave module according to dynamic priority from high to low includes: The polling initiation time of slave modules with higher dynamic priority is arranged first, and the polling initiation time of slave modules with lower dynamic priority is arranged later; The interval between the end point of the response window of the previous slave module and the start point of the response window of the next slave module in two adjacent slave modules is not less than the protection interval located after the response window of the previous slave module, and the polling initiation time obtained by the arrangement is organized into a polling scheduling sequence.
13. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 1, characterized in that, The reduction of the protection interval of the subsequent slave station module and the addition of the reduced duration to the protection interval of the preceding slave station module include: A portion of the protection time is reduced from the protection interval of the low dynamic priority slave station module arranged later and added to the protection interval of the high dynamic priority slave station module arranged earlier, so that the total protection time on the bus before and after the transfer remains unchanged. The protection interval of the slave station module after reduction shall not be lower than the lower limit of the protection interval, and the amount of supplementary modules superimposed on the high dynamic priority slave station module shall not exceed the upper limit of the supplementary modules.
14. The multi-node serial bus polling scheduling method based on dynamic priority according to claim 13, characterized in that, The activation conditions for adding the reduced duration to the protection interval of the preceding slave station module include: When the response delay fluctuation of the high dynamic priority slave station module is greater than that of the low dynamic priority slave station module, the protection duration is shifted from the side with smaller response delay fluctuation to the side with larger response delay fluctuation. When the protection interval of a low dynamic priority station module is reduced to the lower limit of the protection interval, the reduction stops at the lower limit of the protection interval.
15. A multi-node serial bus polling scheduling system based on dynamic priority, used to implement the multi-node serial bus polling scheduling method based on dynamic priority as described in any one of claims 1 to 14, characterized in that, include: The module includes a status recording module, a priority fusion module, an interval scheduling module, and a write-back update module. The status recording module is used by the polling master control unit to record the polling request sending time, response arrival time, communication success identifier, data update frequency identifier and functional importance level of each slave module on the 485 bus, and to collect the recorded content into a delay status table according to the bus address of the slave module. The priority fusion module is used to determine the communication success rate and response delay fluctuation of each slave module based on the delay status table, and to weight and fuse the communication success rate, data update frequency identifier and functional importance level into a dynamic priority. The interval scheduling module is used to define a response window for each slave module, configure a protection interval for each slave module after the response window according to the response delay fluctuation amplitude, arrange the polling initiation time of each slave module from high to low according to dynamic priority, reduce the protection interval of subsequent slave modules, and add the reduced duration to the protection interval of preceding slave modules. The write-back update module is used to send polling requests to each slave module according to the polling initiation time after the arrangement, write back the measured response delay and communication success flag to the delay status table, and update the protection interval and polling initiation time of subsequent polling cycles.