Time synchronization methods, devices, equipment, and storage media

By using a virtual LAN identifier to transmit time synchronization data in the switching equipment, the problem of hardware not supporting GPTP in the autonomous driving system was solved, GPTP time synchronization was realized, compatibility was improved and hardware modification costs were reduced.

CN116470981BActive Publication Date: 2026-11-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310343150.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2026-11-10
Estimated Expiration
2043-03-31

AI Technical Summary

Technical Problem

In existing autonomous driving systems, the hardware does not support the Generalized Precision Time Protocol (GPTP), which prevents sensors from being connected, leading to compatibility issues and increased hardware replacement costs.

Method used

By using a virtual LAN identifier to transmit time synchronization data in the switching equipment, GPTP time synchronization between the source and target devices is achieved, enabling protocol synchronization in the absence of hardware support for GPTP through software.

Benefits of technology

It improves system compatibility, reduces hardware modification costs, and enables GPTP time synchronization, making it suitable for environments where the hardware does not support GPTP.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116470981B_ABST
    Figure CN116470981B_ABST
Patent Text Reader

Abstract

This disclosure provides a time synchronization method, apparatus, device, and storage medium, relating to the field of communication technology, and particularly to the fields of autonomous driving, local area networks (LANs), and time synchronization. A specific implementation scheme is as follows: a time synchronization method is applied to a source device that supports GPTP. The method includes: obtaining first data for the target device based on the correspondence between a VLAN and a target device; wherein the first data includes time synchronization data and a VLAN identifier corresponding to the target device; and transmitting the time synchronization data to the target device through a switching device based on the VLAN identifier. According to embodiments of this disclosure, the source device can transmit time synchronization data from the source device to the target device through a switching device based on the VLAN identifier, thereby achieving time synchronization between the source device and the target device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communication technology, and more particularly to the fields of autonomous driving, local area networks, and time synchronization technology. Background Technology

[0002] Time-sensitive systems, such as autonomous driving systems, can use the Generalized Precision Time Protocol (GPTP) to achieve sensor time synchronization. However, GPTP typically requires all hardware in the system to support the protocol to function, leading to hardware compatibility issues. Summary of the Invention

[0003] This disclosure provides a time synchronization method, apparatus, device, and storage medium.

[0004] According to one aspect of this disclosure, a time synchronization method is provided, applied to a source device that supports the Generalized Precision Time Protocol (GPTP), the method comprising:

[0005] Based on the correspondence between the virtual local area network (VLAN) and the target device, first data for the target device is obtained; wherein, the first data includes time synchronization data and the VLAN identifier corresponding to the target device;

[0006] The switching device transmits the time synchronization data to the target device based on the virtual LAN identifier.

[0007] According to another aspect of this disclosure, a time synchronization method is provided for use in a switching device, the method comprising:

[0008] First data is received from the source device based on the virtual LAN identifier; wherein, the first data includes time synchronization data and the virtual LAN identifier;

[0009] The time synchronization data is transmitted to the target device based on the virtual LAN identifier.

[0010] According to another aspect of this disclosure, a time synchronization device is provided for a source device that supports GPTP, the device comprising:

[0011] The acquisition module is used to acquire first data for the target device based on the correspondence between the virtual local area network and the target device; wherein, the first data includes time synchronization data and the virtual local area network identifier corresponding to the target device;

[0012] The sending module is used to transmit the time synchronization data to the target device through the switching device based on the virtual LAN identifier.

[0013] According to another aspect of this disclosure, a time synchronization device is provided for use in a switching device, the device comprising:

[0014] The receiving module is configured to receive first data from the source device based on the virtual LAN identifier; wherein the first data includes time synchronization data and the virtual LAN identifier;

[0015] The pass-through module is used to pass-through the time synchronization data to the target device based on the virtual LAN identifier.

[0016] According to another aspect of this disclosure, an electronic device is provided, comprising:

[0017] At least one processor; and

[0018] The memory is communicatively connected to the at least one processor; wherein,

[0019] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the methods described in the present disclosure.

[0020] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of this disclosure.

[0021] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the methods according to embodiments of this disclosure.

[0022] According to this disclosure, the source device can transmit time synchronization data from the source device to the target device through the switching device based on the virtual LAN identifier, thereby enabling GPTP time synchronization between the source device and the target device.

[0023] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0024] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0025] Figure 1 This is a schematic diagram of an exemplary GPTP network structure;

[0026] Figure 2 This is a flowchart illustrating a time synchronization method according to an embodiment of the present disclosure;

[0027] Figure 3 This is a schematic diagram of the time synchronization system according to this disclosure;

[0028] Figure 4 This is a flowchart illustrating a time synchronization method according to another embodiment of the present disclosure;

[0029] Figure 5 This is a flowchart illustrating a time synchronization method according to another embodiment of the present disclosure;

[0030] Figure 6 This is a flowchart illustrating a time synchronization method according to another embodiment of the present disclosure;

[0031] Figure 7 This is a flowchart illustrating a time synchronization method according to another embodiment of the present disclosure;

[0032] Figure 8 This is a schematic diagram of the network structure adopted according to this disclosure;

[0033] Figure 9 This is a schematic diagram of the structure of a time synchronization device according to an embodiment of the present disclosure;

[0034] Figure 10 This is a schematic diagram of the structure of a time synchronization device according to another embodiment of the present disclosure;

[0035] Figure 11 This is a schematic diagram of the structure of a time synchronization device according to an embodiment of the present disclosure;

[0036] Figure 12 This is a schematic diagram of the structure of a time synchronization device according to another embodiment of the present disclosure;

[0037] Figure 13 This is a block diagram of an electronic device used to implement embodiments of the present disclosure. Detailed Implementation

[0038] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0039] In systems such as autonomous driving, GPTP can be used to achieve time synchronization of sensors. However, if the system does not support GPTP, some sensors may not be able to connect and function properly. For example, some autonomous driving domain controllers do not support GPTP. Therefore, sensors connected to such autonomous driving domain controllers need to use Precision Time Protocol (PTP) to achieve time synchronization. The development trend of sensors is towards GPTP, and some newer sensors no longer support PTP synchronization.

[0040] GPTP is a generalized precision time protocol, also known as the Universal Precision Time Protocol, defined by the IEEE 802.1AS standard. GPTP has the following characteristics:

[0041] 1. Communication uses the IEEE 802 Media Access Control (MAC) protocol for data units and addresses. Therefore, physical layer hardware support (e.g., MAC device support) is required in the network.

[0042] 2. GPTP messages can typically only be sent from one time-sensitive system to another. In other words, a GPTP domain is composed of time-sensitive systems, and non-time-sensitive systems generally cannot be used to transmit GPTP messages.

[0043] like Figure 1 The diagram shown illustrates the structure of an exemplary GPTP network, in which endstations and bridge nodes support GPTP. An end station may include the original grandmaster node and slave nodes.

[0044] exist Figure 1 In a GPTP network structure, GPTP transmission is point-to-point, meaning that protocol messages are sent from the original Grandmaster node and received by only one slave node. If multiple slave nodes need to synchronize their times, the interface of a bridge node is required for forwarding. The bridge node's interface first acts as a slave (marked as S) node to synchronize with the original Grandmaster (marked as M) node, and then initiates the functions of multiple subordinate master (marked as M on the bridge node) nodes to synchronize with the slave nodes attached to that bridge node.

[0045] Figure 1The bridge nodes need to support GPTP functionality. Bridge nodes can be switching chips (Layer 2 switches). If the switching chips in some system platforms do not support GPTP, GPTP functionality cannot be implemented. GPTP relies on hardware chip support for time synchronization, which is inflexible. To connect sensors using GPTP synchronization, the entire system must support the protocol, and some other equipment may need to be replaced, increasing costs. It is necessary to consider how the system can be compatible with devices that do not support GPTP synchronization.

[0046] Figure 2 This is a flowchart illustrating a time synchronization method according to an embodiment of the present disclosure. The method is applied to a source device that supports the Generalized Precision Time Protocol (GPTP). The method may include:

[0047] S201. Based on the mapping relationship between Virtual Local Area Network (VLAN) and target device, obtain the first data for the target device. This first data includes time synchronization data and the VLAN identifier corresponding to the target device.

[0048] S202. The time synchronization data is transmitted to the target device through the switching device based on the virtual LAN identifier.

[0049] In this embodiment, the source device may include a transmitting device, a master device, a master node, a terminal device, or a terminal station. For example, the source device may be a Grandmaster node supporting GPTP. The switching device may include a switch, a bridge node, etc. The target device may include a receiving device, a slave device, a slave node, a terminal device, or a terminal station. For example, the target device may be a slave node supporting GPTP. The source device may send time synchronization data, such as GPTP data, to achieve time synchronization. The source device may store the mapping relationship between the virtual local area network (VLAN) and the target device. If the source device sends data to the target device through a switching device, the VLAN may include the source device, the switching device, and the target device. If the source device sends data to the target device through multiple switching devices, the VLAN may include the source device, the multiple switching devices, and the target device.

[0050] In this embodiment of the disclosure, a Virtual Local Area Network (VLAN) can be understood as a virtual channel. Correspondingly, a VLAN identifier can be understood as a virtual channel identifier. The correspondence between a VLAN and a target device can be understood as the correspondence between a virtual channel and a target device. If a source device synchronizes time with multiple target devices, a virtual channel can be established for each target device in the source device. Time synchronization data can be transparently transmitted to the target device corresponding to the virtual channel through the virtual channel. For example, a source device, such as a vehicle controller, can send first data to a switching device. In the switching device, time synchronization data, such as GPTP data and a VLAN identifier, can be obtained from the first data. In the switching device, time synchronization processing of the time synchronization data, such as GPTP data, can be omitted (e.g., no time synchronization is performed). Figure 1 Instead of using the GPTP function of the middle bridge node, it transmits the time synchronization data to the target device based on the virtual LAN identifier, thereby achieving time synchronization on the target device.

[0051] For example, such as Figure 3 As shown, a system includes source device M, switching devices B1 and B2, destination devices S1, S2, and S3. This system includes three virtual local area networks (VLANs): VLAN 1, VLAN 2, and VLAN 3. VLANs 1, 2, and 3 are VLAN identifiers. VLAN 1 corresponds to switching device B1, and its destination device is S1; VLAN 2 corresponds to switching devices B1 and B2, and its destination device is S2; VLAN 3 corresponds to switching devices B1 and B2, and its destination device is S3.

[0052] A source device can transmit time synchronization data to a target device through a switching device. For example, if source device M and target device S1 need to synchronize their time, source device M can send a data packet to switching device B1 based on VLAN 1. This data packet may include time synchronization data and VLAN 1. After receiving the data packet, switching device B1 transmits the time synchronization data to S1 according to VLAN 1.

[0053] A source device can transmit time synchronization data to a target device through multiple switching devices. For example, if source device M and target device S2 need to synchronize their time, source device M can send a data packet to switch B1 based on VLAN 2. This data packet may include time synchronization data and VLAN 2. After receiving the data packet, switch B1 can send the data packet to switch B2 based on VLAN 2. After receiving the data packet, switch B2 can transmit the time synchronization data in the data packet to target device S2 based on VLAN 2.

[0054] In one example, if the source and target devices support GPTP, but the switching device does not, the time synchronization method of this disclosure can still achieve GPTP time synchronization between the source and target devices. This is because the switching device of this disclosure can be used only for forwarding time synchronization data without performing GPTP functions. Therefore, the switching device can transparently transmit GPTP data between the source and target devices, thereby enabling GPTP time synchronization between the source and target devices.

[0055] According to embodiments of this disclosure, a source device can transmit time synchronization data from the source device to a target device via a switching device based on a virtual LAN identifier, enabling GPTP time synchronization between the source and target devices. When the hardware cannot support the GPTP protocol, GPTP synchronization can be implemented through software. For example, if the hardware, such as the switching device, only supports the PTP protocol and not GPTP, the switching device can transmit GPTP time synchronization data via software, achieving GPTP time synchronization between the source and target devices. This improves the compatibility of systems with hardware that supports GPTP time synchronization and saves costs associated with hardware modifications. Furthermore, if the switching device supports GPTP, its GPTP function can be temporarily disabled to execute the solution of this disclosure.

[0056] Figure 4 This is a flowchart illustrating a time synchronization method according to another embodiment of the present disclosure. The method may include one or more features of the time synchronization method described in the above embodiment. In one implementation, step S201 involves obtaining first data for the target device based on the correspondence between the virtual local area network and the target device, including:

[0057] S401. In the correspondence between the virtual LAN and the target device, find the virtual LAN identifier corresponding to the target device;

[0058] S402, Combine the virtual LAN identifier with the time synchronization data to form the first data.

[0059] In this embodiment of the disclosure, if a source device needs to send time synchronization data to a target device, it can look up the VLAN identifier corresponding to the target device in the VLAN-to-target device mapping stored in the source device. If multiple VLAN (virtual channel)-to-target device mappings are stored in a source device, a source device can achieve GPTP time synchronization with multiple target devices through VLANs (virtual channels). In some examples, the target device can be a MAC device. The VLAN-to-target device mapping can include the mapping between the VLAN identifier and the MAC address or device identifier of the target device. Independent dialogues can be established for different target devices through the VLAN-to-target device mapping. For example, an independent dialogue can use the MAC address as the dialogue identifier, or other information can be used as the dialogue identifier. For example, the source device stores dialogue D1 for target device S1 and dialogue D2 for target device S2. Dialogue D1 can include the mapping between VLAN 1 and target device S1. Dialogue D2 can include the mapping between VLAN 2 and target device S2.

[0060] In this embodiment, the mapping between virtual LANs and target devices can be stored in the configuration of the source device. If the source device needs to send time synchronization data to a target device, it can find the corresponding virtual LAN identifier for the target device from the mapping between virtual LANs and target devices in the source device's configuration. Then, the time synchronization data to be sent can be combined with the virtual LAN identifier to form a data packet to be sent. For example, the mapping between VLAN1 and S1, VLAN2 and S2, and VLAN3 and S3 are stored in the configuration of M. If M needs to perform time synchronization with S1, the time synchronization data can be combined with VLAN1 into a data packet for transmission. This data packet may also include other information required to implement GPTP functionality.

[0061] According to embodiments of this disclosure, a first data to be transmitted can be combined by a virtual local area network (VLAN) identifier between a source device and a target device that need to be synchronized in time. After the first data is sent to a switching device, the switching device can perform transparent transmission based on the VLAN identifier in the first data.

[0062] Figure 5 This is a flowchart illustrating a time synchronization method according to another embodiment of the present disclosure, which may include one or more features of the time synchronization method described in the above embodiments. In one embodiment, the method further includes:

[0063] S501, Broadcast second data, which includes a synchronization message and / or a follow-up message;

[0064] S502, Receive third data from the target device in response to the second data feedback;

[0065] S503. Based on the information of the target device in the third data, save the correspondence between the virtual local area network and the target device in the source device.

[0066] In this embodiment, the source device can first broadcast GPTP synchronization (Sync) messages, follow-up (Follow-up) messages, etc., through a switching device. Based on these synchronization and / or follow-up messages, a virtual channel corresponding to the target device can be established. Alternatively, based on these synchronization and / or follow-up messages, the source device can store the correspondence between the virtual local area network (virtual channel) and the target device. A switching device can be connected to the source device via a physical link, and can also be connected to the target device or another switching device via a physical link. After forwarding the second data to various target devices via one or more switching devices, the target devices can send third data back to the source device based on the second data passing through these one or more switching devices. The third data may include device information such as the target device's MAC address, and may also include information about the virtual channel through which the target device's data passed, such as a virtual local area network (VLAN) identifier.

[0067] By broadcasting second data, information about different target devices can be obtained, and the corresponding virtual local area networks (VLANs) can be determined. This allows for the rapid and accurate establishment of the correspondence between VLANs and target devices, providing support for subsequent time synchronization.

[0068] In one implementation, the third data includes the MAC address of the target device, and the mapping relationship between the virtual local area network (VLAN) and the target device includes the mapping relationship between the VLAN identifier and the MAC address of the target device.

[0069] For example, switch B1 connects source device and destination device S1. If the source device sends second data to destination device S1 through switch B1, destination device S1 can send third data to the source device via switch B1. This third data may include the MAC address of destination device S1 and VLAN ID (VLAN 1), which switch B1 can resolve. The source device can store the mapping between VLAN ID 1 and the MAC address of destination device S1. Subsequently, if the source device needs to perform GPTP time synchronization with destination device S1, it can transparently transmit GPTP data to destination device S1 via switch B1 based on VLAN ID 1.

[0070] A MAC address is the physical address of a device. By identifying the MAC address of the target device through a virtual LAN identifier, the mapping between the virtual LAN and the target device can be accurately established, facilitating subsequent fast and accurate time synchronization.

[0071] In one implementation, the virtual LAN identifier is used to indicate the receive port and transmit port of the virtual LAN in the switching device.

[0072] In this embodiment of the disclosure, the virtual LAN identifier may also have a corresponding switching device, for example, by storing the correspondence between the virtual LAN identifier, the switching device, and the target device in the source device. The source device can locate the corresponding switching device based on the virtual LAN identifier. After the source device sends the first data to the receiving port of the switching device, the switching device can locate the sending port connected to the target device based on the virtual LAN identifier. Then, the switching device can forward the time synchronization data in the first data to the target device from the sending port.

[0073] According to embodiments of this disclosure, a virtual local area network (VLAN) can be formed through ports in a switching device, thereby enabling time synchronization by transparently transmitting data within the VLAN through the ports in the switching device.

[0074] In one implementation, the virtual local area network (VLAN) identifier corresponding to the target device is used to indicate the receive port and transmit port of the VLAN corresponding to the target device in the switching device.

[0075] In this embodiment of the disclosure, if a virtual local area network (VLAN) is a virtual channel, the VLAN identifier is a virtual channel identifier. The virtual channel identifier can indicate the receive port and transmit port of the virtual channel corresponding to the target device in the switching device. If the source device transmits data to the target device through a switching device, the VLAN identifier or virtual channel identifier can indicate the receive port and transmit port required for transmitting data in that switching device. If the source device transmits data to the target device through multiple switching devices, it can indicate the respective receive port and transmit port required for transmitting data in the multiple target devices.

[0076] For example, interface 1 of switch B1 connects to a source device, and interface 2 of switch B1, belonging to the same VLAN as interface 1, connects to a target device S1. If the source device sends second data from interface 1 to switch B1, and switch B1 then sends the second data from interface 2 to target device S1, target device S1 can send third data to the source device via interfaces 2 and 1 of switch B1. This third data may include the MAC address of target device S1 and the Virtual LAN Identifier (VLAN 1) used to indicate interfaces 2 and 1 of switch B1. The source device can store the mapping between VLAN 1 and the MAC address of target device S1. Subsequently, if the source device needs to perform GPTP time synchronization with target device S1, it can transparently transmit GPTP data to target device S1 via interfaces 1 and 2 of switch B1 based on VLAN 1.

[0077] For example, interface 3 of switch B1 is connected to the source device. Interface 4 of switch B1, belonging to the same VLAN as interface 3, is connected to interface 5 of another switch B2. Interface 6 of switch B2, belonging to the same VLAN as interface 5, is connected to the target device S2. If the source device sends second data from interface 3 to switch B1, then switch B1 sends the second data from interface 4 to interface 5 of switch B2. Switch B2 can then continue sending second data from interface 6 to the target device S2. The target device S2 can then send third data to the source device sequentially through interfaces 6, 5, 4, and 3. This third data may include the MAC address of the target device S2, and may also include the Virtual LAN Identifier (VLAN 2) for indicating interfaces 3 and 4 of switch B1, and interfaces 5 and 6 of switch B2. The source device can store the mapping between VLAN 2 and the MAC address of the target device S2. Subsequently, if the source device needs to perform GPTP time synchronization with the target device S2, it can transmit GPTP data to the target device S2 based on the virtual LAN identifier VLAN2, through interfaces 3 and 4 of switch B1, and interfaces 5 and 6 of switch B2.

[0078] According to embodiments of this disclosure, a virtual local area network (VLAN) identifier can be used to indicate the ports to be used in a switching device, thereby forwarding data within the VLAN through the ports in the switching device to achieve time synchronization between the source device and the target device.

[0079] Figure 6 This is a flowchart illustrating a time synchronization method according to another embodiment of the present disclosure, which is applied to a switching device. The method may include:

[0080] S601. Receive first data from the source device based on the virtual LAN identifier. This first data includes time synchronization data and the virtual LAN identifier.

[0081] S602. Transmit the time synchronization data to the target device based on the virtual LAN identifier.

[0082] In this embodiment of the present disclosure, after receiving the first data, the switching device can parse out the time synchronization information and the virtual LAN identifier. Based on the virtual LAN identifier, after determining the sending interface and other information corresponding to the target device, the switching device can send the time synchronization data to the target device through that interface. For example, if time synchronization is required between the source device M and the target device S1, after receiving the data packet from M, the switching device B1 parses out the time synchronization data and VLAN 1. B1 can determine interface 1 based on VLAN 1 and transmit the time synchronization data, such as a GPTP message, to the target device S1 through interface 1.

[0083] According to embodiments of this disclosure, the switching device can transparently transmit time synchronization data from the source device to the target device based on the virtual LAN identifier, thereby achieving GPTP time synchronization between the source and target devices. For example, even if the switching device only supports PTP and does not support GPTP, it can still achieve GPTP time synchronization between the source and target devices by transparently transmitting GPTP time synchronization data, improving the compatibility of systems with some hardware supporting GPTP time synchronization and saving costs associated with hardware upgrades.

[0084] In one implementation, the virtual LAN identifier is used to indicate the receive port and transmit port of the virtual LAN identifier in the switching device.

[0085] In one implementation, S601 receiving first data from the source device based on the virtual LAN identifier may include: receiving the first data from the source device using the receiving port indicated by the virtual LAN identifier.

[0086] In one implementation, S602, which transmits the time synchronization data to the target device based on the virtual LAN identifier, may include: transmitting the time synchronization data to the target device using the sending port indicated by the virtual LAN identifier.

[0087] In this embodiment of the disclosure, the switching device may include multiple interfaces. If an interface is used to receive data, it may be referred to as a receiving port. If an interface is used to send data, it may be referred to as a sending interface. The switching device may support multiple virtual local area networks (VLANs). A VLAN may include at least two interfaces of the switching device, wherein at least one interface is a receiving port and at least one interface is a sending port. After the switching device parses the first data to obtain the VLAN identifier, it can further obtain information such as the port number of the receiving port and / or sending port corresponding to the VLAN identifier. For example, the receiving port is the port connecting the switching device and the source device, and the sending port is the port connecting the switching device and the target device or other switching devices.

[0088] For example, switching device B1 receives first data from the source device through a receive port 1, and parses the first data to obtain the corresponding send port 2 based on the VLAN identifier in the receive port 1. Time synchronization data from the first data is then transparently transmitted from the send port 2 of switching device B1 to the target device.

[0089] For example, switch B1 receives first data from a source device through a receiving port 3, and parses the first data to obtain the corresponding sending port 4 based on the VLAN identifier within it. Sending port 4 is connected to the receiving port 5 of another switch B3, allowing the switch to send the first data from sending port 4 to receiving port 5 of switch B3. Switch B3 obtains the corresponding sending port 6 based on the VLAN identifier in the first data, and sending port 6 is connected to the target device S2. Time synchronization data from the first data is then transparently transmitted from sending port 6 of switch B2 to the target device S2.

[0090] According to embodiments of this disclosure, time synchronization data between a source device and a target device can be transparently transmitted through ports in one or more switching devices via a virtual local area network (VLAN), thereby achieving time synchronization between the source and target devices. In this case, even if the switching device does not support GPTP, GPTP functionality between the source and target devices can still be achieved.

[0091] Figure 7 This is a flowchart illustrating a time synchronization method according to another embodiment of the present disclosure, which may include one or more features of the time synchronization method described in the above embodiments. In one embodiment, the method further includes:

[0092] S701. Store the information of the virtual local area network (VLAN) in the switching device. The VLAN information includes the VLAN identifier, as well as the receiving port and transmitting port of the VLAN in the switching device.

[0093] In this embodiment of the disclosure, virtual local area network (VLAN) information can be pre-configured in the switching device. For example, the port information included in the VLAN can be pre-configured according to the actual physical links. If the data received by the switching device subsequently includes a VLAN identifier, the data forwarding path can be determined based on the port information corresponding to that VLAN identifier. For example, VLAN 1 is pre-configured in the switching device, including port 1 and port 2. If data is received from port 1, it can be forwarded from port 2. If data is received from port 2, it can be forwarded from port 1.

[0094] According to embodiments of this disclosure, the ports to be used in a switching device can be determined by a virtual local area network (VLAN) identifier. The switching device uses VLAN information to transmit time synchronization data, thereby achieving time synchronization between the source device and the target device.

[0095] In one implementation, the virtual local area network (VLAN) identifier corresponding to the target device is used to indicate the receive port and transmit port of the VLAN corresponding to the target device in the switching device.

[0096] For example, in a switching device, VLAN 1 can be pre-defined based on the physical link, including port 1 and port 2. Port 1 connects to the source device, and port 2 connects to the destination device S1. If switching device B1 receives a packet through port 1, then port 1 is the receiving port. B1 can then send data to the destination device S1 through port 2, which is the sending port.

[0097] According to embodiments of this disclosure, a virtual local area network (VLAN) can be formed through ports in a switching device, thereby forwarding data within the VLAN through the ports in the switching device.

[0098] In one application scenario, a software-based master device, such as a Grandmaster node, can be implemented to support synchronization with multiple slave devices, such as slave nodes. A network isolation mechanism can be implemented on the bridge node to prevent communication between all slave devices. From the perspective of a slave device, such as a sensor, it still appears to be a one-to-one communication method.

[0099] like Figure 8 The diagram shown is a schematic of the network structure used in an embodiment of this disclosure.

[0100] In this GPTP network architecture, a bridge node can be a switching device, which is connected to the master device, such as the original grandmaster node, via a physical link. Based on this, a virtual channel is created between each slave node and the master node, dedicated to GPTP transmission. Specific functionalities need to be implemented on both the master and slave nodes.

[0101] On the master node, the GPTP service is started in the Linux operating system. The GPTP service creates an independent session for each slave node it communicates with, using the slave node's MAC address as an identifier. For example, the master node stores the VLAN identifier corresponding to the slave node's MAC address. When the GPTP service sends data to a slave node, it adds that slave node's VLAN identifier to the data packet, making it easier for the bridge node to distinguish between sessions.

[0102] In bridge nodes, the hierarchical master and slave nodes are eliminated. Instead, the bridge node directly forwards GPTP data. That is, unlike standard Time-Sensitive Network (TSN) processes, GPTP data at the bridge node is not involved in time synchronization; it is directly forwarded to the target node. GPTP data from different target nodes can be considered "parallel." The bridge node uses VLAN identifiers in the data packets to map GPTP data from different target nodes to different VLAN networks, achieving direct data isolation.

[0103] The time synchronization method of this disclosure can implement GPTP protocol synchronization in software when the hardware cannot support it. Therefore, it can improve hardware compatibility and reduce the cost of upgrading hardware.

[0104] Figure 9 This is a schematic diagram of a time synchronization device according to an embodiment of the present disclosure. The device is applied to a source device that supports the Generalized Precision Time Protocol (GPTP). The device may include:

[0105] The acquisition module 901 is used to acquire first data for the target device based on the correspondence between the virtual local area network and the target device; wherein, the first data includes time synchronization data and the virtual local area network identifier corresponding to the target device;

[0106] The sending module 902 is used to transmit the time synchronization data to the target device through the switching device based on the virtual LAN identifier.

[0107] Figure 10 This is a schematic diagram of a time synchronization device according to another embodiment of the present disclosure. The device may include one or more features of the time synchronization device of the above embodiments. In one embodiment, the acquisition module 901 includes:

[0108] The lookup submodule 1001 is used to look up the virtual local area network identifier corresponding to the target device in the correspondence between the virtual local area network and the target device.

[0109] The combination submodule 1002 is used to combine the virtual LAN identifier with the time synchronization data into the first data.

[0110] In one implementation, such as Figure 10 As shown, the device also includes:

[0111] Broadcast module 1003 is used to broadcast second data, which includes synchronization messages and / or follow-up messages;

[0112] The receiving module 1004 is used to receive third data from the target device in response to the second data feedback;

[0113] The storage module 1005 is used to store the correspondence between the virtual local area network and the target device in the source device based on the information of the target device in the third data.

[0114] In one implementation, the third data includes the MAC address of the target device, and the mapping relationship between the virtual local area network (VLAN) and the target device includes the mapping relationship between the VLAN identifier and the MAC address of the target device.

[0115] In one implementation, the virtual LAN identifier is used to indicate the receive port and transmit port of the virtual LAN in the switching device.

[0116] In one implementation, the virtual local area network (VLAN) identifier corresponding to the target device is used to indicate the receive port and transmit port of the VLAN corresponding to the target device in the switching device.

[0117] Figure 11 This is a schematic diagram of a time synchronization device according to an embodiment of the present disclosure. The device is applied to a switching device. The device may include:

[0118] The receiving module 1101 is configured to receive first data from the source device based on the virtual local area network identifier; wherein the first data includes time synchronization data and the virtual local area network identifier;

[0119] The transparent transmission module 1102 is used to transmit the time synchronization data to the target device according to the virtual LAN identifier.

[0120] In one implementation, the virtual LAN identifier is used to indicate the receive port and transmit port of the virtual LAN identifier in the switching device;

[0121] The receiving module 1101 is also used to receive first data from the source device using the receiving port indicated by the virtual LAN identifier;

[0122] The transparent transmission module 1102 is also used to transmit the time synchronization data to the target device through the sending port indicated by the virtual LAN identifier.

[0123] Figure 12 This is a schematic diagram of a time synchronization device according to another embodiment of the present disclosure. The device may include one or more features of the time synchronization device of the above embodiments. In one embodiment, the device further includes:

[0124] The storage module 1201 is used to store information about a virtual local area network (VLAN) in the switching device. The information about the VLAN includes the VLAN identifier, as well as the receiving port and sending port of the VLAN in the switching device.

[0125] In one implementation, the virtual local area network (VLAN) identifier corresponding to the target device is used to indicate the receive port and transmit port of the VLAN corresponding to the target device in the switching device.

[0126] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.

[0127] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0128] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0129] Figure 13 A schematic block diagram of an example electronic device 1300 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0130] like Figure 13As shown, device 1300 includes a computing unit 1301, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1302 or a computer program loaded from storage unit 1308 into random access memory (RAM) 1303. The RAM 1303 may also store various programs and data required for the operation of device 1300. The computing unit 1301, ROM 1302, and RAM 1303 are interconnected via bus 1304. Input / output (I / O) interface 1305 is also connected to bus 1304.

[0131] Multiple components in device 1300 are connected to I / O interface 1305, including: input unit 1306, such as keyboard, mouse, etc.; output unit 1307, such as various types of monitors, speakers, etc.; storage unit 1308, such as disk, optical disk, etc.; and communication unit 1309, such as network card, modem, wireless transceiver, etc. Communication unit 1309 allows device 1300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0132] The computing unit 1301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1301 performs the various methods and processes described above, such as time synchronization methods. For example, in some embodiments, the time synchronization method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1308. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1300 via ROM 1302 and / or communication unit 1309. When the computer program is loaded into RAM 1303 and executed by the computing unit 1301, one or more steps of the time synchronization method described above may be performed. Alternatively, in other embodiments, the computing unit 1301 may be configured to perform the time synchronization method by any other suitable means (e.g., by means of firmware).

[0133] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0134] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0135] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0136] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0137] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0138] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0139] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0140] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A time synchronization method applied to a source device, said source device supporting the Generalized Precision Time Protocol (GPTP), said method comprising: Based on the correspondence between the virtual local area network (VLAN) and the target device, first data for the target device is obtained; wherein, the first data includes time synchronization data and the VLAN identifier corresponding to the target device; The time synchronization data is transmitted to the target device through the switching device according to the virtual LAN identifier; The method further includes: Broadcast second data, which includes synchronization messages and / or follow-up messages; Receive third data from the target device in response to the second data feedback; Based on the target device information in the third data, the correspondence between the virtual local area network and the target device is stored in the source device.

2. The method according to claim 1, wherein, Based on the mapping relationship between virtual local area networks and target devices, first data for the target device is obtained, including: In the correspondence between the virtual local area network and the target device, find the virtual local area network identifier corresponding to the target device; The virtual local area network identifier is combined with the time synchronization data to form the first data.

3. The method according to claim 2, wherein, The third data includes the Media Access Control (MAC) address of the target device, and the correspondence between the virtual local area network (VLAN) and the target device includes the correspondence between the VLAN identifier and the MAC address of the target device.

4. The method according to any one of claims 1 to 3, wherein, The virtual LAN identifier is used to indicate the receive port and transmit port of the virtual LAN in the switching device.

5. The method according to claim 4, wherein, The virtual local area network (VLAN) identifier corresponding to the target device is used to indicate the receive port and transmit port of the VLAN corresponding to the target device in the switching device.

6. A time synchronization method applied to a switching device, the method comprising: First data is received from the source device based on the virtual LAN identifier; wherein, the first data includes time synchronization data and the virtual LAN identifier; Transmit the time synchronization data to the target device according to the virtual LAN identifier; The method further includes: The switching device stores information about the virtual local area network (VLAN), including the VLAN identifier and the VLAN's receiving and transmitting ports within the switching device.

7. The method according to claim 6, wherein, The virtual local area network (VLAN) identifier is used to indicate the receiving port and transmitting port of the VLAN identifier in the switching device; Receiving first data from the source device according to the virtual LAN identifier includes: receiving the first data from the source device using the receiving port indicated by the virtual LAN identifier; Transmitting the time synchronization data to the target device according to the virtual LAN identifier includes: transmitting the time synchronization data to the target device using the sending port indicated by the virtual LAN identifier.

8. The method according to claim 7, wherein, The virtual local area network (VLAN) identifier corresponding to the target device is used to indicate the receive port and transmit port of the VLAN corresponding to the target device in the switching device.

9. A time synchronization device applied to a source device, the source device supporting GPTP, the device comprising: The acquisition module is used to acquire first data for the target device based on the correspondence between the virtual local area network and the target device; wherein, the first data includes time synchronization data and the virtual local area network identifier corresponding to the target device; The sending module is used to transmit the time synchronization data to the target device through the switching device according to the virtual local area network identifier; The broadcast module is used to broadcast second data, which includes synchronization messages and / or follow-up messages; A receiving module is used to receive third data from the target device in response to the second data feedback; The storage module is used to store the correspondence between the virtual local area network and the target device in the source device based on the information of the target device in the third data.

10. The apparatus according to claim 9, wherein, The acquisition module includes: The lookup submodule is used to search for the virtual local area network (VLAN) identifier corresponding to the target device in the correspondence between the VLAN and the target device. The combination submodule is used to combine the virtual LAN identifier and the time synchronization data into the first data.

11. The apparatus according to claim 10, wherein, The third data includes the MAC address of the target device, and the correspondence between the virtual local area network (VLAN) and the target device includes the correspondence between the VLAN identifier and the MAC address of the target device.

12. The apparatus according to any one of claims 9 to 11, wherein, The virtual LAN identifier is used to indicate the receive port and transmit port of the virtual LAN in the switching device.

13. The apparatus according to claim 12, wherein, The virtual local area network (VLAN) identifier corresponding to the target device is used to indicate the receive port and transmit port of the VLAN corresponding to the target device in the switching device.

14. A time synchronization device, applied to a switching device, the device comprising: The receiving module is configured to receive first data from the source device based on the virtual local area network (VLAN) identifier; wherein the first data includes time synchronization data and the VLAN identifier; The pass-through module is used to pass through the time synchronization data to the target device according to the virtual local area network identifier; A storage module is used to store information about a virtual local area network (VLAN) in the switching device. The VLAN information includes the VLAN identifier, as well as the VLAN's receiving port and transmitting port in the switching device.

15. The apparatus according to claim 14, wherein, The virtual local area network (VLAN) identifier is used to indicate the receiving port and transmitting port of the VLAN identifier in the switching device; The receiving module is also used to receive first data from the source device using the receiving port indicated by the virtual local area network identifier; The transparent transmission module is also used to transmit the time synchronization data to the target device through the sending port indicated by the virtual local area network identifier.

16. The apparatus according to claim 15, wherein, The virtual local area network (VLAN) identifier corresponding to the target device is used to indicate the receive port and transmit port of the VLAN corresponding to the target device in the switching device.

17. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.

18. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-8.

19. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Time synchronization method, electronic equipment and storage medium

    CN113038590A

  • Time synchronization method and system for cross-terminal communication, control device and medium

    CN115623580A