Ros2 lightweight communication method for resource-constrained nodes

CN121530528BActive Publication Date: 2026-10-09ZHEJIANG LOTUS PURPLE STAR INTELLIGENT COMPUTING TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511711549.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-10-09
Estimated Expiration
2045-11-20

AI Technical Summary

Technical Problem

[0004]传统传输控制机制依赖固定时延阈值与静态重传策略,未对任务延迟组成项进行细化分析,导致时延判断缺乏针对性,调度方式多以静态优先队列和先入先出规则为基础,无法根据任务紧迫度和丢包率变化动态调整执行顺序,易在高负载或带宽波动时产生资源争用与响应失衡,滑动窗口与拥塞控制算法依赖固定参数配置,未能结合CPU负载与通信周期变化进行实时修正,造成资源利用效率低下,且缺乏对功耗、缓存容量与消息速率间耦合关系的动态约束机制,易引发缓存溢出与能耗增加

Benefits of technology

本发明中,通过对传输、排队、处理与路由四项时长进行计时差计算,实现任务延迟的精确量化与动态分类,使调度系统能够以时延约束为依据进行实时筛选与任务标记;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121530528B_ABST
    Figure CN121530528B_ABST
Patent Text Reader

Abstract

The present application relates to the field of transmission control technology, specifically to ROS2 lightweight communication method for resource-constrained nodes, in the present application, the time difference calculation is carried out on the four time lengths of transmission, queuing, processing and routing, the accurate quantification and dynamic classification of task delay are realized, the scheduling system can be based on delay constraint for real-time screening and task marking, the delay control matrix constructed by weighted round robin scheduling algorithm takes task priority level and risk weight as the core of calculation, realizes multi-dimensional decision of task execution, forms scheduling mechanism which can automatically adjust task state according to residual transmission time and packet loss ratio, multi-level feedback queue scheduling algorithm realizes response balance of different task types in scheduling period through high, medium and low priority weight setting and time slice migration strategy, realizes adaptive adjustment of weight combined with power consumption and memory monitoring, guarantees the continuous communication ability of the node in the low power consumption state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of transmission control technology, and in particular to a lightweight ROS2 communication method for resource-constrained nodes. Background Technology

[0002] The field of transmission control technology aims to ensure reliable, orderly, and efficient transmission of data packets between different nodes in a communication network by designing and implementing data transmission management mechanisms and protocol control methods. It guarantees data integrity through acknowledgment, timeout retransmission, sequence control, and verification mechanisms, and improves bandwidth utilization and reduces transmission latency through congestion control, sliding window, and rate adjustment algorithms. At the same time, it enables dynamic scheduling of transmission traffic and adaptive adjustment of resources to maintain stable communication in environments with limited bandwidth, storage, and power consumption.

[0003] The purpose of the lightweight ROS2 communication method for resource-constrained nodes is to maintain the communication reliability and real-time performance of the ROS2 framework under low power consumption, low memory, and low bandwidth conditions, while reducing the resource consumption during system operation. This is achieved by simplifying the communication protocol structure, reducing redundant control fields, optimizing message serialization methods, and dynamically adjusting data transmission strategies. This results in a lightweight and efficient communication process, reducing CPU utilization and memory usage, improving message transmission rate and response performance, enabling embedded or micro nodes to run stably in distributed ROS2 systems, supporting multi-node task collaboration and data consistency maintenance, and ensuring scalability and high reliability communication capabilities even in resource-constrained environments.

[0004] Traditional transmission control mechanisms rely on fixed latency thresholds and static retransmission strategies, failing to conduct detailed analysis of task latency components. This results in a lack of specificity in latency assessment. Scheduling methods are mostly based on static priority queues and first-in-first-out rules, unable to dynamically adjust the execution order according to task urgency and packet loss rate changes. This easily leads to resource contention and response imbalance under high load or bandwidth fluctuations. Sliding window and congestion control algorithms rely on fixed parameter configurations, failing to make real-time corrections based on CPU load and communication cycle changes, resulting in low resource utilization efficiency. Furthermore, the lack of dynamic constraint mechanisms on the coupling relationship between power consumption, cache capacity, and message rate easily leads to cache overflow and increased energy consumption. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing a lightweight ROS2 communication method for resource-constrained nodes.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a lightweight ROS2 communication method for resource-constrained nodes, comprising the following steps: S1: Based on the ROS2 node buffer and message scheduling table, extract the duration of four items: transmission, queuing, processing and routing. Calculate the total task latency by timing difference, compare it with the latency threshold and mark it as exceeding the limit or normal state, and generate a latency constraint mapping table. S2: Based on the latency constraint mapping table, read the remaining available time, round-trip time and packet loss ratio, prohibit tasks with insufficient transmission time limit, abandon tasks with excessive ratio, adopt a weighted round-robin scheduling algorithm, assign risk weights according to priority level and register node cache, and establish a task latency control matrix. S3: Based on the task delay control matrix, calculate the ratio of bandwidth usage, CPU load and communication cycle change, adjust the sending interval and recovery cycle according to the ratio results, bind the update parameters to form a cycle mapping record, and obtain the adaptive transmission rate table. S4: Based on the adaptive transmission rate table, a multi-level feedback queue scheduling algorithm is adopted, setting the weights and service cycles of high, medium and low priority queues, allocating time slices according to the number of tasks and message size, correcting the weights and transferring time slices according to power consumption and memory monitoring, rearranging the service order, and generating a multi-level scheduling execution table. S5: Based on the multi-level scheduling execution table, compare the message rate with the cache capacity limit, suppress the execution if the rate exceeds the limit, clean up the execution if the cache usage exceeds the limit, record the rate and remaining capacity to the node log, and obtain the communication scheduling control result.

[0007] As a further embodiment of the present invention, the delay constraint mapping table includes a task number, delay sub-item value, total delay value, and delay status identifier; the task delay control matrix includes a task priority classification, remaining time field, risk weight field, and task status field; the adaptive transmission rate table includes bandwidth change rate record, transmission interval parameter, load correction parameter, and period number index; the multi-level scheduling execution table includes queue weight item, service period item, time slice configuration item, and bandwidth allocation item; and the communication scheduling control result includes rate record item, buffer occupancy record item, remaining capacity record item, and time index item.

[0008] As a further aspect of the present invention, the specific steps for generating the time delay constraint mapping table are as follows: Based on the ROS2 node buffer and message scheduling table, the time records of each task in the transmission, queuing, processing and routing stages are extracted first. The time consumed by each item is summarized by reading the start and end time difference. The obtained data is then organized into a task delay set to generate task delay statistics. Based on the task delay statistics, the total delay of each task is compared with the preset threshold one by one. Tasks exceeding the limit are marked as abnormal and the rest are marked as normal. At the same time, the task number and corresponding status index are recorded to generate a delay constraint mapping table.

[0009] As a further aspect of the present invention, the specific steps for generating the task delay control matrix are as follows: Based on the aforementioned delay constraint mapping table, the remaining available time, round-trip time, and packet loss ratio of the task are read, the time difference is calculated, and the remaining time sequence of the task is generated. By comparing the remaining time with the duration of a complete transmission cycle and recording the difference, tasks with negative differences are registered as untransmittable items, and a task transmission time difference list is formed to generate the task delay difference result. Based on the task latency difference results, non-transferable items and high packet loss items are filtered out. Conditional judgment is used to mark non-transferable items as prohibited, and tasks with packet loss ratios exceeding the threshold are marked as abandoned. The task number and status code are recorded. A task status mapping table is established through the status index to generate task transmission restriction records. Based on the task transmission restriction record, a weighted round-robin scheduling algorithm is used to extract the priority level value of each task and calculate the risk weight. A risk weight matrix is ​​formed by matching the level and weight values, and the task status, priority level and weight value are written into the node buffer to establish a task latency control matrix.

[0010] As a further aspect of the present invention, the weighted round-robin scheduling algorithm, based on the task transmission restrictions, filters tasks that are transmittable and establishes a queue set according to topic or task number. It reads the priority level, risk weight, message byte size, and waiting time of each task and combines them according to weight coefficients to form queue weights. The queue weights are non-negative and integerized. The queues are checked in order. When a queue is not empty and the counter is greater than zero, a message is retrieved and sent, the counter is decremented, and the service sequence number and time slice length are recorded. When the traversal is complete or all counters are zero, all counters are reset to integer weights, and the starting index is moved to the item after the previous round's stopping position. Power consumption and memory usage are monitored within the cycle. When power consumption increases, the weight of low-priority queues is reduced proportionally. When memory usage increases, low-priority queue enqueueing is paused, and unused time slices are transferred to medium-priority queues. This forms a table of current round service order, time slice configuration, and queue weights, which is written to the node buffer. Based on the writing results, the task status, priority level, and weight fields are aggregated to establish a task latency control matrix.

[0011] As a further aspect of the present invention, the specific steps for generating the adaptive transmission rate table are as follows: Based on the task delay control matrix, the current bandwidth usage, CPU load and communication cycle value of the nodes are extracted. By calculating the difference between the transmission volume and processing time in a continuous time period, the bandwidth and load change sequence of each node is obtained, and the communication dynamic index results are generated. Based on the results of the communication dynamic indicators, the interval distribution of bandwidth change rate and load change rate is compared. The transmission interval is adjusted for the rising segment, the original period is restored for the falling segment, and the node period parameters and bandwidth mapping table are updated to generate an adaptive transmission rate table.

[0012] As a further aspect of the present invention, the comparison of the interval distribution of bandwidth change rate and load change rate involves dividing the node's bandwidth change rate and CPU load change rate into rising segments, stable segments, and falling segments according to preset upper and lower thresholds. The transmission cycle is adjusted based on the correspondence between the two in the segments. When both bandwidth change rate and load change rate are in the rising segment, the node resources are determined to be in a high-occupancy state, and the message sending interval is extended. When both are in the falling segment, the node resources are determined to have stabilized, and the original sending cycle is restored. When the two segments are inconsistent, the current sending rhythm remains unchanged.

[0013] As a further aspect of the present invention, the specific steps for generating the multi-level scheduling execution table are as follows: Based on the task delay control matrix and adaptive transmission rate table, a multi-level feedback queue scheduling algorithm is adopted to extract the number of tasks and message size of high, medium and low priority queues. The total value of message data is obtained by multiplying the total number of tasks and the number of message bytes. The initial weight ratio is determined by the proportion of each queue. The allocation result is recorded in the node queue configuration table to generate the initial queue allocation result. Based on the initial queue allocation results, read the node power consumption value and memory usage value, calculate the power consumption increment and memory usage increment, reduce the weight of the low priority queue when the power consumption exceeds the threshold, transfer part of the time slice to the medium priority queue when the memory increment increases, update the correction coefficient list, and generate queue weight correction records. Based on the queue weight correction record, each queue is reordered and the time slice length is reallocated. An execution sequence table is formed by recording the correspondence between the service cycle number and the queue weight. The allocation information is synchronized to the node scheduling buffer to generate a multi-level scheduling execution table.

[0014] As a further aspect of the present invention, the multi-level feedback queue scheduling algorithm establishes high-priority queues, medium-priority queues, and low-priority queues based on an adaptive transmission rate table. It reads the number of tasks and message size in each queue and calculates the total message data volume. It then calculates the initial weights according to the proportions and configures the time slice length and service cycle. New tasks are assigned to the high-priority queue by default. During scheduling, it prioritizes selecting non-empty queues with appropriate priorities, sends a message, and deducts the available time slice or polling quota of the selected queue. Tasks with pending messages after a single service session has exhausted their time slices are moved to the next queue, and the waiting time is recorded. Tasks completed within the time slice maintain their priority and their completion count is accumulated. Queues that have not been served for a long time are aged up by one level according to their waiting time. The service order and remaining time slices for each round are recorded. At the end of the cycle, the weights and time slice occupancy are summarized and written into the node queue configuration table, and the initial queue allocation results are output.

[0015] As a further aspect of the present invention, the specific steps for generating the communication scheduling control result are as follows: Based on the multi-level scheduling execution table, the message rate value and cache capacity value of each topic are read, the current sending frequency of the node is counted and the cache occupancy ratio is calculated, the rate and capacity data are sorted by topic, and the node transmission status result is generated. Based on the node transmission status results, frequency limits are applied to rate overrun items, data occupied by cache overrun items is cleared, and the corrected transmission rate and remaining capacity are recorded in the node log to generate communication scheduling control results.

[0016] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by calculating the time difference of four time components—transmission, queuing, processing, and routing—the task delay is accurately quantified and dynamically classified, enabling the scheduling system to perform real-time filtering and task marking based on delay constraints. In this invention, a delay control matrix constructed by a weighted round-robin scheduling algorithm is used as the core of the calculation to realize multi-dimensional decision-making on task execution, forming a scheduling mechanism that can automatically adjust the task status according to the remaining transmission time and packet loss ratio, thereby reducing invalid transmission and system blockage caused by insufficient time limit. In this invention, a ratio analysis method is used to calculate bandwidth usage, CPU load and communication cycle changes, and the sending interval and recovery cycle are dynamically adjusted based on the results, so that the transmission rate remains stable within a range under resource constraints and delay accumulation caused by sudden loads is avoided. In this invention, the multi-level feedback queue scheduling algorithm achieves response balance for different task types within the scheduling cycle by setting high, medium, and low priority weights and using a time slice migration strategy. Combined with power consumption and memory monitoring, it achieves adaptive adjustment of weights to ensure the continuous communication capability of nodes in a low-power state. In this invention, a two-way constraint mechanism for rate and capacity is established through the constraint control of rate suppression and cache clearing, ensuring that cache occupancy and message rate are maintained within a safe threshold. This forms a closed-loop adaptive transmission control system with latency calculation, weighted polling, and multi-level feedback as its core, enabling the system to maintain high transmission rate, low latency, and stable bandwidth utilization even in bandwidth-constrained and high-concurrency environments. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the main steps of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0019] Example 1 Please see Figure 1 This invention provides a technical solution: a lightweight ROS2 communication method for resource-constrained nodes, comprising the following steps: S1: Based on the ROS2 node buffer and message scheduling table, extract the duration of four items: transmission, queuing, processing and routing. Calculate the total task latency by timing difference, compare it with the latency threshold and mark it as exceeding the limit or normal state, and generate a latency constraint mapping table. S2: Based on the latency constraint mapping table, read the remaining available time, round-trip time and packet loss ratio, prohibit tasks with insufficient transmission time limit, and abandon tasks with excessive ratio. Use a weighted round-robin scheduling algorithm, assign risk weights according to priority level and register node cache, and establish a task latency control matrix. S3: Based on the task delay control matrix, calculate the ratio of bandwidth usage, CPU load and communication cycle change, adjust the sending interval and recovery cycle according to the ratio results, bind the update parameters to form a cycle mapping record, and obtain the adaptive transmission rate table. S4: Based on the task delay control matrix and adaptive transmission rate table, a multi-level feedback queue scheduling algorithm is adopted. High, medium and low priority queue weights and service cycles are set. Time slices are allocated according to the number of tasks and message size. Weights are adjusted and time slices are transferred according to power consumption and memory monitoring. Service order is rearranged to generate a multi-level scheduling execution table. S5: Based on the multi-level scheduling execution table, compare the message rate with the cache capacity limit, suppress the execution if the rate exceeds the limit, clean up the execution if the cache usage exceeds the limit, record the rate and remaining capacity to the node log, and obtain the communication scheduling control result.

[0020] The delay constraint mapping table includes task number, delay sub-value, total delay value, and delay status identifier; the task delay control matrix includes task priority classification, remaining time field, risk weight field, and task status field; the adaptive transmission rate table includes bandwidth change rate record, transmission interval parameter, load correction parameter, and cycle number index; the multi-level scheduling execution table includes queue weight item, service cycle item, time slice configuration item, and bandwidth allocation item; and the communication scheduling control result includes rate record item, buffer occupancy record item, remaining capacity record item, and time index item.

[0021] The specific steps for generating the time delay constraint mapping table are as follows: Based on the ROS2 node buffer and message scheduling table, the time records of each task in the transmission, queuing, processing and routing stages are extracted first. The time consumed by each item is summarized by reading the start and end time difference. The obtained data is then organized into a task delay set to generate task delay statistics. Based on the task delay statistics, the total delay of each task is compared with the preset threshold one by one. Tasks that exceed the limit are marked as abnormal and the rest are marked as normal. At the same time, the task number and corresponding status index are recorded to generate a delay constraint mapping table. Based on ROS2 node buffers and message scheduling tables, a timestamp difference calculation method is used to uniformly collect and calculate the time records of tasks in the transmission, queuing, processing, and routing stages. By recording the start and end times of each stage, the time records are stored in the buffer sequence in the format of time record units. Subtraction is performed on the start and end times of each stage, and the resulting value is recorded in the stage time consumption field in microseconds. The time consumption of transmission, queuing, processing, and routing is sequentially summarized into single task time consumption record units. The task number is bound to the corresponding time consumption record using a sequential index method to form a mapping sequence composed of task number and time consumption value. The mapping sequence is traversed and stored in ascending order of task number. All task time consumption records are uniformly collected to form a task delay set, which is archived and stored in the form of a set structure to generate task delay statistics results. Based on the task delay statistics, a threshold comparison algorithm is used to classify and label the delay data. By setting a fixed delay threshold parameter, the total delay of each task is read sequentially and compared with the threshold. When the delay value exceeds the threshold, an abnormal label is assigned, and when the delay value is lower than or equal to the threshold, a normal label is assigned. The comparison result is recorded in the status list as binary identifier bits. The number, delay value and status bits are paired and stored in the order of task number. All task status records are organized in a table structure as a mapping dataset to generate a delay constraint mapping table.

[0022] The specific steps for generating the task delay control matrix are as follows: Based on the latency constraint mapping table, the remaining available time, round-trip time and packet loss ratio of the task are read, the time difference is calculated and the remaining time series of the task is generated. By comparing the remaining time with the duration of a complete transmission cycle and recording the difference, tasks with negative differences are registered as untransmittable items, and the task transmission time difference list is summarized to generate the task latency difference result. Based on the task latency difference results, non-transferable items and high packet loss items are filtered out. Conditional judgment is used to mark non-transferable items as prohibited, and tasks with packet loss ratios exceeding the threshold are marked as abandoned. The task number and status code are recorded. A task status mapping table is established through the status index to generate task transmission restriction records. Based on the task transmission limit record, a weighted round-robin scheduling algorithm is adopted to extract the priority level value of each task and calculate the risk weight. A risk weight matrix is ​​formed by matching the level and weight values, and the task status, priority level and weight value are written into the node buffer to establish a task latency control matrix. Based on a latency constraint mapping table, a time difference calculation method is used to read and calculate the remaining available time, round-trip time, and packet loss ratio of a task. By extracting the time record fields corresponding to the task number, including start time, end time, and round-trip time parameters, with the time record unit uniformly in milliseconds, the start time and end time are subtracted and added to the round-trip time to calculate the remaining available time value for each task. The resulting value is recorded as the task remaining time series. Each data in the remaining time series is compared with the duration parameter of a complete transmission cycle. The transmission cycle is set to 100 milliseconds. The remaining time difference of the task is calculated by the difference. Tasks with negative differences are registered as non-transmission items and written with a prohibition mark using the task number as an index. All difference results are stored and summarized in the order of task number to generate the task latency difference result. Based on the task latency difference results, a conditional judgment method is used to filter out untransferable items and high packet loss items. By setting a packet loss ratio threshold parameter of 0.3, the packet loss ratio value of each task is read and numerical judgment is performed. If the task has been registered as an untransferable item, a prohibition mark code 1 is written. If the packet loss ratio of the task is higher than the threshold, an abandonment mark code 2 is written. The task number and the corresponding status code are written into the task status dataset in a sequential form. The correspondence between the task number and the status code is established through the index field and stored as a mapping structure. All task status information is uniformly collected and output as tabular data to generate task transmission restriction records. Based on task transmission constraint records, a weighted round-robin scheduling algorithm is used to extract and calculate task priority levels and risk weights. By reading the task priority level numerical field and setting the weight parameter range from 0.1 to 1.0, the weight coefficients are distributed proportionally decreasing from high to low according to the level value. After matching the level and weight, a two-dimensional matrix structure is formed. In the matrix, the rows represent task numbers and the columns represent risk weight values ​​and priority level values. A matching and verification operation is performed on the matrix data, and each matching result is recorded in the buffer. The buffer adopts a double buffer structure to distinguish between task status information and weight data blocks. The stored task status, priority level, and weight values ​​are sorted in order to form a control index table. After all data records are merged, they are output to establish a task delay control matrix.

[0023] The weighted round-robin scheduling algorithm, based on task transmission constraints, filters tasks that are transmittable and establishes queue sets according to topic or task number. It reads the priority level, risk weight, message byte size, and waiting time of each task and combines them according to weight coefficients to form queue weights. The queue weights are non-negative and integerized. The queues are checked in order. When a queue is not empty and the counter is greater than zero, a message is taken out and sent, the counter is decremented by one, and the service sequence number and time slice length are recorded. When the traversal is complete or all counters are zero, all counters are reset to integer weights, and the starting index is moved to the item after the previous round's stopping position. During the cycle, power consumption and memory usage are monitored. When power consumption increases, the weight of low-priority queues is reduced proportionally. When memory usage increases, low-priority queue enqueueing is suspended, and unused time slices are transferred to medium-priority queues. This forms a table of current round service order, time slice configuration, and queue weights, which is written to the node buffer. Based on the writing results, the task status, priority level, and weight fields are aggregated to establish a task latency control matrix. The weighted round-robin scheduling algorithm, according to the formula:

[0024] in: This indicates the maximum available link bandwidth for a resource-constrained ROS2 node, expressed in bits per second (bit / s). This indicates that the unit of a single round of weighted polling scheduling is seconds. This represents the security utilization coefficient determined based on the link utilization distribution. This indicates the ratio of protocol header usage to retransmission usage. Indicates task The unit of length for a single message is bytes. Indicates assignment to task The number of quantum bars, Indicates task Priority level value, Indicates task The current backlog of messages is in bytes. The backlog reference threshold is indicated in bytes. Indicates task The average one-way delay is measured in seconds. Indicates task The maximum allowed transmission time limit is in seconds. Indicates task The number of retransmissions that have already occurred This indicates the maximum number of retransmissions allowed. The weighting coefficients representing the impact of priority levels. The weighting coefficients representing the impact of the backlog level. The weighting coefficients represent the impact of delay default risk. The weighting coefficients representing the impact of retransmission risk. This represents the set of task indexes that participated in the scheduling. Represents a set All tasks within the index The operation of summing terms one by one, Indicates task The amount exceeding the observation time limit is taken as zero in seconds; otherwise, the observation delay is taken as zero. Execution process: First, count the set of tasks participating in the scheduling. And obtain the priority level value of each task and record it as follows: The total number of backlogged message bytes used to indicate task importance and read from the node cache for each task is denoted as . and with reference threshold Its normalization is used to measure the degree of queue congestion, and the average one-way delay observed by the measurement task in the link is denoted as... and the maximum time limit allowed by the task. Comparison passed The latency default ratio is calculated to characterize time risk, and then the number of retransmissions that have occurred in the task is read. With the maximum number of retransmissions Normalization reflects reliability risk, and priority level, backlog ratio, default ratio, and retransmission ratio are multiplied by weighting coefficients respectively. , , , The task risk expression is formed by linearly combining these expressions and using them to calculate the service share of other tasks in the denominator through normalization ratio calculation. Then, the available bandwidth limit is read from the link monitoring module. And obtain the single-round scheduling cycle from the scheduling parameters. Multiply them together to calculate the total number of bits that can be transmitted in a single round and then multiply by the security utilization factor. Ratio of available bandwidth After eliminating protocol overhead and retransmission overhead to obtain the effective transmission capacity, the number of bytes per message in the task is then read. Multiplying this by 8 gives the number of bits occupied by a single message in the task. This is then used for division to convert the effective bandwidth into the number of messages that can be sent. Finally, this result is multiplied by the proportion of the task risk expression to obtain the service volume corresponding to task i, and then rounded down using the floor operator. Obtain the number of quantum bars in integer form Ensure the schedule is executable, and finally, assign each task its own... The data is written to the scheduling table for actual polling during the ROS2 lightweight communication process, enabling comprehensive scheduling of priority, congestion, latency, and reliability of resource-constrained node tasks.

[0025] The specific steps for generating an adaptive transmission rate table are as follows: Based on the task delay control matrix, the current bandwidth usage, CPU load and communication cycle value of the nodes are extracted. By calculating the difference between the transmission volume and processing time in a continuous time period, the bandwidth and load change sequence of each node is obtained, and the communication dynamic index results are generated. Based on the results of communication dynamic indicators, the interval distribution of bandwidth change rate and load change rate is compared. The transmission interval is adjusted for the rising segment, the original period is restored for the falling segment, and the node period parameters and bandwidth mapping table are updated to generate an adaptive transmission rate table. Based on the task delay control matrix, the interval difference calculation method is used to extract and calculate the current bandwidth usage, CPU load, and communication cycle value of the node. By reading the fields of transmission volume, reception volume, and processing time of consecutive time periods in the node monitoring table, the bandwidth usage is in megabits per second, the CPU load is recorded as a percentage, and the communication cycle value is in milliseconds. Differential operation is performed on the transmission volume and processing time of adjacent time periods, and the difference is recorded as the change in the corresponding segment in the time series. The change rate of bandwidth usage and load is calculated and recorded in the change sequence array. The calculation is performed on all nodes in numerical order to generate a multi-field record set containing node number, bandwidth change value, load change value, and cycle parameter. The record set is stored in the data table format and output to generate the communication dynamic index result. Based on the results of communication dynamic indicators, an interval judgment and periodic adjustment algorithm is used to compare and process the interval distribution of bandwidth change rate and load change rate. By setting a bandwidth change rate threshold of 0.15 and a load change rate threshold of 0.2, the change sequence of each node is read cyclically. If both the bandwidth change rate and the load change rate are higher than the threshold, the process enters the rising segment judgment branch, performs a doubling operation on the node's current transmission interval parameter, and updates the communication period field value. If both the bandwidth change rate and the load change rate are lower than the threshold, the process enters the falling segment judgment branch, restores the node's period parameter to its initial value, and records the update timestamp. A mapping relationship is established between the updated period parameter and the bandwidth usage data, and the node number is used as the index field to store it in the mapping table. All update records are integrated and output in chronological order to generate an adaptive transmission rate table.

[0026] By comparing the interval distribution of bandwidth change rate and load change rate, the bandwidth change rate and CPU load change rate of the node are divided into rising segment, stable segment and falling segment according to the preset upper and lower thresholds. The transmission cycle is adjusted according to the correspondence between the two in the segment. When both bandwidth change rate and load change rate are in the rising segment, the node resources are determined to be in a high-occupancy state and the message sending interval is extended. When both are in the falling segment, the node resources are determined to have returned to stability and the original sending cycle is restored. When the two segments are inconsistent, the current sending rhythm remains unchanged.

[0027] The specific steps for generating a multi-level scheduling execution table are as follows: Based on the task delay control matrix and adaptive transmission rate table, a multi-level feedback queue scheduling algorithm is adopted to extract the number of tasks and message size of high, medium and low priority queues. The total message data volume is obtained by multiplying the total number of tasks and the number of message bytes. The initial weight ratio is determined by the proportion of each queue. The allocation result is recorded in the node queue configuration table to generate the initial queue allocation result. Based on the initial queue allocation results, read the node power consumption value and memory usage value, calculate the power consumption increment and memory usage increment, reduce the weight of the low priority queue when the power consumption exceeds the threshold, transfer part of the time slice to the medium priority queue when the memory increment increases, update the correction coefficient list, and generate queue weight correction records. Based on the queue weight correction record, each queue is reordered and the time slice length is reallocated. An execution sequence table is formed by recording the correspondence between the service cycle number and the queue weight. The allocation information is synchronized to the node scheduling buffer to generate a multi-level scheduling execution table. Based on the task delay control matrix and adaptive transmission rate table, a multi-level feedback queue scheduling algorithm is used to extract and process the node task distribution data. The task quantity and message size parameters of high priority queue, medium priority queue and low priority queue are read from the rate table. The task quantity is recorded in integer form and the message size is stored in bytes. The quantity and message size are multiplied for each queue. The results are summarized into the total message data volume. The proportion of message data volume of each queue is calculated. The initial weight ratio of high priority queue is set to 0.5, medium priority queue to 0.3 and low priority queue to 0.2. The proportion parameters are written into the queue configuration data block. The configuration results are stored by using the node number as the index field. The configuration records of all nodes are sorted in order and written into the node queue configuration table to generate the initial queue allocation result. Based on the initial queue allocation results, a dynamic weight correction algorithm is used to read the node power consumption and memory usage values. The power consumption and memory parameters are calculated differentially over a continuous time period. Power consumption is recorded in watts and memory usage is recorded in megabytes. The incremental value is calculated by comparing the power consumption and memory data of adjacent sampling periods. When the power consumption increment exceeds the threshold of 2.0, a weight adjustment operation is performed, and the weight ratio of the low priority queue is reduced by a reduction factor of 0.1. When the memory increment is higher than the threshold of 5.0, a time slice transfer operation is performed, and 10% of the time slice length is transferred from the low priority queue to the medium priority queue. After performing weight and time slice adjustments, the correction factor, timestamp, and node number are recorded in the correction factor list. The list data is sorted in chronological order and stored as a record table to generate the queue weight correction record. Based on the queue weight correction record, a time slice reallocation method is used to reorder and allocate each queue. By reading the weight parameters and time slice ratio in the correction record, the service cycle number and queue weight are remapped for each node. The service cycle of the high priority queue is set to 20 milliseconds, the medium priority queue to 40 milliseconds, and the low priority queue to 60 milliseconds. The time slice length is adjusted according to the weight ratio to form a mapping structure for the service cycle and time slice allocation information of each queue. The service cycle number and the weight value of the corresponding queue are recorded. The mapping result is synchronously written to the node scheduling buffer. All synchronization records are arranged and archived in the order of node number to generate a multi-level scheduling execution table.

[0028] The multi-level feedback queue scheduling algorithm establishes high-priority, medium-priority, and low-priority queues based on an adaptive transmission rate table. It reads the number of tasks and message size in each queue and calculates the total message data volume. It then converts the initial weights according to the proportions and configures the time slice length and service cycle. New tasks default to entering the high-priority queue. During scheduling, it prioritizes selecting non-empty queues with appropriate priorities, sends a message, and deducts the available time slice or polling quota of the selected queue. Tasks with pending messages after a single service session exhausts their time slice are moved to the next queue and the waiting time is recorded. Tasks completed within the time slice maintain their priority and their completion count is accumulated. Queues that have not been served for a long time are aged up by one level according to the waiting time. The algorithm records the service order and remaining time slices for each round. At the end of the cycle, it summarizes the weights and time slice occupancy and writes them into the node queue configuration table, outputting the initial queue allocation results. The multi-level feedback queue scheduling algorithm is based on the formula:

[0029] in: This indicates the total available bandwidth of a resource-constrained node on the ROS2 communication link, measured in bits per second. This indicates that the security utilization coefficient, selected based on the historical utilization distribution of the link, is used to limit peak occupancy. This indicates the ratio of header overhead to retransmission overhead in the ROS2 communication protocol. This indicates that the effective bandwidth allocated to the task queue with priority q is measured in bits per second. This indicates the number of tasks with priority q within the ROS2 node scheduling cycle, expressed in units of tasks. This indicates the number of bytes in a single message corresponding to a task with priority q in communication, expressed in bytes. This indicates the upper limit of the target delay in seconds for a task with priority q in the task delay control matrix. The unit is seconds, representing the additional time overhead incurred by a task with priority q during ROS2 multilevel feedback scheduling due to context switching and scheduling decisions. This represents the burstiness correction coefficient with priority q obtained by analyzing the dispersion of task arrival intervals. This indicates the maximum allowable jitter in seconds for a task with priority q during link transmission. This represents the summation operation on each of the three queues: high priority, medium priority, and low priority. This indicates the number of tasks with priority k, expressed in units of items. This indicates that the number of bytes in a single message for a task with priority k is in bytes. This indicates that the maximum delay for a task with priority k is in seconds. This represents the time overhead (in seconds) incurred by a task with priority k in ROS2 scheduling. This represents the burst correction coefficient with priority k. This indicates that the jitter budget for a task with priority k is in seconds. This represents the proportion of bandwidth available for effective data transmission after deducting the overhead of the ROS2 communication protocol. This indicates the net bandwidth requirement of a task with priority q per unit of time, expressed in bytes per second. This represents the amplification factor for the demand on a task with priority q after considering the jitter budget. This represents the total bandwidth requirement of all priority queues after jitter budget and burst correction, in bytes per second. Execution process: First, count the number of tasks in the high-priority, medium-priority, and low-priority queues of the ROS2 node within the scheduling period, and record them as follows: and and And read the number of bytes of a single message corresponding to each queue and record them as follows: and and Secondly, the target latency upper limit for each priority queue is obtained from the task latency control matrix and denoted as follows: and and The scheduling overhead for each queue is calculated by combining the context switch time and task entry readiness time statistics from the scheduler logs, and denoted as follows: and and After deducting invalid occupancy delays, the task arrival interval sequence is statistically analyzed within a fixed time window, and its variance and mean are calculated to obtain the dispersion index, which is used to determine the burst correction coefficient for each queue. To ensure that burst traffic is not underestimated, the end-to-end transmission delay sequence of the link is collected and the standard deviation is calculated to obtain the allowable jitter budget for each queue. To measure tolerance for latency fluctuations, the net bandwidth requirement for each queue is calculated as follows: The total demand is obtained by summing the demand items from the three queues and used for subsequent normalization. Then, the available bandwidth distribution is obtained from link monitoring, and its quantile is selected to calculate the link utilization safety factor. The protocol overhead coefficient is obtained by calculating the ratio of retransmissions to header usage in the protocol stack. ,by Calculate the allocated bandwidth after safety and overhead correction and use it as a ratio to the demand of each queue to calculate the allocated bandwidth for each queue. Finally, the calculated Write the node queue configuration table for ROS2 lightweight communication scheduling execution, ensuring efficient and controllable bandwidth allocation in resource-constrained environments.

[0030] The specific steps for generating communication scheduling and control results are as follows: Based on the multi-level scheduling execution table, the message rate value and buffer capacity value of each topic are read, the current sending frequency of the node is counted and the buffer occupancy ratio is calculated, the rate and capacity data are classified and organized by topic, and the node transmission status results are generated. Based on the node transmission status results, frequency limits are applied to rate overrun items, data occupied by cache overrun items is cleared, and the corrected transmission rate and remaining capacity are recorded in the node log to generate communication scheduling control results. Based on a multi-level scheduling execution table, the message rate value and cache capacity value of each topic are read and calculated using rate statistics and capacity ratio calculation methods. By traversing the topic number field in the scheduling execution table, the number of message sending and time period parameters are extracted in turn. The number of sending is divided by the period length to obtain the message rate value, which is recorded in units of sending per second. The current occupied space and total capacity value are read from the node cache capacity field. The cache occupancy ratio is calculated by dividing the occupied value by the total capacity value, and the result is stored in percentage form. The rate and capacity data of each topic are sorted by topic number and grouped according to the topic category field. The rate and capacity data of all nodes under the same topic are summarized into a classified record set. The average value is calculated on the summarized data and the statistical timestamp is recorded. All statistical records are integrated into a table structure to generate the node transmission status result. Based on the node transmission status results, a conditional judgment and constraint execution method is used to control the rate and cache status. By setting a rate threshold parameter of 500 messages per second and a cache occupancy threshold parameter of 0.8, each topic record is read and compared sequentially. When the message rate value exceeds the rate threshold, a frequency limiting operation is performed. The current sending frequency is multiplied by a proportional coefficient of 0.7 and updated to a new sending frequency. When the cache occupancy ratio is higher than the threshold, a cache cleanup operation is performed. Data blocks in the cache record area are sorted in ascending order by the timestamp field, and the earliest 20% of data blocks are deleted. After data cleanup, the remaining capacity value is recalculated and recorded in the status table. The corrected sending rate and remaining capacity value are written to the node log file. The log record fields include topic number, corrected rate, remaining capacity, and recording time. All log entries are archived and output in chronological order to generate communication scheduling control results.

[0031] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A lightweight communication method for resource-constrained nodes in ROS2, characterized in that, Includes the following steps: S1: Based on the ROS2 node buffer and message scheduling table, extract the duration of four items: transmission, queuing, processing and routing. Calculate the total task latency by timing difference, compare it with the latency threshold and mark it as exceeding the limit or normal state, and generate a latency constraint mapping table. S2: Based on the latency constraint mapping table, read the remaining available time, round-trip time and packet loss ratio, prohibit tasks with insufficient transmission time limit, abandon tasks with excessive ratio, adopt a weighted round-robin scheduling algorithm, assign risk weights according to priority level and register node cache, and establish a task latency control matrix. S3: Based on the task delay control matrix, calculate the ratio of bandwidth usage, CPU load and communication cycle change, adjust the sending interval and recovery cycle according to the ratio results, bind the update parameters to form a cycle mapping record, and obtain the adaptive transmission rate table. S4: Based on the task delay control matrix and adaptive transmission rate table, a multi-level feedback queue scheduling algorithm is adopted. High, medium and low priority queue weights and service cycles are set. Time slices are allocated according to the number of tasks and message size. The weights are adjusted and time slices are transferred according to power consumption and memory monitoring. The service order is rearranged to generate a multi-level scheduling execution table. S5: Based on the multi-level scheduling execution table, compare the message rate with the cache capacity limit, suppress the execution if the rate exceeds the limit, clean up the execution if the cache usage exceeds the limit, record the rate and remaining capacity to the node log, and obtain the communication scheduling control result.

2. The lightweight ROS2 communication method for resource-constrained nodes according to claim 1, characterized in that, The latency constraint mapping table includes task number, latency sub-item value, total latency value, and latency status identifier. The task latency control matrix includes task priority classification, remaining time field, risk weight field, and task status field. The adaptive transmission rate table includes bandwidth change rate record, transmission interval parameter, load correction parameter, and period number index. The multi-level scheduling execution table includes queue weight item, service period item, time slice configuration item, and bandwidth allocation item. The communication scheduling control result includes rate record item, buffer occupancy record item, remaining capacity record item, and time index item.

3. The lightweight ROS2 communication method for resource-constrained nodes according to claim 1, characterized in that, The specific steps for generating the time delay constraint mapping table are as follows: Based on the ROS2 node buffer and message scheduling table, the time records of each task in the transmission, queuing, processing and routing stages are extracted first. The time consumed by each item is summarized by reading the start and end time difference. The obtained data is then organized into a task delay set to generate task delay statistics. Based on the task delay statistics, the total delay of each task is compared with the preset threshold one by one. Tasks exceeding the limit are marked as abnormal and the rest are marked as normal. At the same time, the task number and corresponding status index are recorded to generate a delay constraint mapping table.

4. The lightweight ROS2 communication method for resource-constrained nodes according to claim 1, characterized in that, The specific steps for generating the task delay control matrix are as follows: Based on the aforementioned delay constraint mapping table, the remaining available time, round-trip time, and packet loss ratio of the task are read, the time difference is calculated, and the remaining time sequence of the task is generated. By comparing the remaining time with the duration of a complete transmission cycle and recording the difference, tasks with negative differences are registered as untransmittable items, and a task transmission time difference list is formed to generate the task delay difference result. Based on the task latency difference results, non-transferable items and high packet loss items are filtered out. Conditional judgment is used to mark non-transferable items as prohibited, and tasks with packet loss ratios exceeding the threshold are marked as abandoned. The task number and status code are recorded. A task status mapping table is established through the status index to generate task transmission restriction records. Based on the task transmission restriction record, a weighted round-robin scheduling algorithm is used to extract the priority level value of each task and calculate the risk weight. A risk weight matrix is ​​formed by matching the level and weight values, and the task status, priority level and weight value are written into the node buffer to establish a task latency control matrix.

5. The lightweight ROS2 communication method for resource-constrained nodes according to claim 4, characterized in that, The weighted round-robin scheduling algorithm, based on the task transmission restrictions, filters tasks that are transmittable and establishes a queue set according to topic or task number. It reads the priority level, risk weight, message byte size, and waiting time of each task and combines them according to weight coefficients to form queue weights. The queue weights are non-negative and integerized. The queues are checked in order. When a queue is not empty and the counter is greater than zero, a message is retrieved and sent, the counter is decremented, and the service sequence number and time slice length are recorded. When the traversal is complete or all counters are zero, all counters are reset to integer weights, and the starting index is moved to the item after the previous round's stopping position. Power consumption and memory usage are monitored within the cycle. When power consumption increases, the weight of low-priority queues is reduced proportionally. When memory usage increases, low-priority queue enqueueing is suspended, and unused time slices are transferred to medium-priority queues. This forms a table of current round service order, time slice configuration, and queue weights, which is written to the node buffer. Based on the writing results, the task status, priority level, and weight fields are aggregated to establish a task latency control matrix.

6. The lightweight ROS2 communication method for resource-constrained nodes according to claim 1, characterized in that, The specific steps for generating the adaptive transmission rate table are as follows: Based on the task delay control matrix, the current bandwidth usage, CPU load and communication cycle value of the nodes are extracted. By calculating the difference between the transmission volume and processing time in a continuous time period, the bandwidth and load change sequence of each node is obtained, and the communication dynamic index results are generated. Based on the results of the communication dynamic indicators, the interval distribution of bandwidth change rate and load change rate is compared. The transmission interval is adjusted for the rising segment, the original period is restored for the falling segment, and the node period parameters and bandwidth mapping table are updated to generate an adaptive transmission rate table.

7. The lightweight ROS2 communication method for resource-constrained nodes according to claim 6, characterized in that, The comparison of the bandwidth change rate and load change rate interval distribution divides the node's bandwidth change rate and CPU load change rate into rising, stable, and falling segments according to preset upper and lower thresholds. The transmission cycle is adjusted based on the correspondence between the two in the segments. When both the bandwidth change rate and load change rate are in the rising segment, the node resources are determined to be in a high-occupancy state, and the message sending interval is extended. When both are in the falling segment, the node resources are determined to have returned to stability, and the original sending cycle is restored. When the two segments are inconsistent, the current sending rhythm remains unchanged.

8. The lightweight ROS2 communication method for resource-constrained nodes according to claim 1, characterized in that, The specific steps for generating the multi-level scheduling execution table are as follows: Based on the task delay control matrix and adaptive transmission rate table, a multi-level feedback queue scheduling algorithm is adopted to extract the number of tasks and message size of high, medium and low priority queues. The total value of message data is obtained by multiplying the total number of tasks and the number of message bytes. The initial weight ratio is determined by the proportion of each queue. The allocation result is recorded in the node queue configuration table to generate the initial queue allocation result. Based on the initial queue allocation results, the node power consumption value and memory usage value are read, the power consumption increment and memory usage increment are calculated, the weight of the low priority queue is reduced when the power consumption exceeds the threshold, and when the memory increment increases, part of the time slice is transferred to the medium priority queue. The correction coefficient list is updated and a queue weight correction record is generated. Based on the queue weight correction record, each queue is reordered and the time slice length is reallocated. An execution sequence table is formed by recording the correspondence between the service cycle number and the queue weight. The allocation information is synchronized to the node scheduling buffer to generate a multi-level scheduling execution table.

9. The lightweight ROS2 communication method for resource-constrained nodes according to claim 8, characterized in that, The multi-level feedback queue scheduling algorithm establishes high-priority, medium-priority, and low-priority queues based on an adaptive transmission rate table. It reads the number of tasks and message size in each queue and calculates the total message data volume. It then calculates the initial weights according to the proportions and configures the time slice length and service cycle. New tasks default to entering the high-priority queue. During scheduling, it prioritizes selecting non-empty queues with appropriate priorities, sends a message, and deducts the available time slice or polling quota of the selected queue. Tasks with pending messages after a single service session has exhausted their time slices are moved to the next queue, and the waiting time is recorded. Tasks completed within the time slice maintain their priority and their completion count is accumulated. Queues that have not been served for a long time are aged up by one level according to their waiting time. The algorithm records the service order and remaining time slices for each round. At the end of the cycle, it summarizes the weights and time slice occupancy and writes them into the node queue configuration table, outputting the initial queue allocation results.

10. The lightweight ROS2 communication method for resource-constrained nodes according to claim 1, characterized in that, The specific steps for generating the communication scheduling and control results are as follows: Based on the multi-level scheduling execution table, the message rate value and cache capacity value of each topic are read, the current sending frequency of the node is counted and the cache occupancy ratio is calculated, the rate and capacity data are sorted by topic, and the node transmission status result is generated. Based on the node transmission status results, frequency limits are applied to rate overrun items, data occupied by cache overrun items is cleared, and the corrected transmission rate and remaining capacity are recorded in the node log to generate communication scheduling control results.

Citation Information

Patent Citations

  • Realization method and device of ROS2 scheduler, equipment and storage medium

    CN116661999A

  • ROS2 hybrid scheduling actuator system

    CN119557076A