Robot Operating System Network Load Optimization Method Based on Time-Sensitive Network

By dynamically adjusting the port parameters of the main clock in the robot operating system, the load of the time-sensitive network is optimized, and the problem of frequent time-based message bandwidth is solved, and network performance and system stability are improved.

CN119675813BActive Publication Date: 2025-07-08HARBIN INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411849064.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-07-08
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

In robot operating systems, frequent time-based messages occupy the network bandwidth of the LAN, affecting the transmission efficiency of other data streams, and the existing solutions lack dynamic adjustment mechanisms, resulting in poor network performance and reduced system stability.

Method used

Through the time data exchange between the master clock and the slave clock, time deviation and network delay are calculated, and the port parameters of the master clock are dynamically adjusted, such as the transmission frequency of synchronized packets and the priority of data flow, to optimize network load.

Benefits of technology

It improves network transmission efficiency, reduces network bandwidth usage, enhances system stability and reliability, adapts to different load conditions, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119675813B_ABST
    Figure CN119675813B_ABST
Patent Text Reader

Abstract

The present invention provides a method for optimizing the network load of a robot operating system based on a time-sensitive network, which relates to the field of network transmission technologies. The optimization method includes: when the master clock in the robot operating system periodically sends declaration messages to each slave clock to exchange clock information, obtaining the time data between the master clock and each slave clock in the previous time, where the time data is the time data during the time synchronization process between the master clock and each slave clock; obtaining the corresponding time deviation and network delay according to each time data, and obtaining the current network load data of the local area network according to all the time deviations and network delays; comparing with the current network load data based on a preset threshold to obtain the result of the comparison, and adjusting the port parameters of the master clock according to the result of the comparison. By intelligently adjusting the port parameters of the master clock in the robot operating system, unnecessary time synchronization message transmissions are reduced, thereby reducing the occupancy of network bandwidth and improving the transmission efficiency of the overall network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network transmission technologies, and more particularly, to a method for optimizing network load of a robot operating system based on a time-sensitive network. Background Art

[0002] A Time-Sensitive Network (TSN) is a set of IEEE standards designed to provide deterministic services for users through a local area network (LAN), ensuring that time-critical data streams can be transmitted within a specified time. Currently, with the development of robot technologies, the requirements for real-time communication control of robots are getting higher and higher. This requires the robot operating system to not only ensure distributed control of the robot but also ensure real-time transmission of control information. The time-sensitive network can provide a unified data link layer for robot real-time communication while allowing the integration of traffic and real-time communication.

[0003] The Precision Time Protocol (PTP) is the basis for implementing TSN and is responsible for high-precision time synchronization between network devices. PTP can provide time synchronization accuracy at the microsecond or even nanosecond level, which is crucial for application scenarios such as motor control and key sensor data synchronization that require strict time synchronization in robot control. During the operation of the PTP protocol, the master clock periodically sends Sync messages and Follow_up messages to the slave clock, carrying timestamp information. The slave clock periodically feeds back to the master clock. Finally, the slave clock calculates and adjusts its local clock to synchronize with the master clock based on the received time, thereby achieving synchronization between the master and slave clocks.

[0004] However, the smaller the period of the Sync message sent by the master clock, the more frequent the time correction of the robot network device. Although this can improve time accuracy within the local area network, it also leads to frequent message transmissions, thereby increasing the occupancy of network bandwidth and affecting the transmission efficiency of other data streams. Summary of the Invention

[0005] The problem solved by the present invention is how to solve the problem that the frequent sending of time synchronization messages due to the time synchronization method in the time-sensitive network applied to the robot operating system occupies the network bandwidth of the local area network, thereby affecting the transmission efficiency of other data streams.

[0006] To solve the above problem, the present invention provides a method and system for optimizing network load of a robot operating system based on a time-sensitive network.

[0007] In a first aspect, the present invention provides a method for optimizing network load of a robot operating system based on a time-sensitive network, which is applied to a local area network under the robot operating system. The local area network includes a time synchronization system constructed based on a master clock and multiple slave clocks. The method for optimizing network load of the robot operating system based on the time-sensitive network includes:

[0008] When the master clock periodically sends a declaration message to each of the slave clocks to exchange clock information,

[0009] Obtain the previous time data between the master clock and each of the slave clocks, where the time data is the time data during the time synchronization process between the master clock and each of the slave clocks;

[0010] Obtain the corresponding time deviation and network delay according to each of the time data, and obtain the current network load data of the local area network according to all the time deviations and the network delay;

[0011] Based on a preset threshold, compare with the current network load data to obtain the comparison result, and adjust the port parameters of the master clock according to the comparison result.

[0012] Optionally, the port parameters include an internal synchronization period; based on a preset threshold, compare with the current network load data to obtain the comparison result, and adjust the port parameters of the master clock according to the comparison result, including:

[0013] When the current network load data is greater than the preset threshold, adjust the corresponding internal synchronization period according to a first preset period;

[0014] When the current network load data is less than or equal to the preset threshold, adjust the corresponding internal synchronization period according to a second preset period;

[0015] The internal synchronization period is the synchronization message sending period corresponding to the port of the master clock.

[0016] Optionally, the time data includes first time data, second time data, third time data, and fourth time data; when the master clock periodically sends a declaration message to each of the slave clocks to exchange clock information, obtaining the previous time data between the master clock and each of the slave clocks includes:

[0017] Send a synchronization message from the master clock to each of the slave clocks, and send the time when the corresponding synchronization message leaves the master clock to the corresponding slave clock as the corresponding first time data;

[0018] When receiving the corresponding synchronization message from the slave clock, record the arrival time of the synchronization message, and use the arrival time of the synchronization message as the second time data;

[0019] Each slave clock sends a delay request message to the master clock, and use the time when the corresponding delay request message leaves the slave clock as the corresponding third time data;

[0020] When the master clock receives the delay request message, record the arrival time of each delay request message, and use the arrival time of the delay request message as the fourth time data, and send it to the corresponding slave clock through a delay reply message.

[0021] Optionally, obtaining the corresponding time deviation and network delay according to each time data includes:

[0022] According to the corresponding first time data, second time data, third time data and fourth time data, respectively obtain the corresponding time deviation and network delay through Formula 1 and Formula 2;

[0023] Among them, Formula 1 is:

[0024] ;

[0025] Formula 2 is:

[0026] ;

[0027] Among them, is the first time data, is the second time data, is the third time data, is the fourth time data, offset is the time deviation, and delay is the network delay.

[0028] Optionally, the delay request message structure includes a sending timestamp, the previous time deviation of the corresponding slave clock, and the network delay.

[0029] Optionally, obtaining the current network load data of the local area network according to all the time deviations and the network delay includes:

[0030] Obtain the initial weights of each node in the local area network;

[0031] According to all the time deviations and the network delay, and based on the corresponding initial weights, obtain the current network load data.

[0032] Optionally, obtaining the current network load data according to all the previous time deviations and the network delay and based on the corresponding initial weights includes:

[0033] Obtaining the current network load data through Equation 3 based on all the time deviations and the network delay and based on the corresponding initial weights;

[0034] wherein, Equation 3 is:

[0035] ;

[0036] wherein, is the current network load data, is the initial weight of node i, n is the number of nodes, is the previous time deviation between node i and the master node, is the previous network delay between node i and the master node; a and b are respectively the preset proportions of the time deviation and the network delay in the load condition, and a + b = 1, 0 ≤ a ≤ 1, 0 ≤ b ≤ 1.

[0037] Optionally, the network load optimization of the robot operating system based on the time-sensitive network further includes:

[0038] Corresponding to the calculated corresponding time deviation and network delay from the slave clock, adjusting the current corresponding local clock according to the time deviation and the network delay to synchronize with the master clock.

[0039] In a second aspect, the present invention provides a network load optimization system for a robot operating system based on a time-sensitive network, which is applied to a local area network under the robot operating system. The local area network includes a time synchronization system constructed based on a master clock and multiple slave clocks. The network load optimization system for the robot operating system based on the time-sensitive network includes:

[0040] An acquisition unit, configured to obtain the previous time data between the master clock and each slave clock when the master clock periodically sends a declaration message to each slave clock to exchange clock information, and the time data is the time data during the time synchronization process between the master clock and each slave clock;

[0041] A processing unit, configured to obtain the corresponding time deviation and network delay according to each time data, and obtain the current network load data of the local area network according to all the time deviations and the network delay; compare with the current network load data based on a preset threshold to obtain a comparison result, and adjust the port parameters of the master clock according to the comparison result.

[0042] In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for optimizing the network load of a robot operating system based on a time-sensitive network as described in the first aspect is implemented.

[0043] The beneficial effects of the method and device for optimizing the network load of a robot operating system based on a time-sensitive network according to the present invention are as follows:

[0044] In a local area network under the framework of a robot operating system, first, the master clock periodically sends declaration messages to all slave clocks to exchange clock information and maintain time synchronization. During each time synchronization process, the time data between the master clock and each slave clock in the previous time is collected. These time data generally include the sending time of the Sync (synchronization) message sent by the master clock, the arrival time of the Sync message recorded by the slave clock, the sending time of the Delay_Req (delay request) message, and the arrival time of the Delay_Resp (delay response) at the master clock; according to the collected time data, the time deviation (i.e., the degree of clock non-synchronization) and network delay (i.e., the time required for a data packet to be transmitted in the network) between the master clock and each slave clock are calculated.

[0045] And by using the time deviation and network delay of all slave clocks, the current network load data of the local area network is comprehensively obtained. This data reflects the load situation of the network in the current state. Generally, the current network load data is calculated from the corresponding time deviation and network delay in the previous time; and the current network load data is compared with a preset threshold. If the current load exceeds the threshold, it indicates that there may be a risk of network congestion or overload. According to the comparison result, the port parameters of the master clock are adjusted (for example, adjusting the sending frequency of the Sync message or changing the priority of the data stream) to optimize the network load.

[0046] By intelligently adjusting the port parameters of the master clock in the robot operating system, unnecessary time synchronization message transmissions are reduced, thereby reducing the occupation of network bandwidth and improving the overall network transmission efficiency. And this method can dynamically adapt to different network load situations while ensuring the time synchronization accuracy, avoiding network congestion caused by frequent sending of time synchronization messages. At the same time, by real-time monitoring and adjusting the network load, it can effectively avoid the time synchronization failure caused by network overload, enhancing the stability and reliability of the system.

[0047] In summary, the present invention can be dynamically adjusted according to the actual network status in the robot operating system, with strong adaptability, and is suitable for local area networks with various different loads and application scenarios. Moreover, by optimizing network load and improving system stability, the faults and maintenance requirements caused by network problems are reduced, thereby reducing the overall maintenance cost. That is, the network load optimization method of the present invention not only solves the problems of bandwidth occupation and time error in the prior art, but also improves the performance and reliability of the local area network, and has good application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a schematic flowchart of a method for optimizing the network load of a robot operating system based on a time-sensitive network according to an embodiment of the present invention;

[0049] Figure 2 It is a schematic diagram of the interaction process of master-slave clock synchronization and dynamic adjustment messages according to an embodiment of the present invention;

[0050] Figure 3 It is a schematic diagram of the Delay_Req message structure according to an embodiment of the present invention;

[0051] Figure 4 It is a schematic diagram of the structure of a method for optimizing the network load of a robot operating system based on a time-sensitive network under the framework of the robot operating system according to an embodiment of the present invention;

[0052] Figure 5 It is a schematic diagram of the structure of a system for optimizing the network load of a robot operating system based on a time-sensitive network according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0053] In order to make the above objects, features, and advantages of the present invention more obvious and understandable, the following will describe in detail the specific embodiments of the present invention with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not used to limit the protection scope of the present invention.

[0054] It should be understood that the various steps recorded in the method embodiments of the present invention can be executed in different orders and / or executed in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this regard.

[0055] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to"; the term "based on" means "at least partially based on"; the term "an embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts such as "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0056] It should be noted that the modifications of "one" and "plural" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly specified in the context, it should be understood as "one or more".

[0057] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0058] In the prior art, during the operation of the PTP protocol, the master clock periodically sends Sync messages and Follow_up messages to the slave clock, carrying timestamp information, thereby achieving clock synchronization. The specific process is as follows: Sync message sending: The master clock periodically sends Sync messages, carrying the time estimate value (originTimestamp). Follow_up message sending: Immediately afterwards, the master clock sends Follow_up messages, carrying the precise sending time of the Sync message (preciseOriginTimestamp). Slave clock time recording: The slave clock records the arrival time of the Sync message and the precise sending time of the Follow_up message. Delay request: The slave clock sends Delay_Req messages and records the sending time. Master clock response: The master clock records the time when the Delay_Req message is received and sends Delay_Resp messages, carrying the time information. Clock deviation calculation: The slave clock calculates the clock deviation between the local clock and the master clock based on the received time information and adjusts the local clock to maintain synchronization. Through the above steps, clock synchronization between the master clock and the slave clock is achieved. However, the smaller the period of the Sync message sent by the master clock, the more frequent the time correction of the network device. Although the time accuracy within the local area network can be improved, it will also result in frequent message transmissions, thereby increasing the occupancy of network bandwidth and affecting the transmission efficiency of other data streams.

[0059] That is, 1. Frequent sending of Sync messages will occupy the bandwidth of the local area network, affecting the transmission of other data streams, potentially causing network congestion and reducing the overall network performance. 2. How to optimize the sending frequency of Sync messages while ensuring the time synchronization accuracy to reduce the network burden is an urgent problem to be solved. 3. In high-load situations, how to manage and reduce the latency and jitter caused by frequent message transmission to ensure the real-time performance of critical applications is a major challenge in technical implementation. 4. Existing solutions lack a dynamic adjustment mechanism for the sending period of Sync messages and cannot optimize the sending frequency in real time according to network load and clock deviation, resulting in poor performance under different network conditions. 5. Frequent time synchronization processes increase the complexity of the system, potentially causing difficulties in fault troubleshooting and maintenance and affecting the stability and reliability of the system.

[0060] In summary, although PTP and TSN provide high-precision time synchronization mechanisms, in practical applications, how to balance the accuracy of time synchronization with issues such as network bandwidth occupation, latency, and system complexity remains a technical challenge that requires in-depth research and solution.

[0061] Based on this, as Figure 1 shown, a method for optimizing the network load of a robot operating system based on a time-sensitive network provided by an embodiment of the present invention is applied to a local area network under the robot operating system. The local area network includes a time synchronization system constructed based on a master clock and multiple slave clocks. The method for optimizing the network load of the robot operating system based on the time-sensitive network includes:

[0062] S100, when the master clock periodically sends a declaration message to each of the slave clocks to exchange clock information, obtain the time data between the previous master clock and each of the slave clocks. The time data is the time data during the time synchronization process between the master clock and each of the slave clocks.

[0063] Specifically, the master clock periodically sends a declaration message to all slave clocks. This message contains the current time information of the master clock and is usually transmitted in a specific format to ensure that the slave clocks can accurately parse it.

[0064] When the master clock sends a declaration message, it records the timestamp at this moment, which is called the transmission time. At the same time, when each slave clock receives the declaration message, it also records the timestamp of receiving this message, which is called the reception time. The master clock periodically sends Announce (declaration) messages to the slave clocks and exchanges clock information with each other. At the same time, the master clock will periodically send Sync (synchronization) messages and record the exact transmission time when the Sync message leaves the master clock. After receiving the Sync (synchronization) message, the slave clock will reply to the master clock according to the specified process, usually by sending a response message (such as Delay_Req, delay request message) to confirm the reception situation. When the master clock receives this response, it records the reception time and sends a Delay_Resp (delay response) message to the corresponding slave clock. The recorded timestamps are used as the data basis for the subsequent process.

[0065] S200, obtain the corresponding time deviation and network delay according to each of the time data, and obtain the current network load data of the local area network according to all the time deviations and the network delay;

[0066] Specifically, within a period of time, the master clock generally collects time deviation and network delay data of multiple slave clocks. These data are statistically analyzed to form a record library for subsequent analysis. According to all the collected time deviation and network delay data, statistical methods can be used to calculate the current load of the local area network. It should be noted that the current network load data is generally calculated using the previous time deviation and network delay data.

[0067] By analyzing the calculated average time deviation and network delay, it can help evaluate the current network load situation. For example, if the network delay increases, it may mean that the network is being affected by a higher load.

[0068] At the same time, periodically calculating the time deviation can ensure that the time between the slave clock and the master clock remains consistent, improving the overall time synchronization accuracy of the system. And by real-time monitoring the network load, network administrators can flexibly adjust resource allocation to ensure the stable operation of critical applications under high load conditions.

[0069] Through the above process, the master clock can obtain and analyze the time deviation and network delay of the slave clock, so as to evaluate the current load of the local area network in real time. This analysis not only improves the accuracy of time synchronization and network performance, but also provides necessary data support for network management, ensuring the stability and efficient operation of the system.

[0070] S300, based on a preset threshold, compare with the current network load data to obtain the comparison result, and adjust the port parameters of the master clock according to the comparison result.

[0071] Specifically, according to the requirements and load characteristics of network operation, a set of preset thresholds can be set. These thresholds usually include: Load threshold: indicating the maximum load value allowed by the network, exceeding which may affect the network performance. Delay threshold: reflecting the acceptable limits of network response time.

[0072] For example: maximum load threshold (such as 80%) and maximum delay threshold (such as 100 ms). According to the method described in the previous steps, calculate the current network load data, including average time deviation and average network delay. Compare the calculated current network load data with the preset thresholds: If the current network load exceeds the preset load threshold, or the network delay exceeds the delay threshold, it indicates that the network load is high and may affect the application performance. On the contrary, if it is lower than the threshold, it indicates that the network is operating normally.

[0073] According to the comparison result, decide whether to adjust the port parameters of the master clock. After adjusting the parameters, continuously monitor the network load and delay to evaluate the effectiveness of the adjustment measures. If the load data improves, it indicates that the adjustment is successful; if there is no improvement, further analysis and optimization may be required.

[0074] By dynamically adjusting the master clock port parameters according to the network load, identifying and responding to network load changes in a timely manner, the probability of system failures can be reduced, and the continuous availability of critical application programs can be ensured. And by monitoring the comparison between the load data and the preset thresholds, more scientific decisions can be made based on actual data, instead of relying on a single static configuration.

[0075] Therefore, by comparing the current network load data with the preset thresholds and adjusting the master clock port parameters according to the comparison result, effective monitoring and dynamic optimization of the network condition can be achieved. This process not only improves the network performance and reliability, but also provides more efficient decision support for network management, ensuring the stable operation of the system under various loads.

[0076] In this embodiment, in the local area network under the robot operating system framework, the master clock periodically sends declaration messages to all slave clocks to exchange clock information and maintain time synchronization. During each time synchronization process, collect the time data between the previous time and each slave clock. These time data generally include the sending time of the Sync (synchronization) message sent by the master clock, the arrival time of the Sync message recorded by the slave clock, the sending time of the Delay_Req (delay request) message, and the arrival time of the Delay_Resp (delay response) at the master clock; according to the collected time data, calculate the time deviation (i.e., the degree of clock asynchrony) and network delay (i.e., the time required for data packets to be transmitted in the network) between the master clock and each slave clock.

[0077] Utilize the time deviation and network delay of all slave clocks to comprehensively obtain the current network load data of the local area network. This data reflects the load situation of the network in the current state. Generally, the current network load data is calculated through the corresponding time deviation and network delay of the previous time; and compare the current network load data with a preset threshold. If the current load exceeds this threshold, it indicates that there may be congestion or overload risks in the network. According to the comparison result, adjust the port parameters of the master clock (for example, adjust the sending frequency of Sync messages or change the priority of data streams) to optimize the network load.

[0078] By adjusting the port parameters of the master clock in the intelligent robot operating system, unnecessary time synchronization message transmissions are reduced, thereby reducing the occupancy of network bandwidth and improving the overall network transmission efficiency. And this method can dynamically adapt to different network load situations while ensuring the time synchronization accuracy, avoiding network congestion caused by frequent sending of time synchronization messages. At the same time, by real-time monitoring and adjusting the network load, it can effectively avoid the time synchronization failure caused by network overload, enhancing the stability and reliability of the system.

[0079] In summary, the present invention can be dynamically adjusted according to the actual network state in the robot operating system, has strong adaptability, and is suitable for local area networks with various different loads and application scenarios. And by optimizing the network load and improving the stability of the system, the failures and maintenance requirements caused by network problems are reduced, thereby reducing the overall maintenance cost. That is, the network load optimization method of the present invention not only solves the problems of bandwidth occupancy and time error in the prior art, but also improves the performance and reliability of the local area network, and has good application prospects.

[0080] Optionally, the port parameters include an internal synchronization period; based on the preset threshold, compare with the current network load data to obtain the comparison result, and adjust the port parameters of the master clock according to the comparison result, including:

[0081] When the current network load data is greater than the preset threshold, adjust the corresponding internal synchronization period according to the first preset period;

[0082] When the current network load data is less than or equal to the preset threshold, adjust the corresponding internal synchronization period according to the second preset period;

[0083] The internal synchronization period is the sending period of the synchronization message corresponding to the port of the master clock.

[0084] Specifically, set a preset threshold, and judge the current network load data based on the preset threshold to determine whether the port of the master clock needs to be adjusted at this time. It should be noted that the preset threshold here can be a range value.

[0085] For example, optionally, the preset threshold includes a first preset threshold and a second preset threshold, and the first preset threshold is greater than the second preset threshold;

[0086] When the current network load data is greater than the first preset threshold, the corresponding internal synchronization period is adjusted according to the first preset period;

[0087] When the current network load data is less than or equal to the second preset threshold, the internal synchronization period is adjusted according to the second preset period.

[0088] That is, the first preset threshold: used to determine how to adjust the internal synchronization period when the current network load is higher than this value. For example, when the load exceeds 80% (the first preset threshold), the synchronization frequency may need to be reduced. The second preset threshold: used to determine how to adjust the internal synchronization period when the current network load is lower than or equal to this value. For example, when the load is lower than or equal to 60% (the second preset threshold), the synchronization frequency can be increased to ensure timely data update.

[0089] According to the previous method, the master clock regularly calculates the current network load data, including the average time deviation and network delay. These data will be used for subsequent comparison and decision-making.

[0090] Compare the current network load data with the threshold: If the current network load data is greater than the first preset threshold, it indicates that the network is in a high-load state and there may be a congestion risk. If the current network load data is less than or equal to the second preset threshold, it indicates that the network load is in a normal or low-load state, and the synchronization frequency can be increased.

[0091] When the current network load is greater than the first preset threshold, according to the first preset period, the master clock will adjust its internal synchronization period. For example, reduce the sending frequency of synchronization messages (such as from once per second to once every two seconds) to reduce the network burden. That is, adjust the Sync message sending period SyncInternal of the master clock's port parameters, such as reducing the parameter by 10%.

[0092] When the current network load is less than or equal to the second preset threshold, according to the second preset period, the master clock will increase the synchronization frequency to ensure the timeliness and accuracy of time data. For example, increase the sending frequency of synchronization messages (such as from once every two seconds to once per second). That is, adjust the Sync message sending period SyncInternal of the master clock's port parameters, for example, increase the parameter by 10%.

[0093] After adjusting the internal synchronization period, the master clock will continue to monitor the network load, time deviation, and delay data to evaluate the adjustment effect. If the network load remains high, further adjustment may be required; otherwise, the adjusted synchronization frequency is maintained.

[0094] By reasonably adjusting the synchronization period and reducing the transmission of unnecessary synchronization messages, the consumption of network resources can be reduced, and the overall network utilization efficiency can be improved. Moreover, increasing the synchronization frequency when the network load is low can ensure a high time accuracy among various clocks, while reducing the frequency under high load conditions to reduce risks. At the same time, reducing the synchronization period when high load is detected helps to reduce the number of data packets in the network, thereby alleviating network pressure and enhancing transmission efficiency. Therefore, dynamically adjusting the synchronization period enables the system to quickly respond to changes in the network state and more flexibly adapt to different operating environments. Meanwhile, by effectively managing the transmission frequency of synchronization messages, network bottlenecks caused by excessive load are reduced, thereby improving the overall reliability and stability of the system.

[0095] By comparing the current network load data with the set threshold and adjusting the internal synchronization period of the master clock, network performance can be effectively managed and optimized. This adjustment process not only improves the time synchronization accuracy and the utilization efficiency of network resources, but also enhances the flexibility and stability of the system, ensuring that the system can always maintain effective operation and data synchronization in different network environments.

[0096] It should be noted that the transmission period of the Sync message of the master clock is defined in its port.

[0097] Optionally, it is characterized in that the time data includes first time data, second time data, third time data, and fourth time data; when the master clock periodically sends a declaration message to each of the slave clocks to exchange clock information, obtaining the time data between the previous master clock and each of the slave clocks includes:

[0098] By sending a synchronization message from the master clock to each of the slave clocks and sending the time when the corresponding synchronization message leaves the master clock to the corresponding slave clock as the corresponding first time data;

[0099] When the slave clock receives the corresponding synchronization message, record the arrival time of the synchronization message and use the arrival time of the synchronization message as the second time data;

[0100] By sending a delay request message from each of the slave clocks to the master clock and using the time when the corresponding delay request message leaves the slave clock as the corresponding third time data;

[0101] When the master clock receives the delay request message, record the arrival time of each delay request message and use the arrival time of the delay request message as the fourth time data, and send it to the corresponding slave clock through a delay reply message.

[0102] Optionally, obtaining corresponding time deviation and network delay according to each of the time data includes:

[0103] Obtaining the corresponding time deviation and the network delay respectively through Equation 1 and Equation 2 according to the corresponding first time data, second time data, third time data, and fourth time data;

[0104] Wherein, Equation 1 is:

[0105] ;

[0106] Equation 2 is:

[0107] ;

[0108] Wherein, is the first time data, is the second time data, is the third time data, is the fourth time data, offset is the time deviation, and delay is the network delay.

[0109] In some embodiments, as Figure 2 shown, in a local area network, the time synchronization process between the master clock and the slave clock:

[0110] Step 1: The master clock periodically sends an Announce message to the slave clock and exchanges their clock information. The master clock periodically sends a Sync message and records the exact transmission time when the message leaves the master clock (the first time data ). Among them, the master clock sends an Announce message to exchange information such as priority, clock quality, and clock ID between the master and slave clocks. The messages sent by the master clock can be divided into two categories: event-based messages and general-purpose messages. Event-based messages include Sync, Delay_Req, and Delay_Resp, while general-purpose messages include Follow_up and Announce. During the sending and receiving process of event-based messages, each node needs to record its sending and receiving times.

[0111] Step 2: The master clock encapsulates the exact transmission time into a Follow_up message and sends it to the slave clock.

[0112] Step 3: The slave clock records the exact arrival time when the Sync message arrives at its device (the second time data ).

[0113] Step 4: Send a Delay_Req message from the slave clock and record the exact transmission time of this message (the third time data ).

[0114] Step 5: The master clock records the exact arrival time when the Delay_Req message arrives at its device (the fourth time data ).

[0115] Step 6: The master clock encapsulates the recorded time information into a Delay_Resp message and sends it to the slave clock.

[0116] Step 7: After the slave clock receives the Delay_Resp message, at this time the slave clock has collected , , , four exact times.

[0117] Step 8: Each slave clock calculates the corresponding time deviation offset and network delay delay through Equation 1 and Equation 2 according to the corresponding , , , four exact times;

[0118] Step 9: Each slave clock gradually adjusts the current local clock through the obtained time deviation and network delay, accumulates multiple times, and finally adjusts the local clock to be synchronized with the master clock.

[0119] Optionally, the Delay_Req message structure includes a transmission timestamp, the previous time deviation of the corresponding slave clock, and the network delay.

[0120] Specifically, as Figure 3 shown, the schematic diagram of the Delay_Req message structure. It includes latestOffset (the latest time deviation): used to carry the offset value calculated by the slave clock most recently; latestDelay (the latest network delay): used to carry the delay value calculated by the slave clock most recently. The latest time deviation and the latest network delay here both refer to the previous time deviation and network delay. It also includes: header: PTP message header; originTimestamp: transmission timestamp, etc.

[0121] Optionally, obtaining the current network load data of the local area network according to all the time deviations and the network delay includes:

[0122] Obtain the initial weights of each node in the local area network;

[0123] Based on all the time deviations and the network delays, and based on the corresponding initial weights, obtain the current network load data.

[0124] The obtaining of the current network load data according to all the previous time deviations and the network delays, and based on the corresponding initial weights, includes:

[0125] Based on all the time deviations and the network delays, and based on the corresponding initial weights, obtain the current network load data through Equation Three;

[0126] Among them, Equation Three is:

[0127] ;

[0128] Among them, is the current network load data, is the initial weight of node i, n is the number of nodes, is the previous time deviation between node i and the master node, is the previous network delay between node i and the master node; a and b are respectively the preset proportions of the time deviation and the network delay under the load condition, and a + b = 1, 0 ≤ a ≤ 1, 0 ≤ b ≤ 1.

[0129] It should be noted that for the setting of a and b, their magnitudes depend on the importance of the node in the local area network and can be set according to the actual situation.

[0130] Optionally, the network load optimization of the robot operating system based on the time-sensitive network further includes:

[0131] When the slave clock calculates the corresponding time deviation and network delay, adjust the current corresponding local clock according to the time deviation and network delay to synchronize with the master clock.

[0132] Specifically, after the slave clock receives the synchronization message sent by the master clock, the slave clock will calculate the current time deviation and network delay. Specifically, the time deviation refers to the difference between the local time of the slave clock and the master clock time, and the network delay refers to the time required for the synchronization message to be transmitted in the network.

[0133] By considering time deviation and network latency, the slave clock can more accurately adjust its local time and achieve higher-precision synchronization with the master clock. And accurate time synchronization helps improve the stability of the system, especially in time-sensitive application scenarios such as financial transactions, industrial automation, and real-time data processing. At the same time, by reducing retransmission and additional communication caused by time asynchronization, the network load can be effectively reduced and the utilization rate of network resources can be improved. When the network conditions change, the slave clock can dynamically adjust its local time to ensure accurate time synchronization under different network states.

[0134] In summary, by adjusting the local clock based on time deviation and network latency, the accuracy of time synchronization and the overall performance of the system can be significantly improved.

[0135] It should be noted that during the process of sending synchronization messages between the master and slave clocks, the influence of network latency exists. In fact, the network latency may vary depending on the direction of data transmission and the current network state. Therefore, each time clock synchronization is performed, the network latency needs to be recalculated to ensure the accuracy of synchronization. And the sending time of the Delay_Req message is random, and the time interval between consecutive Delay_Req messages is generally less than the sending period of the Sync message. Therefore, each time the Delay_Req message is sent, the slave clock needs to recalculate.

[0136] In some specific embodiments, such as Figure 4 shown, is a schematic structural diagram of a method for optimizing the network load of a robot operating system based on a time-sensitive network in the robot operating system framework. That is, the network load optimization method based on the time-sensitive network (TSN) in the master-slave system architecture aims to improve the efficiency and accuracy of real-time communication. The actual process of this method: in Figure 4 the application scenario shown, both the master and slave ends include a robot operating system, a communication protocol, and TSN software. The master end exchanges data with the slave end through the TSN network device to ensure the real-time transmission of control information.

[0137] First of all, the system needs to classify the data streams and set priorities for different types of data streams. Critical data streams, such as control signals and sensor data, should be given higher priorities to ensure their priority transmission in the network. Through the traffic scheduling mechanism of TSN, and in the master-slave system, the Precision Time Protocol (PTP) is used to achieve the synchronization of the master and slave clocks, then the method for optimizing the network load of the robot operating system based on the time-sensitive network includes the following steps:

[0138] The master clock periodically sends Announce messages to notify the slave clocks and exchange clock information. Subsequently, the master clock periodically sends Sync messages and records the transmission time; it sends this time to the slave clocks via Follow_up messages.

[0139] The slave clock records the arrival time of the Sync message, sends a Delay_Req message, and records the transmission time.

[0140] The master clock records the arrival time of the Delay_Req message and encapsulates this time into a Delay_Resp message to send to the slave clock.

[0141] The slave clock calculates the time deviation and network delay between the master and slave clocks and adjusts the local clock.

[0142] In a new cycle, the master clock collects the time deviation and network delay information of the slave clocks through Delay_Req messages, calculates the network load condition, and compares it with a set threshold. If the deviation is large, the time synchronization cycle is shortened; otherwise, the time synchronization cycle is extended.

[0143] In this embodiment, by dynamically adjusting the start and stop of the time synchronization process of the master clock, the occupation of the network communication bandwidth by PTP time synchronization messages is reduced, the network load is lowered, and the reliability of the system is improved. Secondly, the method adopted only utilizes the blank fields reserved in the Announce message, which is convenient for the system to identify the message and reduces the system burden. Finally, this method determines whether the local area network needs to continue time synchronization through the messages in the existing protocol. While utilizing the existing resources, no additional overhead is required. It dynamically adjusts whether to continue sending time synchronization messages next time according to the time deviation condition of the current network, thereby reducing the overhead of network communication resources while ensuring the time consistency and accuracy within the local area network and improving the stability of the robot operating system.

[0144] As Figure 5 shown, a network load optimization system 500 for a robot operating system based on a time-sensitive network provided by an embodiment of the present invention includes:

[0145] An acquisition unit 510, configured to obtain the time data between the master clock and each slave clock in the previous time when the master clock periodically sends a declaration message to each slave clock to exchange clock information, where the time data is the time data during the time synchronization process between the master clock and each slave clock;

[0146] A processing unit 520 is configured to obtain corresponding time deviations and network delays according to the respective time data, and obtain current network load data of the local area network based on all the time deviations and the network delays; compare with the current network load data based on a preset threshold to obtain a comparison result, and adjust port parameters of the master clock according to the comparison result.

[0147] The network load optimization system of the robot operating system based on the time-sensitive network in this embodiment is used to implement the network load optimization method of the robot operating system based on the time-sensitive network as described above. Its advantages compared with the prior art are the same as those of the above-mentioned network load optimization method of the robot operating system based on the time-sensitive network compared with the prior art, and will not be elaborated here.

[0148] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will all fall within the protection scope of the present invention.

Claims

1. A method for optimizing network load of a robot operating system based on a time-sensitive network, characterized in that Applied to the local area network under the robot operating system, the local area network includes a time synchronization system built based on a master clock and multiple slave clocks. The method for optimizing the network load of the robot operating system based on the time-sensitive network includes: When the master clock periodically sends a declaration message to each of the slave clocks to exchange clock information, Obtain the previous time data between the master clock and each of the slave clocks. The time data is the time data during the time synchronization process between the master clock and each of the slave clocks; Obtain the corresponding time deviation and network delay according to each of the time data, and obtain the current network load data of the local area network according to all the time deviations and the network delay, including: Obtain the initial weights of each node in the local area network; Obtain the current network load data according to all the previous time deviations and the network delay, and based on the corresponding initial weights, including: Obtain the current network load data through Equation Three according to all the previous time deviations and the network delay, and based on the corresponding initial weights; Among them, Equation Three is: ; Among them, is the current network load data, is the initial weight of node i, n is the number of nodes, is the previous time deviation between node i and the master node, is the previous network delay between node i and the master node; a and b are the preset proportions of the time deviation and network delay under the load condition, respectively, and a + b = 1, 0 ≤ a ≤ 1, 0 ≤ b ≤ 1; Based on a preset threshold, compare with the current network load data to obtain the comparison result, and adjust the port parameters of the master clock according to the comparison result.

2. The method for optimizing the network load of a robot operating system based on a time-sensitive network according to claim 1, wherein The port parameters include the internal synchronization period; based on a preset threshold, compare with the current network load data to obtain the comparison result, and adjust the port parameters of the master clock according to the comparison result, including: When the current network load data is greater than the preset threshold, adjust the corresponding internal synchronization period according to the first preset period; When the current network load data is less than or equal to the preset threshold, adjust the corresponding internal synchronization period according to the second preset period; The internal synchronization period is the synchronization message sending period corresponding to the port of the master clock.

3. The method for optimizing network load of a robot operating system based on a time-sensitive network according to claim 1, wherein The time data includes first time data, second time data, third time data, and fourth time data; when the master clock periodically sends a declaration message to each of the slave clocks to exchange clock information, obtaining the previous time data between the master clock and each of the slave clocks includes: Send a synchronization message from the master clock to each of the slave clocks, and send the time when the corresponding synchronization message leaves the master clock to the corresponding slave clock as the corresponding first time data; When the slave clock receives the corresponding synchronization message, record the arrival time of the synchronization message, and use the arrival time of the synchronization message as the second time data; Send a delay request message from each of the slave clocks to the master clock, and use the time when the corresponding delay request message leaves the slave clock as the corresponding third time data; When the master clock receives the delay request message, record the arrival time of each delay request message, and use the arrival time of the delay request message as the fourth time data, and send it to the corresponding slave clock through a delay reply message.

4. The method for optimizing network load of a robot operating system based on a time-sensitive network according to claim 3, wherein The obtaining the corresponding time deviation and network delay according to each of the time data includes: According to the corresponding first time data, second time data, third time data, and fourth time data, the corresponding time deviation and network delay are obtained respectively through Equation 1 and Equation 2; wherein, Equation 1 is: ; Equation 2 is: ; Among them, is the first time data, is the second time data, is the third time data, is the fourth time data, offset is the time deviation, and delay is the network delay.

5. The method for optimizing the network load of a robot operating system based on a time-sensitive network according to claim 3, wherein The delay request message structure includes a sending timestamp, the previous time deviation of the corresponding slave clock, and the network delay.

6. The method for optimizing network load of a robot operating system based on a time-sensitive network according to claim 1, wherein The network load optimization of the robot operating system based on the time-sensitive network further includes: In response to the slave clock calculating the corresponding time deviation and network delay, the current corresponding local clock is adjusted according to the time deviation and network delay to synchronize with the master clock.

7. A robot operating system network load optimization system based on a time-sensitive network, characterized in that, Applied to the local area network under the robot operating system, the local area network includes a time synchronization system constructed based on a master clock and multiple slave clocks. The network load optimization system of the robot operating system based on the time-sensitive network includes: An acquisition unit, configured to acquire the previous time data between the master clock and each slave clock when the master clock periodically sends a declaration message to each slave clock to exchange clock information, where the time data is the time data during the time synchronization process between the master clock and each slave clock; A processing unit, configured to obtain the corresponding time deviation and network delay according to each time data, and obtain the current network load data of the local area network according to all the time deviations and network delays, including: acquiring the initial weights of each node in the local area network; obtaining the current network load data according to all the time deviations and network delays and based on the corresponding initial weights, including: obtaining the current network load data through Equation 3 according to all the time deviations and network delays and based on the corresponding initial weights; wherein, Equation 3 is: ; Among them, is the current network load data, is the initial weight of node i, n is the number of nodes, is the previous time deviation between node i and the master node, is the previous network delay between node i and the master node; a and b are the preset ratios of the time deviation and the network delay under the load condition respectively, and a + b = 1, 0 ≤ a ≤ 1, 0 ≤ b ≤ 1; Based on a preset threshold, compare with the current network load data to obtain the comparison result, and adjust the port parameters of the master clock according to the comparison result.

8. A computer-readable storage medium, characterized in that, A computer program is stored on the storage medium, and when the computer program is executed by a processor, the network load optimization method of the robot operating system based on the time-sensitive network according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Time synchronization method and device, electronic equipment and storage medium

    CN118802046A

  • Method, device, and system for optimizing radio network

    US20130223403A1