A cross-network time synchronization method for AUTBUS and TSN integration
By integrating AUTBUS and TSN, and utilizing the IEEE 1588 protocol and linear regression prediction algorithm, end-to-end time synchronization between AUTBUS and TSN heterogeneous networks is achieved, solving the scale and distance limitations of TSN in wide area networks and improving synchronization accuracy and efficiency.
Patent Information
- Application Number
- CN202411538544.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-10-31
AI Technical Summary
Existing time-sensitive networks (TSNs) have scale limitations, topology limitations, and transmission distance limitations in wide-area network environments, and cannot meet the long-distance, multi-node communication needs of intelligent manufacturing. In addition, existing time synchronization methods have high computational complexity and high energy consumption.
A cross-network time synchronization method that integrates AUTBUS and TSN is adopted. Inter-link delay is measured through the IEEE 1588 protocol. Combined with bidirectional message synchronization inside and outside the gateway, a linear regression prediction algorithm is used to perform time compensation at the AUTBUS terminal to ensure end-to-end time synchronization in heterogeneous networks.
It achieves high-precision, low-complexity time synchronization of the AUTBUS and TSN fusion network, reduces the amount of computation and energy consumption, and improves the time consistency and synchronization efficiency of heterogeneous networks.
Smart Images

Figure CN119402122B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network time synchronization and relates to a cross-network time synchronization method for the integration of AUTBUS and TSN. Background Art
[0002] In traditional Ethernet, the inability to guarantee the delivery and arrival times of data packets leads to unreliable data transmission and uncertain latency, making it unable to meet the needs of time-sensitive applications. To address these issues, Time-Sensitive Networking (TSN) technology has emerged. By providing high-precision time synchronization and predictable data transmission services, TSN enables Ethernet applications in time-sensitive scenarios. However, TSN requires time information from all nodes in the network and performs time synchronization across the entire network, which limits its scalability. Furthermore, TSN faces limitations such as network topology and transmission distance. While TSN can provide highly reliable and low-latency communication services within local area networks (LANs), its limitations are particularly pronounced in wide-area network environments. To address TSN's limitations and adapt to the convergence and interoperability of various networks, protocols, and buses in the era of intelligent manufacturing, TSN is being integrated with other bus technologies.
[0003] With the increasing prevalence of intelligent manufacturing applications, its characteristics include small-scale personalized production, human-machine collaboration, information system integration, and high-efficiency manufacturing. These characteristics require new intelligent industrial equipment to have the ability to communicate with the controller layer and higher-level data application decision-making layers, and to possess functions such as data preprocessing, compression, and filtering, as well as the ability to perform new analytical tasks. Furthermore, the next-generation bus network in industrial sites must meet requirements such as intelligence, long distance, broadband, real-time, multi-service, and unified addressing. Traditional buses such as Profibus, ProfiNET, and CCLINK are no longer able to meet the continued development and application needs of intelligent manufacturing. To address these requirements, the next-generation high-performance industrial bus AUTBUS has emerged.
[0004] AUTBUS, a powerful and stable industrial fieldbus standard, has attracted widespread attention for its outstanding performance and stability. This bus system utilizes a two-wire medium and supports a maximum bandwidth of 100 Mbps, easily meeting various data transmission requirements, including periodic and aperiodic real-time data transmission, as well as non-real-time data transmission.
[0005] AUTBUS not only accommodates fixed- and variable-bandwidth data services, but also utilizes Orthogonal Frequency Division Multiplexing (OFDM) technology to build a deterministic, time-sensitive fieldbus communication network based on clock synchronization. This network architecture ensures the accuracy and real-time nature of data transmission, providing a solid communication foundation for industrial automation.
[0006] AUTBUS demonstrates unique advantages in networking. It supports long-distance, multi-node connections, with transmission distances up to 1000 meters at 100 Mbps, and can support up to 254 nodes. AUTBUS also supports bus and ring topologies, providing users with flexible and reliable networking options. AUTBUS also excels in transmission speed, with a minimum communication time slice of only 8µs and a minimum one-way transmission delay of less than 40µs, ensuring efficient and real-time communication.
[0007] To meet the continued development and application needs of intelligent manufacturing, AUTBUS is continuously exploring integration with advanced technologies such as TSN. By achieving end-to-end time synchronization across heterogeneous networks integrated with TSN, AUTBUS will ensure the simultaneous operation of various applications and devices across heterogeneous networks, further improving service quality and user experience. In the future, AUTBUS will continue to leverage its strengths and contribute to the development of industrial automation.
[0008] In summary, the integration of AUTBUS and TSN can overcome the limitations of TSN. Heterogeneous networks integrated with TSN are also a key trend in the era of intelligent manufacturing. Therefore, achieving end-to-end time synchronization in the AUTBUS and TSN converged network is an important prerequisite for unleashing the advantages of the AUTBUS and TSN converged network.
[0009] In terms of TSN time synchronization, the main methods currently used include IEEE 802.1AS, IEEE 1588, and Precision Time Protocol (gPTP). Y. Li et al. introduced the concept of wide-area Precision Time Protocol (gPTP) domains from the IEEE 802.1AS standard to establish a time synchronization model for wide-area TSNs (see Y. Li, Z. Yin, Y. Ma, F. Xu, F. Zhang, and G. Xu, "A Time Synchronization Method Based on Clustering Algorithm for Industrial Time-Sensitive Networks," 2023 15th International Conference on Communication Software and Networks (ICCSN), Shenyang, China, 2023, pp. 238-242, doi:10.1109 / ICCSN57992.2023.10297331.). Based on this, they proposed a large-scale dynamic time synchronization method for industrial TSNs based on a clustering algorithm. However, this method requires a large amount of computation in the dynamic partitioning part. Lu Hao et al. developed an IEEE 1588 time synchronization algorithm based on node self-compensation. This algorithm introduces the master-slave node compensation concept based on the IEEE 1588 protocol, taking the master node as the global center, and the slave node self-compensates according to the Kalman optimal estimate difference with the master node clock, thereby achieving high-precision time synchronization (see reference: Lu Hao, Yu Xiuwu, Liu Yong. IEEE 1588 clock synchronization algorithm based on node self-compensation [J]. Journal of Sensor Technology, 2023, 36(01): 53-59.). If the master node changes, the clock time of the entire network will change accordingly, which will lead to an increase in computational complexity and energy consumption.
[0010] In terms of time synchronization of industrial networks or fieldbuses, currently popular industrial networks or fieldbuses include 5G, Profibus, ProfiNET, and CCLINK. Based on the common characteristics of industrial networks, Shan Feiqiao et al. proposed a time synchronization method for IWSNs based on the Precision Time Protocol (PTP). First, considering the clock interference and asymmetric link noise in PTP bidirectional time synchronization, a clock state model was established. Secondly, a reverse adaptive Kalman filter algorithm was used to reduce noise interference. Then, the accuracy of the noise statistical model was evaluated by comparing the new information ratio of the reverse and forward estimates. Finally, based on the detection threshold, the clock state process noise was dynamically adjusted to accurately estimate the clock parameters (see reference: Shan Feiqiao, Wang Zhaowei, Shen Yue. Time synchronization method for industrial wireless sensor networks based on the Precision Time Protocol [J]. Computer Applications, 2023, 43(07): 2255-2260.). Under different clock timing accuracies, the clock offset and offset rate estimated by the reverse adaptive Kalman filter algorithm have smaller and more stable error standard deviations, effectively solving the Kalman filter divergence problem caused by noise uncertainty and other reasons, and improving the reliability of time synchronization, but the computational overhead is relatively large.
[0011] In terms of heterogeneous network time synchronization, 5G, as a popular communication technology in recent years, has made outstanding contributions to the development of the intelligent manufacturing era. Integrating 5G with various industrial networks has become a popular application direction. Based on cross-domain time synchronization of data packet relay, Z. Chai et al. proposed a cross-domain clock synchronization method based on data packet relay in the 5G-TSN integrated network. This method realizes the estimation of the residence time of 5G timing messages by introducing clock compensation technology, thereby improving the synchronization accuracy (see literature: Z. Chai, W. Liu, M. Li and J. Lei, "Cross Domain Clock Synchronization Based on Data Packet Relay in 5G-TSN Integrated Network," 2021 IEEE 4th International Conference on Electronics and Communication Engineering (ICECE), Xi'an, China, 2021, pp. 141-145, doi: 10.1109 / ICECE54449.2021.9674640.). At the same time, since the accuracy of time synchronization is related to the accuracy of the timestamp, the amount of computation will increase accordingly. Li Xiaohui et al. proposed a multi-beam joint timing synchronization algorithm based on IEEE 802.1AS, mathematically modeled the transmission signal, used cross-correlation and autocorrelation algorithms for synchronization detection, and estimated the propagation delay. This method can effectively synchronize the timing of multiple beams, and by adding differential operations, it can weaken the influence of frequency deviation and improve the synchronization success rate and accuracy (see literature: Li Xiaohui, Wang Xianwen, Fan Tao et al. High-precision time synchronization under 5G-TSN system [J]. Systems Engineering and Electronic Technology, 2023, 45(02): 559-565.). However, for higher frequency deviation values, the autocorrelation and cross-correlation algorithms have higher estimation errors, resulting in serious bit error rates. At the same time, the computational complexity is large and is limited by the geographical location and mobile network configuration. X. Chen et al. proposed a time synchronization scheme based on timestamp compensation and carrier spacing optimization. This solution uses timestamp compensation and carrier spacing optimization to improve synchronization accuracy, and takes into account the cumulative synchronization error in multi-bridge scenarios. Simulations have verified that this solution can provide high-precision time synchronization in multi-domain manufacturing system scenarios, enabling collaborative work over 5G networks. By integrating 5G and TSN networks, this solution can achieve end-to-end deterministic connectivity in industrial networks, providing strong support for collaborative manufacturing systems.This fusion scheme not only improves the real-time performance of communications but also enhances the reliability and efficiency of the entire system (see X. Chen, C. Chen and Q. Xu, "Clock Synchronization Scheme for Integrated 5G and TSN Networks in Collaborative Manufacturing Systems," 2023 42nd Chinese Control Conference (CCC), Tianjin, China, 2023, pp. 5397-5402, doi:10.23919 / CCC58697.2023.10240865.). However, this approach involves multiple technologies and protocols, making the research method complex and requiring additional resources and time. Given the complexity and variability of real-world situations, the experimental results in the literature may not fully reflect the actual situation.
[0012] The AUTBUS industrial fieldbus is a new bus standard, and its application and research are in their infancy. To adapt to the development of Industry 4.0 and the era of intelligent manufacturing, achieving end-to-end time synchronization in heterogeneous networks that integrate AUTBUS and TSN is crucial, laying the foundation for leveraging the performance advantages of heterogeneous networks. A time compensation prediction algorithm is implemented in AUTBUS terminals. This algorithm collects delay values from various components of the heterogeneous network and feeds them into the prediction algorithm. The prediction algorithm then outputs a time synchronization compensation value that is applied to the local clock of the AUTBUS terminal. This ultimately achieves end-to-end time synchronization in heterogeneous networks that integrate AUTBUS and TSN. Summary of the Invention
[0013] In view of this, the object of the present invention is to provide a cross-network time synchronization method for the integration of AUTBUS and TSN.
[0014] In order to achieve the above object, the present invention provides the following technical solutions:
[0015] A cross-network time synchronization method for AUTBUS and TSN integration includes the following steps:
[0016] Step 1: The TSN switch issues a command to complete the time synchronization within the TSN network through the IEEE 1588 protocol, completes the inter-link delay measurement, and transmits the inter-link delay data measured during the time synchronization process to the AUTBUS terminal;
[0017] Step 2: After the TSN module in the gateway completes time synchronization with the TSN switch, the TSN module in the gateway sends a command to the gateway AUTBUS module to complete the measurement of inter-link delay and time synchronization in the gateway through two-way message synchronization, and transmits the measured delay data to the AUTBUS terminal;
[0018] Step 3: After completing the time synchronization within the gateway, the gateway AUTBUS module starts to synchronize the time within the AUTBUS network. The AUTBUS management node and the AUTBUS terminal complete the inter-link delay measurement and time synchronization through two-way messaging, and transmit the inter-link delay data to the AUTBUS terminal.
[0019] Step 4: After completing steps 1 to 3, the delay data between the three links and the start time of the delay measurement period are stored in the AUTBUS terminal and input into the prediction algorithm. The output value of the prediction algorithm will be compensated to the local clock of the AUTBUS terminal, so that the time of the local clock of the AUTBUS terminal is synchronized with the master clock of the entire heterogeneous network, and finally the end-to-end time synchronization of the heterogeneous network integrating AUTBUS and TSN is completed.
[0020] Furthermore, the prediction algorithm is a linear regression prediction algorithm.
[0021] Furthermore, the linear regression prediction algorithm includes the following steps:
[0022] Step 41: Given a data set, the delay data between each link and the directly measured delay data between the AUTBUS terminal and the TSN switch are input to the algorithm as initial input;
[0023] Step 42: Obtain the objective function and loss function. To find the optimal parameters, a delay range is required for measurement, and a quantitative objective function is required. The computer continuously optimizes during the solution process. Regardless of how the model solves the problem, a set of predicted values is ultimately obtained, namely the predicted value of delay compensation / the predicted delay between the AUTBUS terminal and the TSN switch. These values are compared to the actual values, i.e., the directly measured delay data between the AUTBUS terminal and the TSN switch, the number of data rows, and the number of delay data sets. The loss function is then defined as:
[0024]
[0025] Step 43: Derivative the loss function and solve it using the least squares method; solving is the process of minimizing the loss function, and in statistics, it is called the least squares "parameter estimation" of the linear regression model; Derivative ω and b in L(ω,b) separately:
[0026]
[0027] Step 44: Gradient descent, parameter update;
[0028]
[0029] The parameters are updated until convergence, and the parameters ω and b are obtained.
[0030] Step 44: Gradient descent, parameter update. Update the learning rate α:
[0031]
[0032] The parameters are updated until convergence, and the parameters ω and b are obtained.
[0033] Furthermore, the linear regression prediction algorithm uses the following formula for prediction:
[0034]
[0035] ω and b are the parameters when the loss function is solved to the minimum. is the predicted value.
[0036] Furthermore, the linear regression prediction algorithm uses the following formula to calculate the parameters ω and b:
[0037]
[0038] Let the left side of the above two equations be 0, and the closed-form solution of the optimal solution for the parameters ω and b is expressed as:
[0039]
[0040]
[0041] The beneficial effects of the present invention are:
[0042] (1) Perform time synchronization within the TSN network, time synchronization within the gateway, and time synchronization within the AUTBUS network respectively, and finally perform time compensation at the AUTBUS terminal to ensure time consistency across the entire heterogeneous network.
[0043] (2) Through two-way message synchronization, the link delay between the TSN switch and the gateway TSN module, the gateway TSN module and the AUTBUS module, and the AUTBUS management node and the terminal node is accurately measured to provide a data basis for time compensation.
[0044] (3) A linear regression prediction algorithm is built into the AUTBUS terminal to collect link delay information and make predictions, thereby compensating the local clock in advance, effectively reducing the impact of link delay changes on time synchronization accuracy and improving synchronization accuracy and efficiency.
[0045] Other advantages, objects, and features of the present invention will be described in part in the following description and, in part, will be apparent to those skilled in the art upon examination of the following description or may be learned from practice of the present invention. The objects and other advantages of the present invention may be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below with reference to the accompanying drawings, in which:
[0047] Figure 1 It is a heterogeneous network structure that integrates AUTBUS and TSN;
[0048] Figure 2 For TSN time synchronization;
[0049] Figure 3 It is a method for exchanging time synchronization information between TSN nodes;
[0050] Figure 4 Time synchronization within the gateway
[0051] Figure 5 It is the time synchronization information interaction mode between modules in the gateway
[0052] Figure 6 For AUTBUS time synchronization;
[0053] Figure 7 It is the time synchronization information exchange method between AUTBUS nodes. DETAILED DESCRIPTION
[0054] The following describes the embodiments of the present invention by means of specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0055] Among them, the accompanying drawings are only for illustrative purposes and represent only schematic diagrams rather than actual pictures, and should not be understood as limiting the present invention. In order to better illustrate the embodiments of the present invention, some parts of the accompanying drawings may be omitted, enlarged or reduced, and do not represent the dimensions of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the accompanying drawings.
[0056] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if there are terms such as "upper", "lower", "left", "right", "front", "back", etc. indicating directions or positional relationships, they are based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operate in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0057] 1. Network Architecture
[0058] First, we need to build a heterogeneous network that integrates AUTBUS and TSN, such as Figure 1 shown.
[0059] The architecture is divided into three parts, from left to right, namely AUTBUS, gateway and TSN. The gateway exchanges information with AUTBUS and TSN through wired connections. In TSN, it includes TSN terminals, TSN switches and TSN modules in border gateways. The communication between each part follows the IEEE 1588 protocol to maintain time synchronization between devices; in the gateway, it is divided into AUTBUS modules, TSN modules and protocol conversion modules. In the figure, the protocol conversion module and the TSN module are integrated together, and the communication between the TSN module and the AUTBUS module uses the SLIP serial line Internet protocol for communication; AUTBUS includes AUTBUS terminals and AUTBUS modules in the gateway. The AUTBUS bus can connect to up to 254 nodes, but there can only be one management node. Figure 1 The AUTBUS module in the border gateway is set as the AUTBUS management node. The communication between the AUTBUS nodes complies with the national standard specification (GB / T42019-2022, Broadband Industrial Bus AUTBUS System Architecture and Communication Specifications Based on Time-Sensitive Technology [S]) written by Chongqing University of Posts and Telecommunications, Dongtu Technology and other units.
[0060] TSN is the core of the entire heterogeneous network. The master clock of the entire heterogeneous network is located in the TSN switch. The clocks of all terminal nodes must be aligned with the master clock to ensure the normal operation of devices and applications running in this heterogeneous network. TSN terminals can control any node in the heterogeneous network or view the working status of any node.
[0061] The gateway is responsible for converting the communication protocols between AUTBUS and TSN, ensuring smooth communication between TSN and AUTBUS, and providing a foundation for the normal operation of applications running on the heterogeneous network where AUTBUS and TSN are integrated. At the same time, the AUTBUS module also serves as the AUTBUS management node.
[0062] On the AUTBUS side, the AUTBUS terminal receives information from the TSN terminal, performs tasks based on the information received, and reports various information about itself to the TSN terminal. Simultaneously, the local clock of the AUTBUS terminal is aligned with the master clock of the entire heterogeneous network (the local clock of the TSN switch). Subsequently, all devices or applications running on this heterogeneous network must be synchronized end-to-end across the entire heterogeneous network.
[0063] 2. Cross-network time synchronization method for AUTBUS and TSN integration
[0064] 2.1 Overview of the Solution
[0065] In order to achieve time synchronization of the AUTBUS and TSN fusion network, the present invention provides the following technical solutions:
[0066] First, the symbols and definitions used in this invention are placed in the symbol definition collection in Table 1.
[0067] Table 1
[0068]
[0069] The cross-network time synchronization method for the integration of AUTBUS and TSN includes the following steps:
[0070] Step 1: The TSN switch issues a command to complete time synchronization within the TSN network and measure inter-link delay using the IEEE 1588 protocol. After the gateway TSN module and the TSN switch are synchronized, the inter-link delay data measured during the time synchronization process is transmitted to the AUTBUS terminal.
[0071] Step 2: After the TSN module in the gateway completes time synchronization with the TSN switch, it sends a command to the gateway's AUTBUS module, completing inter-link delay measurement and gateway time synchronization through bidirectional message synchronization. The measured delay data is also transmitted to the AUTBUS terminal.
[0072] Step 3: After completing time synchronization within the gateway, the gateway AUTBUS module begins time synchronization within the AUTBUS network. Due to the characteristics of the AUTBUS bus standard, a management node is required to serve as the master clock for the entire AUTBUS network. All other nodes must synchronize their local clocks to the management node's clock. The AUTBUS management node and AUTBUS terminals communicate via bidirectional messaging to measure inter-link delay and synchronize time. After time synchronization between the AUTBUS management node and the AUTBUS terminal is complete, inter-link delay data is transmitted to the AUTBUS terminal.
[0073] Step 4: After completing steps 1 to 3, the delay data between the three links and the start time of the delay measurement period are stored in the AUTBUS terminal. This data is input into a prediction algorithm. The output value of the algorithm is compensated to the local clock of the AUTBUS terminal, so that the time of the local clock of the AUTBUS terminal is synchronized with the master clock of the entire heterogeneous network, and finally the end-to-end time synchronization of the heterogeneous network that integrates AUTBUS and TSN is completed.
[0074] 2.2 Scheme Design
[0075] 2.2.1 TSN Time Synchronization Solution Design
[0076] TSN includes TSN terminals, TSN switches (master clocks) and TSN modules in border gateways. Time synchronization is required between TSN switches and gateway TSN modules, such as Figure 2 shown.
[0077] The TSN switch sends instructions to the TSN module in the gateway, and completes the measurement of link delay and time synchronization within the TSN network through the IEEE 1588 protocol.
[0078] Modeling the TSN switch clock (master clock):
[0079] T MC (t) = t MC (1)
[0080] Modeling the Gateway TSN Module Clock:
[0081] T GW_TSN (t) = t GW_TSN (2)
[0082] where t GW_TSN is the current clock time of the gateway TSN module, T GW_TSN (t) is the timestamp generated by the TSN module.
[0083] The time synchronization information interaction between the TSN switch and the gateway TSN module described in step 1 of section 2.1 is as follows Figure 3 shown.
[0084] The calculation process for the time delay and frequency offset between the TSN switch and the gateway TSN module described in step 1 of section 2.1 is as follows:
[0085] First, the TSN switch sends a time synchronization message to the gateway TSN module, including the time synchronization message sending timestamp T MC (t1), the timestamp of the gateway TSN module receiving the time synchronization message is T GW_TSN (t2), TSN sends a reply message to the TSN switch. The timestamp of the reply message is T GW_TSN (t3), the timestamp of the TSN switch receiving the reply message is T MC (t4), the final switch will contain T MC The Follow_up message at (t4) is then sent to the gateway TSN module. The gateway TSN module calculates the link delay and clock frequency offset between the TSN switch and the gateway TSN module based on the four timestamps:
[0086]
[0087] After completing the above operations in the gateway TSN module, the gateway TSN module completes time synchronization with the TSN switch. At the same time, the gateway TSN module packages the information containing the link delay and frequency deviation between the TSN switch and the gateway TSN module and sends it to the AUTBUS terminal node.
[0088] 2.2.2 Design of time synchronization scheme within the gateway
[0089] The gateway includes an AUTBUS module and a TSN module. The two modules communicate via the SLIP serial line Internet protocol, and time synchronization is required between the AUTBUS module and the TSN module. Figure 4 shown.
[0090] The information interaction between the AUTBUS module and the TSN module in the gateway is as follows Figure 5 shown.
[0091] In step 2 of section 2.1, the time synchronization process between the TSN module and the AUTBUS module in the gateway is described. Since the TSN module and the AUTBUS module are wired, the link delay should be considered:
[0092] The local clock of the AUTBUS module is modeled as:
[0093] GW AUTBUS (t) = t GW_AUTBUS (5)
[0094] where t GW_AUTBUS The current time of the local clock of the AUTBUS module, GW AUTBUS (t) is the local clock time used for time synchronization.
[0095] The local clock of the TSN module is modeled as:
[0096] GW TSN (t) = t GW_TSN (6)
[0097] where t GW_TSN The current time of the local clock of the TSN module, GW TSN (t) is the local clock time used for time synchronization.
[0098] The AUTBUS module initiates a time synchronization request, and the TSN module sends a GW with a timestamp after receiving the request. TSN (t1) reply message, the time when AUTBUS receives the reply message is GW AUTBUS (t2), so the inter-module delay is:
[0099]
[0100] Where S is the length of the serial message, R is the serial baud rate, and t is the time interval between sending each byte. The local clock of the AUTBUS module after correction should be:
[0101]
[0102] After completing the adjustment of the local clock time, the AUTBUS module in the gateway packages the time delay information between modules in the gateway and sends it to the AUTBUS terminal.
[0103] 2.2.3 AUTBUS time synchronization solution design
[0104] According to the characteristics of the AUTBUS fieldbus, a management node is required in the AUTBUS network. There is only one management node. According to the AUTBUS cross-TSN network architecture diagram, the AUTBUS module in the gateway is set as the AUTBUS management node. The clocks of all other terminals in the network are synchronized with the clock of the management node. Figure 6 shown.
[0105] The time synchronization information interaction between the AUTBUS management node and the terminal node is as follows: Figure 7 shown.
[0106] First, model the clock of the management node:
[0107] AUTBUS Management (t) = t AUTBUS_Management (9)
[0108] where t AUTBUS_Management The current time of the local clock of the management node in the AUTBUS network. Management (t) is the timestamp generated by the management node.
[0109] Model the local clock of an end node:
[0110] AUTBUS Terminal (t) = t AUTBUS_Terminal (10)
[0111] where t AUTBUS_Terminal The local clock current node of the terminal node in the AUTBUS network, AUTBUS Terminal (t) is the timestamp generated by the terminal node.
[0112] The management node first sends a delay measurement request to the terminal node, and the terminal node sends a reply message to complete the measurement of the inter-link delay. The terminal node then initiates a time synchronization request. The management node sends a message containing the current time and the inter-link delay to the terminal node, and the terminal node completes the adjustment of the local clock based on this message.
[0113] The specific time synchronization process is as follows:
[0114] Delay measurement
[0115] Management node in AUTBUS Management (t1) sends a delay measurement request, and the terminal node sends a delay measurement request at AUTBUS Terminal (t2) The request is received and the Terminal (t3) Send reply information to the management node, and the management node sends a reply message to the management node on AUTBUS ManagementAt time (t4), the reply message is received and the inter-link delay is calculated as:
[0116]
[0117] Time synchronization
[0118] After the delay measurement process, the management node stores the delay data between the management node and each terminal. The management node sends a message containing the departure time of the time synchronization service, the signal frame time length, and the delay between the management node and the corresponding terminal node to the corresponding terminal node. The terminal node adjusts the local clock based on this message. The value of the local clock of the terminal node is:
[0119] AUTBUS Terminal (t Real )=Delay AUTBUS +T Frame +AUTBUS Management (t Trigger ) 12)
[0120] Among them, AUTBUS Terminal (t Real ) is the local clock value of the terminal node after compensation, T Frame The time length of a signal frame, AUTBUS Management (t Trigger ) is the triggering moment of the management node time synchronization service. It completes the time synchronization between nodes in the AUTBUS network.
[0121] 2.2. 4AUTBUS Terminal Time Compensation Scheme Design
[0122] After the work of the above three parts, the delay information between the three links will eventually be sent to the AUTBUS terminal node. Since the AUTBUS terminal node has maintained time synchronization with the clock of the AUTBUS management node in the previous part, it is also necessary to compensate for the delay between modules in the gateway and the delay between the TSN switch and the gateway TSN module.
[0123] After completing steps 1-3, you need to perform direct delay measurement between the TSN switch and the AUTBUS terminal to obtain the delay data between the TSN switch and the AUTBUS terminal:
[0124] D_total i (t),i=1,2,…,200(12)
[0125] Here, i represents the delay data between the i-th group of TSN switches and the AUTBUS terminal.
[0126] Ultimately, the local clock of the AUTBUS terminal must compensate for all delays in the three links to ensure time synchronization with the TSN master clock. At the same time, a linear regression prediction algorithm is built into the AUTBUS terminal. After collecting a certain amount of link delay information, it predicts the value that needs to be compensated, compensates the local clock in advance, and improves synchronization accuracy. Linear regression analysis is selected for the following two reasons:
[0127] (1) Linear regression models typically use the least squares method for parameter estimation. This method is computationally efficient and can quickly obtain estimated values for model parameters. This high computational efficiency can reduce the time the algorithm spends on calculating predicted values and improve the efficiency of time synchronization.
[0128] (2) Linear regression analysis has strong predictive power, especially when there is a linear relationship between the independent and dependent variables. In the present invention, the output of the linear regression prediction algorithm is a clock compensation value, which has a strong linear correlation with the algorithm input (the sum of the inter-link delays).
[0129] A linear regression analysis algorithm is used to compensate for the values that need to be compensated. When the heterogeneous network begins operation, the TSN master clock sends a timestamp message to the AUTBUS terminal indicating the start of the delay measurement period, starting time synchronization between the links and storing the delay data. After the time synchronization process between the nodes is completed, the delay data is sent to the terminal node for storage. After completion, the TSN switch sends a timestamp message to the AUTBUS terminal indicating the master clock time under the current delay data conditions. This timestamp message is also sent to the AUTBUS terminal. After completion, the next delay measurement is performed.
[0130] A set of data includes: the start time of the current cycle, the end time of the delay measurement cycle under the current delay data conditions, the link delay data, and the AUTBUS terminal reception completion time. These data can be used to obtain the link delay data and the actual delay. These are the key data required for the linear regression algorithm.
[0131] After the stored data reaches 200 sets, the prediction algorithm is run to compensate the local clock time. The method used to predict the compensation value of time synchronization is the linear regression prediction algorithm.
[0132] The stored link delay dataset is expressed as:
[0133] D i (t),i=1,2,…,200(13)
[0134] Linear regression analysis is a predictive modeling technique that typically uses a curve or line to fit data points. The goal is to minimize the distance between the curve and the data points (target delay value 30µs). Linear regression assumes a linear relationship between the target value and the features, that is, a linear equation that satisfies a multivariate linear equation. This is done by constructing a loss function and solving for the parameters ω and b that minimize the function. The following expression is typically satisfied:
[0135]
[0136] in is the predicted value, which corresponds to the time compensation value output by the algorithm. The independent variable x represents the link delay data input when the algorithm is running; the dependent variable y represents the actual delay value, which represents the direct measurement delay data between the AUTBUS terminal and the TSN switch and is known. What we want to achieve is to predict a new x, which corresponds to Therefore, in order to construct this functional relationship, the goal is to solve the parameters ω and b in the linear model through known data.
[0137] Algorithm steps:
[0138] Step 1: Given a data set D_total i (t) (corresponding to the delay data between each link input to the algorithm in the present invention, the delay data directly measured between the AUTBUS terminal and the TSN switch) is used as the initial input.
[0139] Step 2: Obtain the objective function and loss function. To solve the optimal parameters, a standard (delay range requirement) is required for measurement. For this purpose, an objective function formula needs to be quantified so that the computer can continuously optimize during the solution process. Regardless of how the model solves the problem, a set of predicted values is ultimately obtained. (Predicted value of delay compensation / predicted delay between the AUTBUS terminal and the TSN switch), compared with the existing true value y (directly measured delay data between the AUTBUS terminal and the TSN switch), the number of data rows n (number of delay data groups), and the loss function is defined as:
[0140]
[0141] in is the delay prediction value of group i, y i is the true experimental value of the i-th group, and Equation (15) is the average square distance between the predicted value and the true value, also known as MAE (mean square error). Substituting the previous function (1) into the loss function, and considering the parameters ω and b to be solved as the dependent variables of the function L, we can obtain the following formula:
[0142]
[0143] Further optimized to:
[0144]
[0145] where ω * is the value of ω when L is optimized, b * is the value of b when L is optimized, that is, formula (17) is the core objective optimization formula for parameters ω and b.
[0146] Step 3: Derivative the loss function and solve it using the least squares method. Solving for ω and b is the process of minimizing the loss function. In statistics, this is called the least squares "parameter estimation" of the linear regression model. Derivative the ω and b in L(ω,b):
[0147]
[0148] By setting the left side of equations (18) and (19) to 0, we can obtain the closed-form solution of the optimal solution for parameters ω and b, which is expressed as:
[0149]
[0150] Step 4: Gradient descent, parameter update. Parameter update is performed according to equations (1) and (3) and another parameter α (gradient descent learning rate):
[0151]
[0152] Where ← represents the derivation of update parameters.
[0153] The parameters are updated until convergence, and the parameters ω and b are obtained.
[0154] Finally, according to the calculated parameters ω and b, the parameters are further calculated. When the AUTBUS terminal receives the new link delay and D i (t), calculate Compensate the terminal clock and complete end-to-end time synchronization of heterogeneous networks integrating AUTBUS and TSN.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions, which should all be included in the scope of the claims of the present invention.
Claims
1. A cross-network time synchronization method for the integration of AUTBUS and TSN, characterized by: The following steps are involved: Step 1: The TSN switch issues a command to complete the time synchronization within the TSN network through the IEEE 1588 protocol, completes the inter-link delay measurement, and transmits the inter-link delay data measured during the time synchronization process to the AUTBUS terminal; Step 2: After the TSN module in the gateway completes time synchronization with the TSN switch, the TSN module in the gateway sends a command to the gateway AUTBUS module to complete the measurement of inter-link delay and time synchronization in the gateway through two-way message synchronization, and transmits the measured delay data to the AUTBUS terminal; Step 3: After completing the time synchronization within the gateway, the gateway AUTBUS module starts to synchronize the time within the AUTBUS network. The AUTBUS management node and the AUTBUS terminal complete the inter-link delay measurement and time synchronization through two-way messaging, and transmit the inter-link delay data to the AUTBUS terminal. Step 4: After completing steps 1 to 3, the delay data between the three links and the start time of the delay measurement period are stored in the AUTBUS terminal and input into the prediction algorithm. The output value of the prediction algorithm will be compensated to the local clock of the AUTBUS terminal, so that the time of the local clock of the AUTBUS terminal is synchronized with the master clock of the entire heterogeneous network, and finally the end-to-end time synchronization of the heterogeneous network integrating AUTBUS and TSN is completed.
2. A cross-network time synchronization method for AUTBUS and TSN integration according to claim 1, characterized in that: The prediction algorithm is a linear regression prediction algorithm.
3. The cross-network time synchronization method for AUTBUS and TSN integration according to claim 2 is characterized by: The linear regression prediction algorithm includes the following steps: Step 41: Given a data set, the delay data between each link and the directly measured delay data between the AUTBUS terminal and the TSN switch are input to the algorithm as initial input; Step 42: Obtain the objective function and loss function; define the loss function as: Step 43: Derivative the loss function and solve it using the least squares method; solving ω and ω is the process of minimizing the loss function. In statistics, this is called the least squares "parameter estimation" of the linear regression model; derive ω and b in L(ω,b) separately: Step 44: Gradient descent, parameter update; The parameters are updated until convergence, and the parameters ω and b are obtained.
4. The cross-network time synchronization method for AUTBUS and TSN integration according to claim 3 is characterized by: The linear regression prediction algorithm uses the following formula to make predictions: ω and b are the parameters when the loss function is solved to the minimum. is the predicted value.
5. The cross-network time synchronization method for AUTBUS and TSN integration according to claim 4 is characterized in that: The linear regression prediction algorithm uses the following formula to calculate the parameters ω and b: Let the left side of the above two equations be 0, and the closed-form solution of the optimal solution for parameters ω and b is expressed as:
Citation Information
Patent Citations
Industrial wireless and TSN fusion-oriented cross-network time synchronization method
CN114050884A
AUTBUS and TSN fusion network deterministic time delay scheduling method based on cross-domain weighting
CN118075816A