Time synchronization method, communication device, time synchronization system and storage medium
By applying Passive Optical Network (PON) for hard synchronization in the vehicle network, the problem of poor time synchronization accuracy in the vehicle network is solved, and high-precision time synchronization and network performance improvement are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BYD CO LTD
- Filing Date
- 2024-10-31
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, the poor time synchronization accuracy between different devices in vehicle networks leads to stagnant network performance and increased costs.
Passive optical network (PON) is used to achieve hard synchronization in the vehicle-mounted homogeneous network. The master node sends reference frames to the slave node to determine the transmission delay, and performs time synchronization based on the stable transmission time, thereby improving the synchronization accuracy.
Without increasing costs, high-precision time synchronization of various devices in the vehicle network was achieved, ensuring consistency of time synchronization and improving network performance.
Smart Images

Figure CN121966773A_ABST
Abstract
Description
Time synchronization method, communication device, time synchronization system and storage medium Technical Field
[0001] This application relates to the field of communication technology, and in particular to a time synchronization method, communication device, time synchronization system and storage medium. Background Technology
[0002] To ensure time synchronization among devices in a network, a soft synchronization scheme has been proposed in related technologies. Soft synchronization achieves time synchronization between different devices or systems through software means, such as using middleware or software frameworks on the application processing end to coordinate data between devices in the network. However, software processing speed may fluctuate due to factors such as system load, resources, and device differences, thus affecting the accuracy of time synchronization between different devices. Summary of the Invention
[0003] The purpose of this application is to provide a time synchronization method, communication device, time synchronization system and storage medium, which aims to solve the problem of poor synchronization accuracy between different devices in a network.
[0004] To achieve the above objectives, this application adopts the following technical solution:
[0005] This application provides a time synchronization method, which includes: a slave node receiving a first frame sent by a master node to determine a first delay, the first delay being the transmission delay from the master node to the slave node; the slave node receiving a second frame sent by the master node, the first delay being used for time synchronization each time the slave node receives the second frame.
[0006] The first frame is the reference frame.
[0007] The time synchronization method provided in this application addresses the issue of unavoidable transmission delays between different nodes in a network, leading to time discrepancies between the master and slave nodes. Therefore, the slave node in this application determines the transmission time used to transmit data from the master node to the slave node by receiving a reference frame sent by the master node. Furthermore, since the transmission time from the master node to the slave node is typically stable, after determining this transmission time, the slave node can directly use it to determine the master node's time for each received second frame. This allows for continuous synchronization of the slave node's local time based on the master node's time, improving the synchronization accuracy.
[0008] In some embodiments, the time synchronization method provided in this application may further include: the slave node performing time synchronization according to time synchronization parameters, the time synchronization parameters including a first delay and a reference time for the transmission of the first frame.
[0009] The reference time for sending the first frame refers to the time when the master node sends the first frame.
[0010] Based on this, after determining the transmission time used for data transmission from the master node to the slave node, the slave node in this application can synchronize the master and slave node times according to the time point when the master node sends the reference frame and the transmission time used for data transmission from the master node to the slave node, thereby improving the synchronization accuracy of time synchronization.
[0011] In some embodiments, the slave node performs time synchronization according to the time synchronization parameters, including: the slave node determines the reception reference time of the second frame according to the time synchronization parameters; and the slave node performs time synchronization according to the reception reference time of the second frame.
[0012] The receiving reference time of the second frame refers to the time of the master node when the slave node receives the second frame. In other words, the receiving time of the second frame refers to the time when the slave node receives the second frame under the master node's master reference clock.
[0013] In some embodiments, the slave node performs time synchronization based on the reception reference time of the second frame, including: the slave node synchronizes the local time of the slave node to the reception reference time of the second frame.
[0014] In some embodiments, the reception reference time of the second frame is obtained based on the first delay, the transmission reference time of the first frame, and the transmission time interval, wherein the transmission time interval is the time interval between the second frame and the first frame.
[0015] In some embodiments, the transmission time interval is determined based on the number of frames between the first and second frames and the frame transmission period.
[0016] In some embodiments, the transmission reference time of the first frame is carried in the first frame or in any frame transmitted by the master node after the first frame and before the second frame.
[0017] In some embodiments, the first delay is determined based on the second delay, the third delay, and the fourth delay; wherein the second delay is used to characterize the theoretical time from when the master node sends the first frame to the farthest slave node to when it receives the third frame sent by the farthest slave node in response to the first frame; the fourth delay is the processing delay of the slave node on the data frame; the third delay is used to ensure that the time when the third frame sent by the slave node reaches the master node is the same as the time when the third frame sent by the farthest slave node reaches the master node, and the third frame is used to respond to the first frame.
[0018] In some embodiments, after the slave node receives the first frame sent by the master node, the time synchronization method provided in this application further includes: the slave node sending a third frame to the master node; the slave node receiving a fourth frame sent by the master node; wherein the fourth frame includes any one of the following: a first delay, a third delay, and correction information for the third delay.
[0019] In some embodiments, the first frame includes a start delay corresponding to the slave node; the third frame is sent from the slave node to the master node after the start delay has elapsed since the first frame was received.
[0020] In some embodiments, the first frame may also include the start delay corresponding to other slave nodes in the network.
[0021] In some embodiments, the second delay and the fourth delay are pre-configured.
[0022] In some embodiments, the time synchronization method provided in this application further includes: a slave node receiving a fifth frame sent by a master node, the fifth frame being used to request the slave node to start the registration process; and the slave node sending a sixth frame to the master node, the sixth frame including registration information.
[0023] In some embodiments, the registration information includes the identity information of the slave node.
[0024] In some embodiments, receiving a fifth frame from a master node by a slave node includes: receiving a fifth frame from a master node when the slave node is in an initialized state.
[0025] In some embodiments, the slave node is in an initialization state when at least one of the following conditions is met: the vehicle to which the slave node is located is powered on for the first time; the vehicle to which the slave node is located has no abnormalities in its self-test after being powered on; or the vehicle to which the slave node is located is waiting to execute the factory configuration process.
[0026] In some embodiments, the time synchronization method provided in this application further includes: a slave node sending a seventh frame to a master node, the seventh frame being used to request the master node to verify the registration information of the slave node, the seventh frame including the registration information of the slave node; the slave node receiving an eighth frame sent by the master node, the eighth frame being used to characterize whether the registration information sent by the slave node this time is consistent with the pre-stored registration information.
[0027] In some embodiments, the seventh frame is sent from the slave node to the master node after the slave node has successfully initialized and the vehicle to which the slave node is located has been powered on again.
[0028] In some embodiments, the time synchronization method provided in this application further includes: the slave node receiving a synchronization code and link parameter information sent by the master node; the slave node calibrating its local clock based on the synchronization code and synchronizing the link frequency based on the link parameter information; and the slave node sending a ninth frame to the master node, the ninth frame being used to instruct the slave node to reconnect to the network.
[0029] In some embodiments, before the slave node receives the synchronization code and link information sent by the master node, the time synchronization method provided in this application further includes: the slave node detecting an abnormality in time synchronization performance; and / or, the slave node switching from a sleep mode or a low-power mode to a normal operation mode.
[0030] In some embodiments, the time synchronization method provided in this application further includes: pausing the execution of time synchronization operations when the slave node is in a sleep mode or a low-power mode.
[0031] In some embodiments, synchronization codes and link parameter information are carried in any data frame sent by the master node.
[0032] In some embodiments, the time synchronization method provided in this application further includes: a slave node receiving a tenth frame sent by a master node, the tenth frame being used to request correction of the master node's local time; the slave node sending an eleventh frame to the master node, the eleventh frame including a time offset, the time offset being the offset of the slave node's local time before and after updating according to satellite information.
[0033] In some embodiments, the slave node and the master node are nodes in a passive optical network.
[0034] In some embodiments, at least one of the first frame and the second frame is a data frame.
[0035] This application provides a time synchronization method, which includes: a master node sending a first frame to a slave node to determine a first delay, the first delay being the transmission delay from the master node to the slave node; the master node sending a second frame to the slave node, the first delay being used for time synchronization each time the slave node receives the second frame.
[0036] The time synchronization method provided in this application addresses the issue of unavoidable transmission delays between different nodes in a network, leading to time discrepancies between the master and slave nodes. Therefore, the master node in this application sends a reference frame, allowing the slave node to determine the transmission time taken for the reference frame to travel from the master to the slave node. Furthermore, since the transmission time from the master to the slave node is typically stable, when time synchronization is required, the slave node can directly determine the master node's time for each received second frame based on the transmission time from the master to the slave node. This allows for continuous synchronization of the slave node's local time based on the master node's time, improving the synchronization accuracy.
[0037] In some embodiments, time synchronization is performed based on time synchronization parameters, which include a first delay and a transmission reference time for the first frame.
[0038] In some embodiments, time synchronization is performed based on the reception reference time of the second frame, which is obtained based on the time synchronization parameters.
[0039] In some embodiments, time synchronization is used to synchronize the local time of the slave node to the reception reference time of the second frame.
[0040] In some embodiments, the reception reference time of the second frame is obtained based on the first delay, the transmission reference time of the first frame, and the transmission time interval, wherein the transmission time interval is the time interval between the second frame and the first frame.
[0041] In some embodiments, the transmission time interval is determined based on the number of frames between the first and second frames and the frame transmission period.
[0042] In some embodiments, the transmission reference time of the first frame is carried in the first frame or in any frame transmitted by the master node after the first frame and before the second frame.
[0043] In some embodiments, the first delay is determined based on the second delay, the third delay, and the fourth delay; wherein the second delay is used to characterize the theoretical time from when the master node sends the first frame to the farthest slave node to when it receives the third frame sent by the farthest slave node in response to the first frame; the fourth delay is the processing delay of the slave node on the data frame; the third delay is used to ensure that the time when the third frame sent by the slave node reaches the master node is the same as the time when the third frame sent by the farthest slave node reaches the master node, and the third frame is used to respond to the first frame.
[0044] In some embodiments, after the master node sends the first frame to the slave node, the time synchronization method provided in this application further includes: the master node sending a third frame to the slave node; the master node receiving a fourth frame sent by the slave node; wherein the fourth frame includes any one of the following: a first delay, a third delay, and correction information for the third delay.
[0045] In some embodiments, the first frame includes a start delay corresponding to the slave node; the third frame is sent from the slave node to the master node after the start delay has elapsed since the first frame was received.
[0046] In some embodiments, the first frame may also include the start delay corresponding to other slave nodes in the network.
[0047] In some embodiments, the second and fourth delays are pre-configured.
[0048] In some embodiments, the time synchronization method provided in this application further includes: the master node sending a fifth frame to the slave node, the fifth frame being used to request the slave node to start the registration process; the master node receiving a sixth frame sent by the slave node, the sixth frame including registration information.
[0049] In some embodiments, the registration information includes the identity information of the slave node.
[0050] In some embodiments, the fifth frame is sent by the master node while the slave node is in the initialization state.
[0051] In some embodiments, the slave node is in an initialization state when at least one of the following conditions is met: the vehicle to which the slave node is located is powered on for the first time; the vehicle to which the slave node is located has no abnormalities in its self-test after being powered on; or the vehicle to which the slave node is located is waiting to execute the factory configuration process.
[0052] In some embodiments, the time synchronization method provided in this application further includes: the master node receiving a seventh frame sent by the slave node, the seventh frame being used to request the master node to verify the registration information of the slave node, the seventh frame including the registration information of the slave node; the master node sending an eighth frame to the slave node, the eighth frame being used to characterize whether the registration information sent by the slave node this time is consistent with the pre-stored registration information.
[0053] In some embodiments, the seventh frame is sent from the slave node to the master node after the slave node has successfully initialized and the vehicle to which the slave node is located has been powered on again.
[0054] In some embodiments, the time synchronization method provided in this application further includes: the master node sending a synchronization code and link parameter information; the master node receiving a ninth frame sent by the slave node, the ninth frame being used to instruct the slave node to reconnect to the network.
[0055] In some embodiments, the ninth frame is sent by the slave node after it detects an anomaly in time synchronization performance and / or switches from sleep mode or low-power mode to normal operation mode.
[0056] In some embodiments, synchronization codes and link parameter information are carried in any data frame sent by the master node.
[0057] In some embodiments, the time synchronization method provided in this application further includes: the master node sending a tenth frame to the slave node, the tenth frame being used to request correction of the master node's local time; the master node receiving an eleventh frame sent by the slave node, the eleventh frame including a time offset, the time offset being the offset of the slave node's local time before and after updating according to satellite information.
[0058] In some embodiments, the tenth frame is sent by the master node in the event of a clock anomaly.
[0059] In some embodiments, the slave node and the master node are nodes in a passive optical network.
[0060] In some embodiments, at least one of the first frame and the second frame is a data frame.
[0061] This application provides a communication device, including: a functional unit for performing the time synchronization method described above; wherein the actions performed by the functional unit are implemented by hardware or by hardware executing corresponding software.
[0062] This application provides a time synchronization system, including a master node, at least one optical splitter, and multiple slave nodes. The master node is connected to the multiple slave nodes through the at least one optical splitter. The slave nodes are used to execute the time synchronization method described in the slave node section above, and the master node is used to execute the time synchronization method described in the master node section above.
[0063] This application provides an electronic and electrical system, including the time synchronization system described above.
[0064] This application provides a vehicle including the electronic and electrical system described above.
[0065] This application provides a computer-readable storage medium storing instructions that, when executed on a terminal, cause the terminal to perform the time synchronization method described above.
[0066] This application provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the time synchronization method described above.
[0067] This application provides a chip including a processor and a communication interface, the communication interface and the processor being coupled together, the processor being used to run computer programs or instructions to implement the time synchronization method described above.
[0068] Specifically, the chip provided in this application embodiment also includes a memory for storing computer programs or instructions. Attached Figure Description
[0069] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 is a schematic diagram of a PON network topology provided in an embodiment of this application;
[0071] Figure 2 is an architecture diagram of a time synchronization system provided in an embodiment of this application;
[0072] Figure 3 is a schematic diagram of the time synchronization logic in a time synchronization system provided in an embodiment of this application;
[0073] Figure 4 is a flowchart illustrating a time synchronization method provided in an embodiment of this application;
[0074] Figure 5 is a flowchart illustrating another time synchronization method provided in an embodiment of this application;
[0075] Figure 6 is a flowchart illustrating another time synchronization method provided in an embodiment of this application;
[0076] Figure 7 is a structural diagram of a communication device provided in an embodiment of this application. Detailed Implementation
[0077] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0078] In the description of this application, it should be understood that the terms "upper," "lower," "left," "right," "front," "rear," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or relative positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and for simplification, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Unless otherwise specified, the above-mentioned orientational descriptions can be flexibly set in practical applications, provided that the relative positional relationships shown in the accompanying drawings are satisfied.
[0079] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0080] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "communication" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection. They can refer to a direct connection or an indirect connection through an intermediate medium, or a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0081] In some embodiments, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, article, or apparatus that includes that element.
[0082] In some embodiments, the words "exemplary" or "for example" are used to indicate that something is an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0083] In the description of this specification, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0084] With the development of vehicle intelligence, technologies such as advanced driver assistance systems (ADAS), autonomous driving assistance, and smart cockpits have become key areas of research for manufacturers. As vehicle functions increase, the complexity of in-vehicle networks also gradually increases, leading to higher requirements for bandwidth and synchronization of in-vehicle networks.
[0085] In related technologies, to improve the synchronization of vehicular networks, existing heterogeneous networks are typically improved to meet the ever-increasing bandwidth and complex control function requirements. However, as more and more devices are integrated into vehicles, this method of improving existing heterogeneous networks may lead to stagnation in the performance and efficiency of vehicular networks, while simultaneously causing a continuous increase in the cost of vehicular networks.
[0086] To address the issue of network complexity and performance bottlenecks resulting from continuous improvements to heterogeneous networks, two time synchronization methods have been proposed in related technologies.
[0087] 1) Applying Ethernet to in-vehicle networks. The time synchronization protocols disclosed under the Ethernet standard are the Precision Time Protocol (PTP) based on the Institute of Electrical and Electronics Engineers (IEEE) 1588v2 and the Generalized Precision Time Protocol (GPTP) based on IEEE 802.1AS, which define time measurement between end-to-end or point-to-point.
[0088] Therefore, synchronization in common master-slave point-to-multipoint connections in vehicle networks can be solved through a combination of multiple pairs and point-to-point methods. For example, using PTP, the master node manages the time synchronization process to each slave node individually in an end-to-end manner; or using GPTP, the synchronization is achieved through multi-hop indirect synchronization with child nodes, where the number of hops for each synchronization pair may be variable.
[0089] However, this multi-pair, point-to-point combination mode causes discrepancies in the synchronization accuracy between each slave node and increases the cost required for time synchronization.
[0090] 2) Time synchronization can be achieved between different devices or systems through soft synchronization. For example, middleware or software frameworks on the application processing side can be used to coordinate data between various devices in the network. Because soft synchronization relies more on software algorithms and protocols to achieve time synchronization, it is easily affected by factors such as network load and system load, resulting in lower time synchronization accuracy.
[0091] Against this backdrop, in order to address the problem of poor synchronization accuracy between different devices in a network in related technologies, this application provides a time synchronization method, a communication device, a time synchronization system, and a storage medium. The implementation methods of this application will be described in detail below with reference to the accompanying drawings.
[0092] This application applies a passive optical network (PON) to a vehicular homogeneous network, achieving logical hard synchronization of all slave nodes according to the same absolute time, and optimizing for the vehicular scenario to ensure consistent synchronization accuracy across all nodes. The PON network uses downlink broadcasting and uplink time-division multiplexing as its basic operating mechanism, providing high-speed and low-cost multi-device homogeneous network access for vehicular scenarios.
[0093] Figure 1 is a schematic diagram of a PON network topology provided in an embodiment of this application. The PON network topology 100 may include a master node 110, a splitter 120, and multiple slave nodes (such as slave node 121, slave node 122, ..., slave node 129). The multiple slave nodes are connected to the master node 110 through the splitter 120.
[0094] The master node 110 may include one or more ports, and multiple slave nodes under each port form a network group. The optical splitter 120 is a passive device, and communication between slave nodes can only be accomplished through the master node 110, and cannot be accomplished through the optical splitter 120.
[0095] In some embodiments, the PON network uses wavelength division multiplexing to make uplink and downlink independent links. The uplink uses time division multiplexing and the downlink uses broadcasting. Each uplink or downlink message carries a synchronization code, which allows each node to calibrate or restore its clock when it receives a message.
[0096] The following description uses the above-mentioned PON network as an example of a vehicle-mounted PON network to illustrate the functions of each node in the PON network.
[0097] The master node 110 is used to perform vehicle network management and scheduling, and provides the vehicle reference master clock, that is, each port of the master node 110 can access the master reference clock of the master node.
[0098] Optical splitter 120 is used to split or aggregate optical power within the link. That is, the downlink optical signal transmitted by the master node 110 will be replicated to the links connecting the optical splitter 120 and slave nodes 121, 122, and 129 at the cost of signal intensity reduction after passing through the optical splitter 120. Similarly, the uplink optical signals transmitted by slave nodes 121, 122, and 129 will be aggregated to the link connecting the optical splitter 120 and the master node 110 at the cost of signal intensity reduction after passing through the optical splitter 120.
[0099] Slave nodes 121, 122, and 129 are used to connect their respective terminal device data to the vehicle-mounted PON network 100. Slave nodes 121, 122, and 129 are also used to synchronize their local time with their respective terminal devices.
[0100] In some embodiments, the master node can be an optical line terminal (OLT), the slave node can be an optical network unit (ONU), and the PON can include a gigabit-capable passive optical network (GPON) and an Ethernet passive optical network (EPON).
[0101] Thus, time synchronization based on this topology is easy to manage, can make full use of existing resources, and achieves high-precision time synchronization without increasing costs, ensuring consistency of time synchronization between different nodes.
[0102] Figure 2 is an architecture diagram of a time synchronization system provided in an embodiment of this application. The time synchronization system 200 may include a master node 210, at least one beam splitter (such as beam splitter 220, beam splitter 230), and at least one slave node (such as instrument display 221, camera 222, camera 223, vehicle tablet 224, controller area network (CAN) controller 225, smart antenna 231, camera 232, camera 233, lidar 234, CAN controller 235).
[0103] The master node 210 may include a cockpit control system-on-chip (SOC) 211, a vehicle control SOC 212, an intelligent driving SOC 213, and a network control SOC 214. The cockpit control 211 is connected to both the vehicle control SOC 212 and the intelligent driving SOC 213, and the network control SOC 214 is connected to both the vehicle control SOC 212 and the intelligent driving SOC 213.
[0104] In some embodiments, the cockpit control SOC211, vehicle control SOC212, intelligent driving SOC213, and network control SOC214 can communicate (clock synchronization) via on-board Ethernet.
[0105] For example, clock synchronization can be performed over an internal network using IEEE 802.1AS or other time synchronization standard protocols.
[0106] In some embodiments, the clock source with the highest precision among the cockpit control SOC 211, vehicle control SOC 212, intelligent driving SOC 213, and network control SOC 214 can be used as the main reference clock for the entire vehicle. The clocks of other SOCs can be used as backup reference clocks, which can be switched in time when the main reference clock fails, providing redundancy for each other.
[0107] In some embodiments, the network control SOC214 can also obtain reference time from an external clock source via 1pps+ToD, achieving low-cost and low-complexity clock reference source acquisition.
[0108] The network control SOC 214 is connected to multiple ports (port a, port b, ..., port n). The beam splitter 220 is connected to the network control SOC 214 through port n. The beam splitter 220 is connected to the instrument display 221, camera 222, camera 223, vehicle tablet 224, and CAN controller 225 respectively. The beam splitter 230 is connected to the network control SOC 214 through port a. The beam splitter 230 is connected to the smart antenna 231, camera 232, camera 233, lidar 234, and CAN controller 235 respectively.
[0109] In some embodiments, the network control SOC214 can send the local clock to the vehicle network via ports a to n, so that the clocks of all slave nodes are synchronized with the master reference clock of the master node.
[0110] In some embodiments, the slave node can synchronize its local time with the corresponding terminal device. Taking the LiDAR 216 as an example, the network control chip of the slave node can transmit time information to the control chip of the LiDAR 216 based on the synchronized clock, and control the LiDAR 216 to perform data acquisition at a specific time according to the command of the intelligent driving domain controller.
[0111] Optionally, the slave and master nodes in the time synchronization system provided in this application embodiment are nodes in PON.
[0112] In this way, by controlling the corresponding terminal devices to perform precise data processing or precise data synchronization based on the clock that has been synchronized by the slave node, the control accuracy of multiple devices is improved.
[0113] Figure 3 is a schematic diagram of the time synchronization logic in a time synchronization system provided in an embodiment of this application.
[0114] In some embodiments, the time synchronization logic described above may include the following steps S301 to S315:
[0115] S301, in response to the vehicle power-on command, enters the first state and performs a self-test operation.
[0116] The first state corresponds to the self-test operation. In the first state, the hardware and software status of the device can be detected to determine whether it is normal.
[0117] S302. Determine if the self-test result is normal. If yes, proceed to S303; otherwise, proceed to S317.
[0118] The normal operation of the time synchronization system means that both the hardware and software components of the system are functioning correctly.
[0119] S303. Determine whether the vehicle requires factory configuration. If not, proceed to S304; if yes, proceed to S306.
[0120] The factory-configured scenarios include scenarios after vehicle repair or after vehicle system upgrades.
[0121] S304. Switch from the first state to the second state, and perform delay correction and registration verification operations.
[0122] The second state corresponds to the delay correction operation and the registration verification operation.
[0123] S305. Determine whether the delay correction operation and registration verification operation were successful. If yes, proceed to S310; otherwise, proceed to S317.
[0124] S306. Switch from the first state to the fourth state and perform time synchronization initialization operation.
[0125] The fourth state corresponds to the time synchronization initialization operation, which includes the registration operation and the delay measurement operation.
[0126] S307. Determine whether the time synchronization initialization operation was successful. If yes, proceed to S308; otherwise, proceed to S317.
[0127] S308, Switch from the fourth state to the second state, perform parallel delay correction operation and registration verification operation.
[0128] S309. Determine whether the delay correction operation and registration verification operation were successful. If yes, proceed to S310; otherwise, proceed to S317.
[0129] S310, Switch from the second state to the third state, and the master node and slave node synchronize their time.
[0130] The third state corresponds to time synchronization.
[0131] In some embodiments, slave nodes can perform periodic time synchronization with master nodes. Periodic time synchronization refers to the time synchronization system synchronizing the time of each node in the system at preset time intervals.
[0132] S311. In the third state, check if the time synchronization performance is abnormal. If yes, execute S312; otherwise, execute S310.
[0133] S312. Check if the abnormal level of the time synchronization performance exceeds the preset level. If yes, proceed to S317; otherwise, proceed to S313.
[0134] The preset level can be determined based on the number of synchronization failures of slave nodes.
[0135] For example, taking a preset level corresponding to a number of slave node synchronization anomalies of 5 as an example. If the number of slave node synchronization anomalies detected is 8, then S317 is executed; if the number of slave node synchronization anomalies detected is 3, then S313 is executed.
[0136] S313. Switch from the third state to the fifth state and perform time synchronization recovery operation.
[0137] The fifth state corresponds to the time synchronization recovery operation.
[0138] In some embodiments, the slave node may send a re-entry notification message to the master node, so that the master node knows that the slave node will perform time synchronization after receiving the re-entry notification message sent by the slave node.
[0139] S314. Determine whether the time synchronization recovery operation was successful. If yes, proceed to S310; otherwise, proceed to S315.
[0140] S315. Determine whether the recovery time exceeds the preset time. If yes, execute S317; otherwise, execute S313.
[0141] The preset duration can be a manually set value that can be flexibly adjusted according to the actual scenario. For example, the preset duration can be 1 millisecond.
[0142] S316. After updating the master reference time of the master node or updating the smart antenna reference clock of the slave node, execute S310.
[0143] In some embodiments, the local time of a slave node can be updated using satellite information based on the slave node's smart antenna.
[0144] S317, End time synchronization.
[0145] S318: Receives a vehicle power-off command and controls the vehicle to power off.
[0146] In this way, by applying the PON network to the vehicle network, the time of each device in the vehicle time synchronization system can be synchronized according to the main reference time of the network control SOC in the vehicle synchronization system, so as to ensure that each device can be accurately controlled and improve the control stability of the vehicle system.
[0147] The time synchronization method provided by the embodiments of this application will be described below with reference to Figures 1 to 3, and Figures 4 and 5 below.
[0148] It is understood that in the embodiments of this application, each node in the time synchronization system can execute some or all of the steps in the embodiments of this application. These steps or operations are merely examples, and the embodiments of this application can also execute other operations or variations of various operations. Furthermore, the steps can be executed in different orders as presented in the embodiments of this application, and it is not necessary to execute all the operations in the embodiments of this application.
[0149] Figure 4 is a flowchart illustrating the time synchronization method provided in this application embodiment, which is described using the interaction between a master node and a slave node as an example. Of course, the entity executing the master node action in this method can also be a device / module in the master node, such as an integrated circuit or a chip; similarly, the entity executing the slave node action in this method can also be a device / module in the slave node, such as an integrated circuit or a chip. This application embodiment does not specifically limit this.
[0150] The above S308 is described below with reference to Figure 4.
[0151] For example, as shown in FIG4, the communication method provided in the embodiments of this application may include:
[0152] S401, The master node sends the first frame to the slave node. Correspondingly, the slave node receives the first frame sent by the master node.
[0153] In some embodiments, the first frame can be any frame sent by the master node to the slave node.
[0154] The first frame can also be called the reference frame. The first frame can be a management message embedded in the header of the selected data frame by the master node, serving as a reference frame.
[0155] In some embodiments, the first frame is used to determine a first delay, which is the transmission delay from the master node to the slave node. In other words, the first delay refers to the time from when the master node sends a downlink frame to when the slave node receives the downlink frame.
[0156] It is understandable that the transmission delay from the master node to a slave node is constant.
[0157] Alternatively, the master node can send the first frame via broadcast.
[0158] In some embodiments, after sending the first frame, the master node may save the reference transmission time of the first frame. The reference transmission time of the first frame is the transmission time under the master node's master reference clock.
[0159] For example, when sending the first frame, if the master reference clock of the master node is 10:00, then the sending time of the first frame is determined to be 10:00.
[0160] In some embodiments, after determining the transmission time of the first frame, the master node may also send the transmission reference time of the first frame to the slave node.
[0161] Optionally, the transmission reference time of the first frame can be carried in the first frame, or in any frame sent by the master node after the first frame and before the second frame.
[0162] In one alternative implementation, the transmission reference time of the first frame can be carried in the first frame and transmitted.
[0163] For example, when the master node sends the first frame, it can directly embed the sending time of the first frame into the frame header of the first frame and send the first frame to the slave node.
[0164] In another alternative implementation, the transmission reference time of the first frame can be carried in a frame after the first frame to send the transmission reference time of the first frame to the slave node.
[0165] Optionally, after receiving the first frame, the slave node can determine the reception reference time of the first frame.
[0166] The first frame reception reference time refers to the time when the slave node receives the first frame under the master reference clock of the master node.
[0167] Optionally, the reception reference time of the first frame received by the slave node can be determined based on the transmission reference time of the first frame and the first delay.
[0168] In some embodiments, the first delay is determined based on the second delay, the third delay, and the fourth delay.
[0169] The second delay is used to characterize the theoretical time from when the master node sends the first frame to the farthest slave node to when it receives the third frame sent by the farthest slave node in response to the first frame.
[0170] For example, referring to Figure 1, taking the master node as the master node 110 and the farthest slave node as 121 as an example. The second delay can be the transmission delay of the first frame after the master node 110 sends the first frame to the slave node 121, plus the processing delay of the first frame after the slave node 121 receives the first frame, plus the transmission delay of the third frame after the slave node 121 processes the first frame, generates the third frame, and sends the third frame to the master node 110.
[0171] The third delay is used to ensure that the third frame sent by the slave node reaches the master node at the same time as the third frame sent by the farthest slave node reaches the master node. The third frame is used to respond to the first frame.
[0172] In some embodiments, the third delay is used to characterize twice the time difference between the time when the first frame is received from the node and the time when the first frame is received from the farthest node.
[0173] The third delay is the difference between the second delay and the fifth delay. The fifth delay includes the transmission delay of the master node sending the first frame to the slave node, the processing delay of the slave node on the first frame, and the transmission delay of the slave node sending the third frame to the master node in response to the first frame.
[0174] For example, referring to Figure 1, taking the master node as the master node 110 and the farthest slave node as the slave node 129 as an example, the fifth delay can be the transmission delay of the first frame after the master node 110 sends the first frame to the slave node 129, plus the processing delay of the first frame after the slave node 129 receives the first frame, plus the transmission delay of the third frame after the slave node 129 processes the first frame, generates the third frame, and sends the third frame to the master node 110.
[0175] The fourth latency is the processing latency of the data frame by the slave node, and the processing latency of the data frame is the same for different slave nodes.
[0176] Optionally, the second and fourth delays mentioned above can be pre-configured.
[0177] Optionally, the aforementioned second and third delays can be sent from the master node to the slave node.
[0178] In some embodiments, after receiving the first frame, the slave node can determine the reception time of the first frame based on the transmission time of the first frame, the second delay, the fourth delay, and the fifth delay.
[0179] For example, the reception time of the first frame received from the node can be calculated using Formula (I). Formula (I) is as follows:
[0180]
[0181] Where A is the reception time of the first frame received by the slave node, B is the transmission time of the first frame sent by the master node, C is the second delay, D is the fourth delay, and E is the fifth delay.
[0182] S402, The master node sends the second frame to the slave node. Correspondingly, the slave node receives the second frame sent by the master node.
[0183] In some embodiments, the second frame can be any frame sent by the master node to the slave node after the first frame.
[0184] As shown in S401 above, in another optional implementation, the transmission reference time of the first frame can be carried in a frame after the first frame to send the indication information to the slave node.
[0185] For example, taking the first frame as frame 1 and the second frame as frame 5, the transmission reference time of the first frame can be embedded in the frame header of any one of frames 2, 3, and 4 (such as frame 3), and frame 3 can be sent to the slave node.
[0186] Optionally, the master node can send the second frame via broadcast.
[0187] In some embodiments, the first delay is used for time synchronization each time the node receives a second frame.
[0188] Optionally, slave nodes can perform time synchronization based on time synchronization parameters.
[0189] The time synchronization parameters may include the first delay and the transmission reference time of the first frame.
[0190] In some embodiments, the slave node determines the reception reference time of the second frame based on the time synchronization parameters, and then performs time synchronization based on the reception reference time of the second frame.
[0191] The receiving reference time of the second frame refers to the time when the slave node receives the second frame under the master reference clock of the master node.
[0192] Specifically, the slave node can synchronize its local time with the reference time for receiving the second frame.
[0193] Optionally, the reception reference time of the second frame is obtained based on the first delay, the transmission reference time of the first frame, and the transmission time interval, where the transmission time interval is the time interval between the second frame and the first frame.
[0194] The transmission time interval is determined based on the number of frames between the first and second frames and the frame transmission period.
[0195] In some embodiments, the receiving reference time of the slave node when it receives the second frame can be determined based on the number of frames between the second frame and the first frame, the receiving reference time when the slave node receives the first frame, and the first delay of the master node.
[0196] For example, combining formula (I) above, the reception reference time of the second frame received from the node can be calculated using formula (II). Formula (II) is as follows:
[0197] Formula (II) = F = A + (GH) * I
[0198] Where F is the reception reference time when the slave node receives the second frame, A is the reception reference time when the slave node receives the first frame, G is the second frame, H is the first frame, and I is the transmission delay from the master node to the slave node (first delay).
[0199] Optionally, at least one of the first and second frames sent by the master node is a data frame.
[0200] In the time synchronization method provided in this application embodiment, due to the inevitable transmission delay between different nodes in the network, the time of the master node and the slave node is out of sync. Therefore, in this application, the slave node determines the transmission time used to transmit data from the master node to the slave node by receiving a reference frame sent by the master node. Furthermore, since the transmission time from the master node to the slave node is usually stable, after the slave node determines the transmission time used to transmit data from the master node to the slave node, subsequent slave nodes can directly determine the time of the master node when receiving the second frame each time, thereby continuously synchronizing the slave node's local time according to the master node's time, improving the synchronization accuracy.
[0201] As described in S304 and S306 above, the time synchronization system needs to be initialized, calibrated, and verified before performing periodic time synchronization. The following section, in conjunction with the embodiment shown in Figure 5, provides a solution for initializing, calibrating, and verifying the time synchronization system.
[0202] For example, as shown in FIG5, the time synchronization method provided in this application embodiment includes the following steps:
[0203] S501, the master node sends a synchronization code and link parameter information to the slave node. Correspondingly, the slave node receives the synchronization code and link parameter information sent by the master node.
[0204] The synchronization code can be the initialization synchronization code, and the link parameter information includes the frame format, frame length, and the maximum data transmission volume of the network.
[0205] In some embodiments, the master node can send initialization synchronization codes and link parameter information a fixed number of times. The fixed number of times can be a manually set value, which can be flexibly adjusted according to the actual scenario.
[0206] S502, The slave node calibrates its local clock based on the synchronization code and synchronizes the link frequency based on the link parameter information.
[0207] In some embodiments, after receiving a synchronization code, the slave node can correct its local clock according to the synchronization code to achieve frequency synchronization between the slave node's local clock and the master node's local clock. After frequency synchronization, each node processes data with the same efficiency, so that each slave node processes frames in the same time.
[0208] Thus, on the one hand, by receiving the synchronization code and link parameter information sent by the master node, this application ensures that the processing speed of each slave node is consistent with that of the master node, thereby ensuring that the processing latency of each slave node for frames is consistent; on the other hand, by receiving the delay correction message sent by the master node, this application ensures the accuracy of its own balanced latency, so as to facilitate time synchronization between different nodes.
[0209] S503, the master node sends the fifth frame to the slave node. Correspondingly, the slave node receives the fifth frame sent by the master node.
[0210] The fifth frame carries a registration start message and is used to request the node to start the registration process.
[0211] In some embodiments, after executing S501, the master node performs a fixed delay before sending the registration start message. The fixed delay can be a manually set value.
[0212] Optionally, after sending the registration start message, the master node can wait for a preset duration to allow the slave nodes to respond with registration information. This preset duration can be a manually set value, used to ensure that the slave node furthest from the master node in the network can respond with registration information.
[0213] Optionally, the fifth frame is sent by the master node while the slave node is in the initialization state.
[0214] In some embodiments, the slave node is in an initialization state when at least one of the following conditions is met: the vehicle to which the slave node is located is powered on for the first time; the vehicle to which the slave node is located has no abnormalities in its self-test after being powered on; or the vehicle to which the slave node is located is waiting to execute the factory configuration process.
[0215] S504. The slave node sends the sixth frame to the master node. Correspondingly, the master node receives the sixth frame sent by the slave node.
[0216] The sixth frame carries registration information, which includes the identity and serial number of the slave node.
[0217] Optionally, after receiving the registration start message, the slave node may perform a random delay before sending the registration information to the master node.
[0218] In some embodiments, performing a random delay is used to reduce the probability of conflicts in registration information reported by nodes. For example, the random delay can be generated as an integer multiple of a pre-agreed minimum time unit, where the minimum time unit should be greater than the duration of a message for which a single node uploads registration information.
[0219] In some embodiments, the master node may receive registration information from the slave node within the aforementioned preset waiting time, and then register the slave node in the network based on the registration information.
[0220] Optionally, the fields in the header of the registration information are used to enable the master node to identify and discard the registration information in the event of overlapping transmissions.
[0221] Thus, this application enables the master node to know the identity and sequence number of each slave node by having the slave node report to the master node, thereby ensuring that the master node can synchronize the time of multiple slave nodes in the future.
[0222] S505, the master node sends the first frame to the slave node. Correspondingly, the slave node receives the first frame sent by the master node.
[0223] The first frame includes the start delay corresponding to the slave node. The first frame includes the start delay allocated to each slave node for sending the third frame. The start delay is the time it takes for the slave node to wait for the start of uplink frame feedback after processing the downlink frame sent by the master node.
[0224] In some embodiments, the first frame can be a reference frame. The master node can send the reference frame to the slave node and record the sending reference time of the reference frame.
[0225] Optionally, the first frame may also include the start delays for other slave nodes in the network.
[0226] S506, The slave node sends the third frame to the master node. Correspondingly, the master node receives the third frame sent by the slave node.
[0227] The third frame is sent from the slave node to the master node after the initial delay following the receipt of the first frame.
[0228] It is understandable that the start delay in S505 above can also be called the sixth delay.
[0229] In some embodiments, the slave node may respond to the first frame sent by the master node by sending a third frame if the time it takes to receive the first frame reaches the sixth delay. The master node records the time it receives the third frame.
[0230] The third frame is the feedback frame sent by the slave node in response to the first frame.
[0231] S507. The master node determines the third delay of the slave node based on the third frame.
[0232] In some embodiments, after receiving the third frame, the master node can determine the third delay of the slave node based on the reception time of the third frame, the transmission time of the third frame, and the sixth delay.
[0233] For example, combining formula (i) above, the third delay of the slave node can be calculated using formula (iii). Formula (iii) is as follows:
[0234] =C-(KLM) Formula (III)
[0235] Where J is the third delay of the slave node, K is the fourth frame reception time, L is the third frame transmission time, and M is the sixth delay.
[0236] S508, the master node sends the fourth frame to the slave node. Correspondingly, the slave node receives the fourth frame sent by the master node.
[0237] In some embodiments, the master node may respond to the third frame by sending a fourth frame to the slave node, the fourth frame including any one of the following: a first delay, a third delay, and correction information for the third delay.
[0238] S509. The slave node sends the seventh frame to the master node. Correspondingly, the master node receives the seventh frame sent by the slave node.
[0239] The seventh frame includes the registration information of the slave node, and is used to request the master node to verify the registration information of the slave node.
[0240] Optionally, the seventh frame is sent from the slave node to the master node after the slave node has successfully initialized and the vehicle to which the slave node is located has been powered on again.
[0241] S510, the master node sends the eighth frame to the slave node. Correspondingly, the slave node receives the eighth frame sent by the master node.
[0242] The eighth frame carries registration verification information, while the lower eight frames are used to characterize whether the registration information sent by the slave node this time is consistent with the pre-stored registration information.
[0243] In some embodiments, the master node may send registration kernel information to the slave node in response to the registration information.
[0244] Thus, this application configures various parameters of the slave node by receiving registration verification information issued by the master node, ensuring that the slave node can work normally and communicate normally with the master node.
[0245] S511. The master node sends a synchronization code and link parameter information to the slave node. Correspondingly, the slave node receives the synchronization code and link parameter information sent by the master node.
[0246] In some embodiments, the master node can send synchronization codes and link parameter information a fixed number of times. The fixed number of times can be a manually set value that can be flexibly adjusted according to the actual scenario.
[0247] Optionally, the synchronization code and link parameter information can be carried in any data frame sent by the master node.
[0248] Optionally, the slave node needs to detect an anomaly in time synchronization performance; and / or, after the slave node switches from sleep mode or low-power mode to normal operation mode, it receives the synchronization code and link information sent by the master node.
[0249] S512, The slave node calibrates its local clock based on the synchronization code and synchronizes the link frequency based on the link parameter information.
[0250] In some embodiments, after receiving the synchronization code, the slave node can recalibrate its local clock based on the synchronization code to achieve frequency synchronization between the slave node's local clock and the master node's local clock. After frequency synchronization, each node processes data with the same efficiency, ensuring that each slave node processes frames in the same time.
[0251] In some embodiments, the slave node can compare the received link parameter information with the local link parameter information, and update the received link parameter information to the local link parameter information under different circumstances.
[0252] S513. The master node sends a delay correction start message to the slave node. Correspondingly, the slave node receives the delay correction start message sent by the master node.
[0253] Optionally, after sending the delay correction initiation message, the master node can wait for a preset duration to receive an acknowledgment message from the slave node. This preset duration can be a manually set value, designed to ensure that the slave node furthest from the master node in the network can send an acknowledgment message.
[0254] S514. The slave node sends a delay correction acknowledgment message to the master node. Correspondingly, the master node receives the delay correction acknowledgment message sent by the slave node.
[0255] In some embodiments, the slave node may send a delay correction acknowledgment message to the master node in response to the delay correction initiation message.
[0256] Optionally, after receiving the correction start message, the slave node may execute the third delay determined by S508 before sending an acknowledgment message to the master node.
[0257] In some embodiments, the third delay is used to avoid conflicts in the registration information reported by the slave node. The master node can receive the acknowledgment message from the slave node within the aforementioned preset waiting time.
[0258] S515. The master node adjusts the third delay of the slave node based on the delay correction confirmation message.
[0259] In some embodiments, after receiving the delay correction confirmation message, the master node can adjust the third delay of the slave node based on the actual time of receiving the delay correction confirmation message and the theoretical time of receiving the delay correction confirmation message.
[0260] For example, if the actual time of receiving the delay correction acknowledgment message is earlier than the theoretical time of receiving the delay correction acknowledgment message, a third delay is added; if the actual time of receiving the delay correction acknowledgment message is later than the theoretical time of receiving the delay correction acknowledgment message, the third delay is reduced.
[0261] S516. The master node sends a delay correction message to the slave node. Correspondingly, the slave node receives the delay correction message sent by the master node.
[0262] In some embodiments, the master node may send a delay correction message to the slave node in response to the delay correction acknowledgment message.
[0263] In one alternative implementation, a delay correction message is used to confirm that the third delay of the slave node is accurate.
[0264] In another optional implementation, the delay correction message carries an updated third delay, which is used to update the third delay of the slave node.
[0265] It is understandable that S513 to S516 above are used to determine the correction information for the third delay included in the fourth frame in S508.
[0266] Furthermore, as shown in Figure 5, after the slave node receives the delay correction message sent by the master node, the master node and the slave node can execute S401 and S402 as described above, which will not be repeated here.
[0267] Optionally, time synchronization operations can be paused when the slave node is in sleep mode or low-power mode.
[0268] In some embodiments, when the slave node can enter a sleep mode or a low-power mode, it exits the third state, which is the state corresponding to time synchronization.
[0269] In some embodiments, when the slave node does not need to transmit data, it can exit time synchronization and stop receiving synchronization frames sent by the master node.
[0270] Thus, the slave nodes in this application can flexibly exit the time synchronization state when time synchronization is not required, saving power consumption.
[0271] Optionally, the slave node sends the ninth frame to the master node. Correspondingly, the master node receives the ninth frame sent by the slave node.
[0272] The ninth frame is used to indicate that the slave node is reconnecting to the network.
[0273] Optionally, the ninth frame is sent by the slave node after it detects an anomaly in time synchronization performance and / or switches from sleep mode or low-power mode to normal operation mode.
[0274] In some embodiments, the slave node can also perform a time synchronization recovery operation when switching from a sleep mode or a low-power mode to a normal operation mode.
[0275] For example, when a slave node is woken up from sleep or low-power mode, it can receive a synchronization code sent by the master node and synchronize its frequency with the master node's clock.
[0276] It should be noted that because the system always retains the third delay of the slave node, the slave node can resynchronize the clock frequency without causing conflicts or data loss.
[0277] In this way, when a slave node in the application needs to synchronize time, it can join the time synchronization process at any time, ensuring that the time of all slave nodes in the time synchronization system is consistent with the time of the master node.
[0278] Optionally, the master node can also update the master reference clock based on the smart antenna of the slave node.
[0279] For example, as shown in FIG6, the time synchronization method provided in this application embodiment may further include the following steps:
[0280] S601, the master node sends the tenth frame to the slave node. Correspondingly, the slave node receives the tenth frame sent by the master node.
[0281] The tenth frame carries a clock correction request message, which is used to request the correction of the master node's local time. The clock correction request message can also be called the "master clock calibration" management message.
[0282] For example, the master node can send a data frame carrying a "master clock calibration" management message.
[0283] Optionally, the slave node may respond to a clock correction request message, update its local time based on satellite information, and determine the time offset of the local time before and after the update.
[0284] For example, a slave node can update its local time via a satellite clock and record the time offset based on a "master clock calibration" management message.
[0285] Optionally, the tenth frame is sent by the master node in the event of a clock anomaly.
[0286] S602, The slave node sends the eleventh frame to the master node. Correspondingly, the master node receives the eleventh frame sent by the slave node.
[0287] The eleventh frame carries a clock correction response message. The eleventh frame includes a time offset, which is the offset between the node's local time and the time before and after updating based on satellite information.
[0288] The clock correction response message includes a time offset, which can be a specific numerical value. Satellite clocks can be updated using the Global Navigation Satellite System (GNSS) protocol or other time-updating methods.
[0289] Alternatively, in the event of a satellite clock malfunction, the time offset in the upper limit message sent from the slave node to the master node can be 0.
[0290] For example, a slave node can send an uplink message (such as a clock correction response message) carrying a clock offset to the master node.
[0291] Optionally, the master node can update the local time based on the time offset.
[0292] Thus, in the event of an anomaly in the local time of the master node, this application can update the local time of the master node based on the time offset obtained after the slave node updates its local time according to satellite information, thereby ensuring the accuracy of the master node's clock source.
[0293] The above mainly describes the solutions provided by the embodiments of this application from the perspective of network element interaction. Correspondingly, the embodiments of this application also provide a communication device for implementing the various methods described above. This communication device can be a terminal device in the above method embodiments, or a device containing the aforementioned terminal device, or a component usable in a terminal device; or, the communication device can be a network device in the above method embodiments, or a device containing the aforementioned network device, or a component usable in a network device. It is understood that, in order to achieve the above functions, the communication device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0294] This application embodiment can divide the communication device into functional modules according to the above method embodiment. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be understood that the module division in this application embodiment is illustrative and is only a logical functional division. In actual implementation, there may be other division methods.
[0295] For example, Figure 7 is a schematic diagram of a communication device 700 provided in an embodiment of this application. The communication device includes a transceiver module 710 and optionally a processing module 720. The transceiver module 710, also known as a transceiver unit, is used to implement the transceiver function. For example, it can be a transceiver circuit, a transceiver, a transceiver device, or a communication interface.
[0296] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0297] The transceiver module 710 is used to receive the first frame sent by the master node. The transceiver module 710 is also used to receive the second frame sent by the master node. The first frame is used to determine the first delay, which is the transmission delay from the master node to the slave node. This first delay is used for time synchronization by the slave node each time it receives the second frame.
[0298] Taking the communication device 700 as the master node in the above method embodiment as an example, one possible implementation is as follows:
[0299] The transceiver module 710 is used to send a first frame to the slave node. The transceiver module 710 is also used to send a second frame to the slave node. The first frame is used to determine a first delay, which is the transmission delay from the master node to the slave node. The first delay is used for time synchronization each time the slave node receives the second frame.
[0300] In the time synchronization device provided in this application embodiment, due to the inevitable transmission delay between different nodes in the network, the time of the master node and the slave node is out of sync. Therefore, the slave node in this application determines the transmission time used to transmit data from the master node to the slave node by receiving a reference frame sent by the master node. Furthermore, since the transmission time from the master node to the slave node is usually stable, after the slave node determines the transmission time used to transmit data from the master node to the slave node, subsequent slave nodes can directly determine the time of the master node when receiving the second frame each time based on the transmission time used to transmit data from the master node to the slave node, thereby continuously synchronizing the local time of the slave node with the time of the master node, improving the synchronization accuracy of time synchronization.
[0301] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0302] The processing module 720 is used to perform time synchronization based on time synchronization parameters. The time synchronization parameters include the first delay and the reference time for sending the first frame.
[0303] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0304] The processing module 720 is used to determine the receiving reference time of the second frame based on the time synchronization parameters, and to perform time synchronization based on the receiving reference time of the second frame.
[0305] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0306] Processing module 720 is used to synchronize the local time of the slave node with the reception reference time of the second frame.
[0307] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0308] The transceiver module 710 is used to send a third frame to the master node and receive a fourth frame sent by the master node; wherein the fourth frame includes any one of the following: a first delay, a third delay, and correction information for the third delay.
[0309] Taking the communication device 700 as the master node in the above method embodiment as an example, one possible implementation is as follows:
[0310] The transceiver module 710 is used to receive the third frame sent by the slave node and send the fourth frame to the slave node; wherein the fourth frame includes any one of the following: the first delay, the third delay, and the correction information of the third delay.
[0311] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0312] The transceiver module 710 is used to receive the fifth frame sent by the master node, which is used to request the slave node to start the registration process; and to send the sixth frame to the master node, which includes registration information.
[0313] Taking the communication device 700 as the master node in the above method embodiment as an example, one possible implementation is as follows:
[0314] The transceiver module 710 is used to send a fifth frame to the slave node, which is used to request the slave node to start the registration process; and to receive a sixth frame sent by the slave node, which includes registration information.
[0315] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0316] The transceiver module 710 is used to receive the fifth frame sent by the master node when the slave node is in the initialization state.
[0317] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0318] The transceiver module 710 is used to send a seventh frame to the master node, which is used to request the master node to verify the registration information of the slave node. The seventh frame includes the registration information of the slave node. It also receives an eighth frame sent by the master node, which is used to indicate whether the registration information sent by the slave node this time is consistent with the pre-stored registration information.
[0319] Taking the communication device 700 as the master node in the above method embodiment as an example, one possible implementation is as follows:
[0320] The transceiver module 710 is used to: receive the seventh frame sent by the slave node, the seventh frame being used to request the master node to verify the registration information of the slave node, the seventh frame including the registration information of the slave node; and send the eighth frame to the slave node, the eighth frame being used to indicate whether the registration information sent by the slave node this time is consistent with the pre-stored registration information.
[0321] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0322] The transceiver module 710 is used to receive synchronization codes and link parameter information sent by the master node. The processing module 720 is used to calibrate the local clock of the slave node based on the synchronization code and to synchronize the link frequency based on the link parameter information. The transceiver module 710 is also used to send a ninth frame to the master node, which is used to instruct the slave node to reconnect to the network.
[0323] Taking the communication device 700 as the master node in the above method embodiment as an example, one possible implementation is as follows:
[0324] The transceiver module 710 is used to: send synchronization codes and link parameter information to the slave node; and receive the ninth frame sent by the slave node, which is used to instruct the slave node to reconnect to the network.
[0325] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0326] The processing module 720 is used to: detect an abnormality in time synchronization performance; and / or switch from sleep mode or low-power mode to normal operation mode.
[0327] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0328] Processing module 720 is used to: pause the execution of time synchronization operations when in sleep mode or low power mode.
[0329] Taking the communication device 700 as an example of the slave node described in the above method embodiment, one possible implementation is as follows:
[0330] The transceiver module 710 is used to: receive the tenth frame sent by the master node, which is used to request the correction of the master node's local time; and send the eleventh frame to the master node, which includes a time offset, which is the offset of the slave node's local time before and after updating according to satellite information.
[0331] Taking the communication device 700 as the master node in the above method embodiment as an example, one possible implementation is as follows:
[0332] The transceiver module 710 is used to: send the tenth frame to the slave node, the tenth frame being used to request correction of the master node's local time; and receive the eleventh frame sent by the slave node, the eleventh frame including a time offset, the time offset being the offset of the slave node's local time before and after updating according to satellite information.
[0333] All relevant content of each step involved in the above method embodiments can be referred to in the functional description of the corresponding functional module, and will not be repeated here. Optionally, the communication device 700 may further include a storage module, which can be used to store instructions and / or data, and the processing module 720 can read the instructions and / or data in the storage module.
[0334] This application also provides an electronic and electrical system, including a time synchronization system as described in the above embodiments.
[0335] This application also provides a vehicle including the above-described electronic and electrical system.
[0336] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the time synchronization method in the method flow shown in the above method embodiments.
[0337] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections having one or more wires; portable computer disks; hard disks; random access memory (RAM); read-only memory (ROM); erasable programmable read-only memory (EPROM); registers; hard disks; optical fibers; compact disc read-only memory (CD-ROM); optical storage devices; magnetic storage devices; or any suitable combination thereof; or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In some embodiments, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in connection with an instruction execution system, apparatus, or device.
[0338] Embodiments of the present invention provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the time synchronization method described in Figures 4 to 6.
[0339] Since the computer-readable storage medium and computer program product in the embodiments of the present invention can be applied to the above methods, the technical effects obtained can also be referred to the above method embodiments, and the embodiments of the present invention will not be repeated here.
[0340] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0341] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0342] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0343] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A time synchronization method, characterized in that, The method includes: a slave node receiving a first frame sent by a master node, the first frame being used to determine a first delay, the first delay being the transmission delay from the master node to the slave node; the slave node receiving a second frame sent by the master node, the first delay being used for time synchronization each time the slave node receives the second frame.
2. The method according to claim 1, characterized in that, The method further includes: the slave node performing time synchronization according to time synchronization parameters, the time synchronization parameters including the first delay and the transmission reference time of the first frame.
3. The method according to claim 2, characterized in that, The slave node performs time synchronization according to the time synchronization parameters, including: the slave node determines the reception reference time of the second frame according to the time synchronization parameters; the slave node performs time synchronization according to the reception reference time of the second frame.
4. The method according to claim 3, characterized in that, The slave node performs time synchronization based on the reception reference time of the second frame, including: the slave node synchronizing its local time to the reception reference time of the second frame.
5. The method according to claim 3, characterized in that, The reception reference time of the second frame is obtained based on the first delay, the transmission reference time of the first frame, and the transmission time interval, wherein the transmission time interval is the time interval between the second frame and the first frame.
6. The method according to claim 5, characterized in that, The transmission time interval is determined based on the number of frames between the first frame and the second frame and the frame transmission period.
7. The method according to claim 2, characterized in that, The transmission reference time of the first frame is carried in the first frame or in any frame transmitted by the master node after the first frame and before the second frame.
8. The method according to claim 1, characterized in that, The first delay is determined based on the second delay, the third delay, and the fourth delay; wherein, the second delay is used to characterize the theoretical time from when the master node sends the first frame to the farthest slave node to when it receives the third frame sent by the farthest slave node in response to the first frame; the fourth delay is the processing delay of the slave node on the data frame; the third delay is used to ensure that the time when the third frame sent by the slave node reaches the master node is the same as the time when the third frame sent by the farthest slave node reaches the master node, and the third frame is used to respond to the first frame.
9. The method according to claim 8, characterized in that, After the slave node receives the first frame sent by the master node, the method further includes: the slave node sending the third frame to the master node; the slave node receiving the fourth frame sent by the master node; wherein the fourth frame includes any one of the following: the first delay, the third delay, and correction information for the third delay.
10. The method according to claim 9, characterized in that, The first frame includes the start delay corresponding to the slave node; the third frame is sent by the slave node to the master node after the start delay has elapsed since the first frame was received.
11. The method according to claim 10, characterized in that, The first frame also includes the start delays for other slave nodes in the network.
12. The method according to claim 8, characterized in that, The second delay and the fourth delay are pre-configured.
13. The method according to claim 1, characterized in that, The method further includes: the slave node receiving a fifth frame sent by the master node, the fifth frame being used to request the slave node to start the registration process; the slave node sending a sixth frame to the master node, the sixth frame including registration information.
14. The method according to claim 13, characterized in that, The registration information includes the identity information of the slave node.
15. The method according to claim 13, characterized in that, The slave node receiving the fifth frame sent by the master node includes: when the slave node is in the initialization state, the slave node receives the fifth frame sent by the master node.
16. The method according to claim 15, characterized in that, The slave node is in the initialization state when at least one of the following conditions is met: the vehicle where the slave node is located is powered on for the first time; the vehicle where the slave node is located has no abnormalities after power-on self-test; the vehicle where the slave node is located is waiting to execute the factory configuration process.
17. The method according to claim 1, characterized in that, The method further includes: the slave node sending a seventh frame to the master node, the seventh frame being used to request the master node to verify the registration information of the slave node, the seventh frame including the registration information of the slave node; the slave node receiving an eighth frame sent by the master node, the eighth frame being used to characterize whether the registration information sent by the slave node this time is consistent with the pre-stored registration information.
18. The method according to claim 17, characterized in that, The seventh frame is sent by the slave node to the master node after the slave node has been successfully initialized and the vehicle to which the slave node is located has been powered on again.
19. The method according to claim 1, characterized in that, The method further includes: the slave node receiving a synchronization code and link parameter information sent by the master node; the slave node calibrating its local clock based on the synchronization code and synchronizing the link frequency based on the link parameter information; and the slave node sending a ninth frame to the master node, the ninth frame being used to instruct the slave node to reconnect to the network.
20. The method according to claim 19, characterized in that, Before the slave node receives the synchronization code and link information sent by the master node, the method further includes: the slave node detecting an abnormality in time synchronization performance; and / or, the slave node switching from sleep mode or low-power mode to normal operation mode.
21. The method according to claim 20, characterized in that, The method further includes: the slave node suspending the execution of time synchronization operations when it is in sleep mode or low power mode.
22. The method according to claim 19, characterized in that, The synchronization code and the link parameter information are carried in any data frame sent by the master node.
23. The method according to claim 1, characterized in that, The method further includes: the slave node receiving a tenth frame sent by the master node, the tenth frame being used to request correction of the master node's local time; the slave node sending an eleventh frame to the master node, the eleventh frame including a time offset, the time offset being the offset of the slave node's local time before and after updating according to satellite information.
24. The method according to any one of claims 1 to 23, characterized in that, The slave node and the master node are nodes in a passive optical network.
25. The method according to any one of claims 1 to 24, characterized in that, At least one of the first frame and the second frame is a data frame.
26. A time synchronization method, characterized in that, The method includes: a master node sending a first frame to a slave node, the first frame being used to determine a first delay, the first delay being the transmission delay from the master node to the slave node; the master node sending a second frame to the slave node, the first delay being used for time synchronization each time the slave node receives the second frame.
27. The method according to claim 26, characterized in that, The time synchronization is based on time synchronization parameters, which include the first delay and the transmission reference time of the first frame.
28. The method according to claim 27, characterized in that, The time synchronization is based on the reception reference time of the second frame, which is obtained based on the time synchronization parameters.
29. The method according to claim 28, characterized in that, The time synchronization is used to synchronize the local time of the slave node with the reception reference time of the second frame.
30. The method according to claim 28, characterized in that, The reception reference time of the second frame is obtained based on the first delay, the transmission reference time of the first frame, and the transmission time interval, wherein the transmission time interval is the time interval between the second frame and the first frame.
31. The method according to claim 30, characterized in that, The transmission time interval is determined based on the number of frames between the first frame and the second frame and the frame transmission period.
32. The method according to claim 27, characterized in that, The transmission reference time of the first frame is carried in the first frame or in any frame transmitted by the master node after the first frame and before the second frame.
33. The method according to claim 26, characterized in that, The first delay is determined based on the second delay, the third delay, and the fourth delay; wherein, the second delay is used to characterize the theoretical time from when the master node sends the first frame to the farthest slave node to when it receives the third frame sent by the farthest slave node in response to the first frame; the fourth delay is the processing delay of the slave node on the data frame; the third delay is used to ensure that the time when the third frame sent by the slave node reaches the master node is the same as the time when the third frame sent by the farthest slave node reaches the master node, and the third frame is used to respond to the first frame.
34. The method according to claim 33, characterized in that, After the master node sends the first frame to the slave node, the method further includes: the master node sending the third frame to the slave node; the master node receiving the fourth frame sent by the slave node; wherein the fourth frame includes any one of the following: the first delay, the third delay, and correction information for the third delay.
35. The method according to claim 34, characterized in that, The first frame includes the start delay corresponding to the slave node; the third frame is sent by the slave node to the master node after the start delay has elapsed since the first frame was received.
36. The method according to claim 35, characterized in that, The first frame also includes the start delays for other slave nodes in the network.
37. The method according to claim 33, characterized in that, The second delay and the fourth delay are pre-configured.
38. The method according to claim 26, characterized in that, The method further includes: the master node sending a fifth frame to the slave node, the fifth frame being used to request the slave node to start the registration process; the master node receiving a sixth frame sent by the slave node, the sixth frame including registration information.
39. The method according to claim 38, characterized in that, The registration information includes the identity information of the slave node.
40. The method according to claim 38, characterized in that, The fifth frame is sent by the master node while the slave node is in the initialization state.
41. The method according to claim 40, characterized in that, The slave node is in the initialization state when at least one of the following conditions is met: the vehicle where the slave node is located is powered on for the first time; the vehicle where the slave node is located has no abnormalities after power-on self-test; the vehicle where the slave node is located is waiting to execute the factory configuration process.
42. The method according to claim 26, characterized in that, The method further includes: the master node receiving a seventh frame sent by the slave node, the seventh frame being used to request the master node to verify the registration information of the slave node, the seventh frame including the registration information of the slave node; the master node sending an eighth frame to the slave node, the eighth frame being used to characterize whether the registration information sent by the slave node this time is consistent with the pre-stored registration information.
43. The method according to claim 42, characterized in that, The seventh frame is sent by the slave node to the master node after the slave node has been successfully initialized and the vehicle to which the slave node is located has been powered on again.
44. The method according to claim 26, characterized in that, The method further includes: the master node sending a synchronization code and link parameter information to the slave node; the master node receiving a ninth frame sent by the slave node, the ninth frame being used to instruct the slave node to reconnect to the network.
45. The method according to claim 44, characterized in that, The ninth frame is sent by the slave node after it detects an anomaly in time synchronization performance and / or switches from sleep mode or low-power mode to normal operation mode.
46. The method according to claim 44, characterized in that, The synchronization code and the link parameter information are carried in any data frame sent by the master node.
47. The method according to claim 26, characterized in that, The method further includes: the master node sending a tenth frame to the slave node, the tenth frame being used to request correction of the master node's local time; the master node receiving an eleventh frame sent by the slave node, the eleventh frame including a time offset, the time offset being the offset of the slave node's local time before and after updating according to satellite information.
48. The method according to claim 47, characterized in that, The tenth frame was sent by the master node in the event of a clock anomaly.
49. The method according to any one of claims 26 to 48, characterized in that, The slave node and the master node are nodes in a passive optical network.
50. The method according to any one of claims 26 to 49, characterized in that, At least one of the first frame and the second frame is a data frame.
51. A communication device, characterized in that, include: A functional unit for performing the method as described in any one of claims 1-25, or a functional unit for performing the method as described in any one of claims 26-50; wherein the action performed by the functional unit is implemented by hardware or by hardware executing corresponding software.
52. A time synchronization system, characterized in that, The device includes a master node, at least one optical splitter, and a plurality of slave nodes, wherein the master node is connected to the plurality of slave nodes through the at least one optical splitter; the slave nodes are used to perform the method as described in any one of claims 1-25, and the master node is used to perform the method as described in any one of claims 26-50.
53. An electronic and electrical system, characterized in that, Including the time synchronization system as described in claim 52.
54. A vehicle, characterized in that, Including the electronic and electrical system as described in claim 53.
55. A computer-readable storage medium storing instructions, characterized in that, When the computer executes the instruction, the computer performs the method described in any one of claims 1 to 50.
56. A computer program product, the computer program product comprising instructions, characterized in that, When the instructions are executed on a computer, the computer performs the method as described in any one of claims 1 to 50.