WO2023030525A1 - 时间同步方法、装置、电子设备和存储介质 - Google Patents

时间同步方法、装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2023030525A1
WO2023030525A1 PCT/CN2022/117111 CN2022117111W WO2023030525A1 WO 2023030525 A1 WO2023030525 A1 WO 2023030525A1 CN 2022117111 W CN2022117111 W CN 2022117111W WO 2023030525 A1 WO2023030525 A1 WO 2023030525A1
Authority
WO
WIPO (PCT)
Prior art keywords
time synchronization
clock
mode
information
control instruction
Prior art date
Application number
PCT/CN2022/117111
Other languages
English (en)
French (fr)
Inventor
杨少东
Original Assignee
北京车和家信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京车和家信息技术有限公司 filed Critical 北京车和家信息技术有限公司
Publication of WO2023030525A1 publication Critical patent/WO2023030525A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/12Synchronisation of different clock signals provided by a plurality of clock generators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/08Clock generators with changeable or programmable clock frequency
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0004Initialisation of the receiver
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Definitions

  • the present disclosure relates to the technical field of data processing, and in particular to a time synchronization method, device, electronic equipment, storage medium, computer program product and computer program.
  • the intelligent control of vehicles is widely used.
  • the time of the vehicle terminal may be inaccurate due to various emergencies, or the time of each device controlled by the terminal is different.
  • the vehicle terminal is powered off
  • the time of the vehicle terminal may be wrong, resulting in multiple electronic devices that the terminal cannot accurately control. Therefore, it is necessary to synchronize the time of the vehicle in order to realize the vehicle accurate control.
  • the present disclosure provides a time synchronization method, device, electronic equipment, storage medium, computer program product and computer program, which can perform time synchronization quickly and accurately without costly A lot of time, high processing efficiency.
  • an embodiment of the present disclosure provides a time synchronization method, including:
  • Target information includes preset mode information
  • a first control instruction is generated, where the first control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the first synchronization clock.
  • determining the target mode according to the preset mode information includes:
  • the target mode is the second mode, and the multiple devices include devices waiting for time synchronization.
  • determining the first synchronous clock as a clock source includes:
  • the first synchronous clock as the clock source is determined through the master clock algorithm.
  • the multiple devices further include a host, and in the target mode, determining a first synchronous clock as a clock source includes:
  • the time synchronization method also includes:
  • a second control instruction is generated, and the second control instruction is used to control the device waiting for time synchronization and the device sending the data packet to perform time synchronization according to the second synchronization clock.
  • the time synchronization method also includes:
  • the target mode being the second mode
  • the time of the device sending the data message is obtained, and the time is determined as the second synchronous clock
  • a second control instruction is generated, and the second control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the second synchronization clock.
  • the time synchronization method also includes:
  • the first synchronization clock is used as the second synchronization clock
  • a second control instruction is generated, and the second control instruction is used to control the device sending the data packet to perform time synchronization according to the second synchronization clock.
  • the first control instruction is generated, and the first control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the first synchronization clock, including:
  • the time synchronization method also includes:
  • an embodiment of the present disclosure provides a time synchronization device, including:
  • an acquisition unit configured to acquire target information, where the target information includes preset mode information
  • a first determining unit configured to determine a target mode according to the preset mode information
  • the second determination unit is configured to determine the first synchronous clock as a clock source in the target mode
  • the generation unit is configured to generate a first control instruction, and the first control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the first synchronization clock.
  • an electronic device including:
  • the computer program is stored in the memory and is configured to be executed by the processor to implement the above-mentioned time synchronization method.
  • an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned time synchronization method are implemented.
  • an embodiment of the present disclosure provides a computer program product, the computer program product includes computer program code, and when the computer program code is run on a computer, the time synchronization method described in the first aspect is executed .
  • an embodiment of the present disclosure further provides a computer program, the computer program includes computer program code, and when the computer program code is run on a computer, the computer executes the time synchronization method described in the first aspect .
  • Embodiments of the present disclosure provide a time synchronization method, device, electronic equipment, storage medium, computer program product, and computer program.
  • the time synchronization method includes: obtaining target information, the target information includes preset mode information, and then according to the preset mode information, determining the target mode to be time synchronized, in the target mode, determining the first synchronous clock as a clock source, generating the The first control instruction of the first synchronization clock, the first control instruction is used to control the equipment waiting for time synchronization to perform time synchronization according to the first synchronization clock, that is, different time synchronization methods are adopted according to the target mode, and different target modes can be applied to Different application scenarios, such as those suitable for standard time synchronization methods or for the automotive field, have better compatibility, and do not need to wait for steps to perform time synchronization quickly and accurately without spending a lot of time and processing efficient.
  • FIG. 1 is a schematic flowchart of a time synchronization method provided by an embodiment of the present disclosure
  • FIG. 2 is a schematic structural diagram of time synchronization provided by an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of a time synchronization method provided by an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart of a time synchronization method provided by an embodiment of the present disclosure
  • FIG. 5 is a schematic flowchart of a time synchronization method provided by an embodiment of the present disclosure
  • FIG. 6 is a schematic flowchart of a time synchronization method provided by an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a time synchronization device provided by an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • a standard time synchronization system based on a time-sensitive network protocol needs to go through four steps: waiting for a message, determining the master clock, waiting for time synchronization, and performing time synchronization according to the master clock. Waiting for time to synchronize the two steps will take a lot of time and the processing efficiency is low; secondly, the automotive field does not support running the best master clock algorithm (Best Master Clock Algorithm, BMCA), which is used to determine the master clock, that is, The step of determining the master clock is not supported.
  • BMCA Best Master Clock Algorithm
  • the devices in the vehicle have been configured to assume corresponding functions.
  • the device can be configured as a master or slave in advance, and the time of the master is usually used as the master clock.
  • the time synchronization system of the standard time-sensitive network protocol is not applicable in the automotive field. Therefore, when performing time synchronization in the automotive field, you only need to wait for time synchronization and according to The main clock performs two steps of time synchronization. Although there is no need to wait for the message and the steps of determining the main clock, it still needs to wait for time synchronization, which will consume a lot of time.
  • the standard time synchronization system is not applicable in the automotive field, and the time synchronization system built in the automotive field cannot realize the standard time synchronization system. Therefore, different time synchronization systems need to be built in different application scenarios, which is likely to cause waste of resources.
  • the embodiment of the present disclosure provides a time synchronization method.
  • the target information includes preset mode information, and then according to the preset mode information, the target mode is determined, and in the target mode, it is determined as the clock source
  • the first synchronization clock, and finally the device waiting for time synchronization performs time synchronization according to the first synchronization clock, that is, adopts different time synchronization methods according to different preset modes, which can quickly and accurately perform time synchronization, and the processing speed is relatively fast.
  • One of the preset modes supports the execution of standard time synchronization methods, and the other preset mode supports the execution of time synchronization methods in the automotive field, so that a time synchronization method can be applied to a variety of application scenarios, supporting both standard time synchronization systems and Compatible with the time synchronization system in the automotive field, and the processing speed is relatively fast, the processing efficiency is high, and it does not need to consume a lot of time.
  • a time synchronization method provided by an embodiment of the present disclosure will be described in detail by using one or more of the following embodiments.
  • FIG. 1 is a schematic flowchart of a time synchronization method provided by an embodiment of the present disclosure, which can be applied to multiple devices waiting for time synchronization, specifically including the following steps S110 to S140 as shown in FIG. 1 :
  • the processor installed on the vehicle or other terminals acquires target information, and the target information includes preset mode information, and the target information can be information generated when the vehicle is configured in the processor in advance, or sent by other terminals Information for the processor; wherein, the preset mode information is information that is preset and can be directly obtained by the processor.
  • the target mode is determined according to the preset mode information in the target information, and the target mode is one of multiple preset modes, that is, the waiting time is determined The mode in which synchronized devices perform time synchronization.
  • the preset modes include a first mode and a second mode.
  • the target mode is the first mode or the second mode
  • the first mode can be understood as a preset message mode
  • the second mode can be understood as the preset role mode, which is to pre-configure multiple terminal devices in the vehicle as masters or slaves, suitable for In the automotive field, the time of the host computer is usually used as the main clock, so there is no need to determine the best clock, which further reduces the time for time synchronization.
  • the above two modes can reduce the time for time synchronization from more than 2 seconds to 100 milliseconds Within, the time required for time synchronization of devices is greatly reduced.
  • FIG. 2 is a schematic structural diagram of time synchronization provided by an embodiment of the present disclosure, including a processor 210, a terminal device 220, a terminal device 230, a terminal device 240, and a terminal device 250.
  • the processor 210 connects multiple terminal devices, and the multiple terminal devices include devices waiting for time synchronization.
  • the following descriptions of devices waiting for time synchronization can also be expressed as terminal devices.
  • the processor 210 obtains the target information, and determines the target mode according to the preset mode information in the target information, and based on the target mode being the second mode, that is, the preset role mode, then the configuration information of each terminal device in the preset mode information can be obtained For example, it is determined from the configuration information that the terminal device 220 is configured as a master, the terminal device 230, the terminal device 240 and the terminal device 250 are configured as slaves, and the time of the terminal device 220 is used as a clock source (master clock), and the terminal device 230, The terminal device 240 and the terminal device 250 perform time synchronization according to the clock source of the terminal device 220 . It can be understood that, in the second mode, the multiple terminal devices connected to the processor 210 include a master terminal device 220 and slave (device waiting for time synchronization) terminal devices 230 to 250 .
  • the first synchronous clock can be understood as The master clock and other terminal devices connected to the processor will perform time synchronization according to the first synchronization clock.
  • S140 Generate a first control instruction, where the first control instruction is used to control devices waiting for time synchronization to perform time synchronization according to the first synchronization clock.
  • the processor generates the first control instruction including the first synchronization time, and sends the first control instruction to multiple devices (terminal devices) waiting for time synchronization, and the first control instruction uses It is used to control the device that does not provide the first synchronous clock to perform time synchronization according to the first synchronous clock.
  • the processor 210 after determining in S130 that the time of the terminal device 220 is the first synchronous clock as the clock source, the processor 210 sends the first The control instruction is used to control the terminal device 230, the terminal device 240, and the terminal device 250 to perform time synchronization according to the first synchronization clock.
  • the target information includes preset mode information, and then according to the preset mode information, determine the target mode for time synchronization, and determine it as the clock source in the target mode
  • the first synchronous clock generates a first control instruction including the first synchronous clock.
  • the first control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the first synchronous clock, that is, to perform time synchronization according to the method corresponding to the target mode Synchronization, different target modes can be applied to different application scenarios, and there is no need for waiting steps, and time synchronization can be performed quickly and accurately without consuming a lot of time, and the processing efficiency is high.
  • FIG. 3 is a schematic flowchart of a time synchronization method provided by an embodiment of the present disclosure.
  • the target mode is determined according to the preset mode information, specifically including the method shown in FIG. 3 Steps S310 to S320 are as follows:
  • the target mode is the first mode
  • the first mode includes preset each
  • the message information corresponding to the terminal device can reduce the waiting time for the terminal device to send a message, and the terminal device can also be set to actively and periodically send a message to the processor, and the sending cycle is relatively short; the message information includes each waiting time The time information of the synchronized device.
  • determining the first synchronous clock as the clock source specifically includes: in the first mode, obtaining message information in the preset mode information; , using the master clock algorithm to determine the first synchronous clock as the clock source.
  • the processor does not need to wait for the terminal device to generate and send message, the message information in the preset mode information can be obtained directly.
  • the first synchronous clock that can be used as the clock source through the master clock algorithm.
  • the master clock algorithm can be the above-mentioned optimal clock algorithm, and the best The clock algorithm is to obtain accurate time according to the message information including time information corresponding to each terminal device, and use the time as the first simultaneous clock.
  • the master clock algorithm may also be other algorithms that can determine the clock source, which is not limited here.
  • the terminal devices with the same time may not perform time synchronization, except Other terminal devices other than the terminal device need to perform time synchronization according to the first synchronization clock.
  • the target mode is the second mode, that is, the target mode is the default role mode
  • the default role mode is that the terminal device is preferably configured as a host It is still a slave, which is mostly used in the automotive field.
  • the time of the master is determined as the first synchronous clock as the clock source.
  • multiple devices can also refer to the above-mentioned multiple
  • multiple devices include a device waiting for time synchronization and a host, that is, multiple devices include a device (slave) that needs time synchronization and a device (master) that provides a clock source.
  • determining the first synchronous clock as the clock source further includes: in the second mode, acquiring configuration information of multiple devices; according to the configuration Information, determine the host among the multiple devices; use the time of the host as the first synchronization clock.
  • the configuration information of multiple terminal devices in the preset mode information is obtained.
  • the configuration information indicates whether each terminal device is a master or a slave, and the preset configuration information It may be pre-configured when the vehicle is produced, and the processor may directly obtain the preset configuration information, and then obtain the time of the terminal device configured as the host according to the preset configuration information, and use the time as the first synchronization clock.
  • the second mode there is no need to wait for each terminal device to send a message, and there is no need to determine the master clock according to the message, which greatly reduces the time for time synchronization.
  • the terminal device that generates the first synchronous clock is the host, that is, the terminal device that generates the clock source is the host, and the rest needs to be based on The terminal device whose time is synchronized by the first synchronous clock is the slave.
  • a time synchronization method it is determined according to preset mode information whether the target mode is the first mode or the second mode, and in different target modes, the first synchronization clock as a clock source is determined.
  • the disclosed method supports a variety of preset modes, and can accurately obtain the first synchronous clock as a clock source in different modes, which can speed up the process of time synchronization, reduce time-consuming, and facilitate subsequent terminal devices to perform synchronization based on the first synchronous clock. Time synchronization.
  • S410 Receive data packets sent by other devices except the device waiting for time synchronization.
  • the processor receives data packets sent by other devices except the device waiting for time synchronization.
  • the data packets are sent by a new terminal device that needs time synchronization, and are generated by the new terminal device itself.
  • the above message information may be in the same form as the data message, and the data message may include the time information of the new terminal device.
  • the target mode is the first mode, that is, the preset mode is the preset message mode
  • it is determined by the master clock algorithm as the clock source
  • the second synchronous clock that is, to determine whether the new terminal device is a device that provides a clock source, or a device that needs to perform time synchronization.
  • the processor after determining the second synchronous clock, the processor generates a second control instruction including the second synchronous clock, and sends the second control instruction to the device waiting for time synchronization and sends a datagram
  • the second control instruction is used to control the device waiting for time synchronization and the device sending data packets to perform time synchronization according to the second synchronization clock, that is, after a new terminal device joins, it needs to Determine the second synchronous clock as the clock source, that is, re-determine the master clock, and generate a second control instruction including the master clock.
  • the target mode being the second mode
  • the time of the device sending the data message is obtained, and the time Determine as the second synchronous clock; generate a second control instruction, where the second control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the second synchronous clock.
  • the processor obtains the configuration information of the device sending the data message, and determines whether the device sending the data message is configured as a host, that is, Determine whether the device (new terminal device) sending the data message is a device that provides a clock source; based on the device sending the data message is configured as a host, obtain the time of the device sending the data message, and use this time as the second
  • the synchronous clock that is, the second synchronous clock is determined by the device sending the data message; then a second control command including the second synchronous clock is generated, and the second control command is sent to the device waiting for time synchronization, because the first 2.
  • the synchronization clock is the same as the time of the device sending the data message, so the device sending the data message does not need to perform time synchronization, but only needs to synchronize the time of multiple devices waiting for time synchronization. At this time, the above-mentioned first The master that synchronizes the clock is also the device waiting for time synchronization.
  • the first synchronous clock is used as the second synchronous clock; a second control instruction is generated, and the second control instruction is used to control the device sending the data message according to The second synchronization clock performs time synchronization.
  • the first synchronous clock is used as the second synchronous clock
  • the second synchronous clock may be the device (host) that provides the first synchronous clock among the above multiple devices
  • the current time, the first synchronous clock changes with the time of the host at any time.
  • the time of the first synchronous clock at this time is different from the time of the first synchronous clock when the above-mentioned device waiting for time synchronization performs time synchronization. It is the updated first synchronous clock.
  • a synchronous clock after determining the second synchronous clock as the clock source, generate the second control instruction comprising the second synchronous clock, and send the second control instruction to the equipment (new equipment) that sends the data message, the second control The instruction is used to control the device sending the data message to perform time synchronization according to the second synchronization clock.
  • the time of the device waiting for time synchronization is the same as the host time, and time synchronization may not be performed.
  • the time error of each terminal device can also be calculated through the existing method, and each terminal device adjusts the time by itself to maintain the time synchronization of the terminal devices
  • the accuracy of the final time makes the time of each terminal device in the synchronization maintenance stage.
  • the synchronization maintenance stage refers to the time synchronization of each terminal device. In the synchronization maintenance stage, it can be realized by the controller, and the controller can be set according to actual needs
  • For the specific implementation method of the synchronization maintenance phase refer to the method for self-adjusting time of the device in the prior art, and details will not be described here.
  • a time synchronization method receives data packets sent by devices other than the device waiting for time synchronization, based on the target mode as the first mode, and according to the data packets and the first synchronization clock, through The main clock algorithm determines the second synchronous clock as the clock source, generates the second control command, and sends the second control command to the device waiting for time synchronization and the device sending the data message, so that all terminal devices are synchronized according to the second synchronous clock Carry out time synchronization.
  • new devices can be added, and in different preset modes, the second synchronization clock can be quickly and accurately determined according to the data packets of the new devices, and the time of the terminal device can be checked at any time. Synchronization, better flexibility, and faster processing speed.
  • FIG. 5 is a schematic flowchart of a time synchronization method provided by an embodiment of the present disclosure.
  • a first control instruction is generated, and the first control instruction is used to control waiting for time synchronization.
  • the device performs time synchronization according to the first synchronization clock, specifically including the following steps S510 to S520 as shown in FIG. 5:
  • S510 Receive request information sent by a device waiting to perform time synchronization.
  • the processor may receive request information sent by the terminal device.
  • the request information refers to the information that the terminal device requests for time synchronization.
  • the request information is The time synchronization is actively sent by each terminal device, that is, the terminal device actively requests to perform time synchronization. This method can be called an active synchronization mechanism.
  • the time synchronization methods involved all need to wait for time synchronization, that is, the terminal device or processor as the master needs to send control commands to the terminal device as the slave, and the terminal device as the slave needs to wait Time synchronization can only be performed after the terminal device or processor as the host sends a control command and receives the control command.
  • This method can be called a passive synchronization mechanism. That is, for a terminal device as a slave, the time synchronization method provided in this disclosure converts the passive time synchronization of the terminal device (passive synchronization mechanism) into the active request of the terminal device for time synchronization (active synchronization mechanism), without waiting Time, but also speed up the process of time synchronization.
  • the processor After the processor receives the request information sent by each device waiting for time synchronization, it needs to determine the specific device waiting for time synchronization that sends the request information, that is, determine which terminal device sent the request information, that is, which The terminal device actively requests time synchronization.
  • S520 Generate a first control instruction according to the request information, and send the first control instruction to the device waiting for time synchronization, where the first control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the first synchronization clock.
  • the terminal device 230 sends a request message, and the processor receives the request message sent by the terminal device 230, generates a first control command, and returns the first control command to The terminal device 230, and then the terminal device 230 performs time synchronization according to the first control instruction.
  • the order in which each terminal device sends the request information is not limited, and the request information can be sent sequentially, or they can be sent to the processor together.
  • the processor sends the first control instruction to the terminal device, based on not receiving the time synchronization generated by the device waiting for time synchronization (the terminal device sending the request information) according to the first control instruction within a preset time
  • the updated first control instruction is periodically sent to the device waiting for time synchronization.
  • the processor will determine whether the terminal device has received the first control instruction, that is, the terminal device will generate response information after receiving the first control instruction, and send The response information is returned to the processor, and the processor judges whether the terminal device has received the first control instruction based on whether the response information is received.
  • the processor will periodically send The updated first control instruction; wherein, the preset time can be within the range of one-thousandth to one-tenth of the time corresponding to the passive synchronization mechanism; the updated first control instruction refers to the time provided as the clock source The current time of the terminal device with the first synchronous clock; when the terminal device as a slave does not receive the first control instruction, this situation may be that the processor does not generate the first control instruction after receiving the request information, or In other cases, the terminal device as the slave does not receive the first control command, and the terminal device as the slave cannot perform time synchronization according to the first control command.
  • a terminal device with a control command sends an updated first control command, or the processor periodically sends an updated first control command to a terminal device that has not received the first control command, and then the terminal device as a slave Receiving the first control instruction, and performing time synchronization according to the first synchronization clock in the first control instruction; periodically sending the updated first control instruction is equivalent to the step of waiting for time synchronization in the above-mentioned standard time synchronization method, that is, as The terminal equipment of the slave machine passively receives control commands for time synchronization, that is, a passive synchronization mechanism.
  • the active synchronization mechanism of the terminal device as a slave When the active synchronization mechanism of the terminal device as a slave is not effective, select the passive synchronization mechanism of the terminal device as a slave to ensure that all terminal devices as a slave can also complete time synchronization in an emergency, ensuring that it can be realized sex.
  • the method of changing from an active synchronization mechanism to a passive synchronization mechanism may be called a timeout mechanism, and the timeout mechanism refers to a mechanism activated when a response message is received within a preset time.
  • a time synchronization method receives request information sent by a device waiting for time synchronization, determines the specific terminal device sending the request information, generates a first control instruction according to the request information, and sends the first control instruction to The command is sent to the determined terminal device, and then the terminal device performs time synchronization according to the first synchronization clock.
  • the slave device actively sends request information for time synchronization.
  • the slave device does not need to wait for the processor to send the first control command, and the processor can After receiving the request information, the first control instruction is sent to the terminal device that sent the request information, which can speed up the process of time synchronization and reduce time consumption.
  • FIG. 6 is a schematic flowchart of a time synchronization method provided by the embodiments of the present disclosure, specifically including the following steps S610 to S690 as shown in FIG. 6 :
  • the target information Before obtaining the target information, a step of powering on and starting the processor and the terminal device is required, and after the processor is powered on and started, the target information including preset mode information is obtained.
  • a specific target mode is determined according to the preset mode information, and the target mode is one of the preset modes.
  • the preset message information corresponding to each terminal device is directly acquired, and the preset message information includes each Time information of the terminal device.
  • the first synchronous clock as the clock source is determined through the master clock algorithm, that is, whether the time of each terminal device is determined through the master clock algorithm is accurate, and the determined accurate
  • the time is used as the first synchronization clock, that is, the terminal device with accurate time is regarded as the master, and the other terminal devices that need time synchronization are regarded as the slaves.
  • S660 Receive request information sent by a device waiting to perform time synchronization.
  • the processor receives the request information sent by the terminal device, and determines the specific terminal device that sends the request information, that is, determines which terminal device sent the request information, and the request information refers to the End devices request information for time synchronization.
  • the method in which the terminal device actively sends request information to the processor to request time synchronization can be called an active synchronization mechanism.
  • the terminal device does not need to wait for the processor to periodically send the first control command, and the processor can receive After receiving the request information, the generated first control instruction is directly sent to the terminal device sending the request information.
  • the processor after receiving the request information, the processor generates the first control instruction including the first synchronization clock according to the request information, and sends the first control instruction to the device waiting for time synchronization.
  • a control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the first synchronization time.
  • the configuration information of multiple devices in the preset mode information is obtained, and the configuration information can be Determine whether each end device is a master or a slave.
  • the second mode supports time synchronization in the automotive field or other devices that do not support optimal clock algorithms.
  • the time synchronization method provided by the embodiments of the present disclosure is compatible with both the standard time synchronization method and the time synchronization method in the automotive field.
  • Fig. 7 is a schematic structural diagram of a time synchronization device provided by an embodiment of the present disclosure.
  • the time synchronization device provided in the embodiment of the present disclosure can execute the processing flow provided in the time synchronization method embodiment.
  • the time synchronization device 700 includes:
  • An acquisition unit 710 configured to acquire target information, where the target information includes preset mode information
  • the first determining unit 720 is configured to determine the target mode according to the preset mode information
  • the second determination unit 730 is configured to determine the first synchronous clock as a clock source in the target mode
  • the generating unit 740 is configured to generate a first control instruction, where the first control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the first synchronization clock.
  • the devices waiting for time synchronization in the generating unit 740 are multiple devices.
  • the first determining unit 730 determines the target mode according to the preset mode information, specifically for: determining the target mode as the first mode based on the message information included in the preset mode information;
  • the information includes configuration information of multiple devices, the target mode is determined to be the second mode, and the multiple devices include devices waiting for time synchronization.
  • the second determination unit 730 determines the first synchronous clock as the clock source, which is specifically used to: acquire the message information in the preset mode information in the first mode; information, and determine the first synchronous clock as the clock source through the master clock algorithm.
  • the multiple devices in the second determining unit 730 also include a host.
  • the second determining unit 730 determines the first synchronous clock as the clock source, which is specifically used to: acquire configuration information of multiple devices in the second mode; determine according to the configuration information A master among multiple devices; use the master's time as the first synchronized clock.
  • the apparatus 700 further includes an adding unit, which is specifically configured to: receive data packets sent by other devices except the device waiting for time synchronization; based on the target mode as the first mode, according to the data message and the first synchronous clock, determine the second synchronous clock as the clock source through the main clock algorithm; generate the second control instruction, the second control instruction is used to control the device waiting for time synchronization and the device sending the data message according to The second synchronization clock performs time synchronization.
  • an adding unit which is specifically configured to: receive data packets sent by other devices except the device waiting for time synchronization; based on the target mode as the first mode, according to the data message and the first synchronous clock, determine the second synchronous clock as the clock source through the main clock algorithm; generate the second control instruction, the second control instruction is used to control the device waiting for time synchronization and the device sending the data message according to The second synchronization clock performs time synchronization.
  • the newly added unit is also used to: based on the target mode being the second mode, when it is determined that the device sending the data message is configured as a host, obtain the time of the device sending the data message, and set The time is determined as the second synchronous clock; and a second control instruction is generated, and the second control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the second synchronous clock.
  • the newly added unit is also used to: when the device sending the data message is not configured as a host, use the first synchronous clock as the second synchronous clock; generate a second control instruction, and the second control The instruction is used to control the device sending the data packet to perform time synchronization according to the second synchronization clock.
  • the generation unit 740 generates a first control instruction, and the first control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the first synchronization clock, specifically for: receiving the device waiting for time synchronization to send The request information; generate the first control instruction according to the request information, and send the first control instruction to the device waiting for time synchronization, wherein the first control instruction is used to control the device waiting for time synchronization to perform time synchronization according to the first synchronization clock Synchronize.
  • the generating unit 740 is further configured to: periodically send the waiting device for time synchronization to Send the updated first control instruction.
  • the time synchronization device of the embodiment shown in FIG. 7 can be used to implement the technical solution of the above time synchronization method embodiment, and its implementation principle and technical effect are similar, and will not be repeated here.
  • FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • the electronic device provided by the embodiment of the present disclosure can execute the processing flow provided by the above embodiment.
  • the electronic device 800 includes: a processor 810, a communication interface 820, and a memory 830; wherein, the computer program is stored in the memory 830, and configured to be executed by the processor 810 as the time synchronization method described above.
  • embodiments of the present disclosure further provide a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the time synchronization method described in the foregoing embodiments.
  • an embodiment of the present disclosure further provides a computer program product, where the computer program product includes a computer program or an instruction, and when the computer program or instruction is executed by a processor, the time synchronization method described in the above embodiment is implemented.
  • an embodiment of the present disclosure further provides a computer program, where the computer program includes computer program code, and when the computer program code is run on a computer, the computer executes the time synchronization method in any of the above embodiments.

Abstract

本公开涉及一种时间同步方法、装置、电子设备、存储介质、计算机程序产品和计算机程序。时间同步方法包括:获取目标信息,目标信息包括预设模式信息,随后根据预设模式信息,确定要进行时间同步的目标模式,在目标模式下,确定作为时钟源的第一同步时钟,生成包括第一同步时钟的第一控制指令,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步。

Description

时间同步方法、装置、电子设备和存储介质
相关申请的交叉引用
本申请要求在2021年9月6日在中国提交的中国专利申请号202111040030.1的优先权,其全部内容通过引用并入本文。
技术领域
本公开涉及数据处理技术领域,尤其涉及时间同步方法、装置、电子设备、存储介质、计算机程序产品和计算机程序。
背景技术
目前,车辆的智能控制应用广泛,在车辆的实际应用中,车辆终端因为多种突发状况会存在时间不准确,或是终端控制的各设备的时间不同的情况,例如,车辆终端被断电后,在没有网络的情况下,车辆再次启动时,车辆终端的时间可能或是错的,导致终端无法准确的控制的多个电子设备,因此,需要对车辆进行时间同步,以便于实现对车辆的准确控制。
但是,现有的标准时间同步系统中,需要等待所有待同步的设备发送报文、选择最佳时钟、等待时间同步以及进行时间同步的步骤,多次等待的步骤导致时间同步的速度慢,需要耗费大量的时间,效率也比较低,且标准的时间同步系统不适用于车辆,在汽车领域不兼容,而在汽车领域进行时间同步时,只需要等待时间同步以及进行时间同步的步骤,等待的步骤也导致时间同步的速度比较慢,进行时间同步的时间长。
发明内容
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种时间同步方法、装置、电子设备、存储介质、计算机程序产品和计算机程序,能够快速准确的进行时间同步,不需要耗费大量时间,处理效率高。
第一方面,本公开实施例提供了一种时间同步方法,包括:
获取目标信息,目标信息包括预设模式信息;
根据预设模式信息,确定目标模式;
在目标模式下,确定作为时钟源的第一同步时钟;
生成第一控制指令,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步。
在一些实施例中,根据预设模式信息,确定目标模式,包括:
基于预设模式信息中包括报文信息,确定目标模式为第一模式;
基于预设模式信息中包括多个设备的配置信息,确定目标模式为第二模式,多个设备 包括等待进行时间同步的设备。
在一些实施例中,在目标模式下,确定作为时钟源的第一同步时钟,包括:
在第一模式下,获取预设模式信息中的报文信息;
根据报文信息,通过主时钟算法确定作为时钟源的第一同步时钟。
在一些实施例中,多个设备还包括主机,在目标模式下,确定作为时钟源的第一同步时钟,包括:
在第二模式下,获取多个设备的配置信息;
根据配置信息,确定多个设备中的主机;
将主机的时间作为第一同步时钟。
在一些实施例中,时间同步方法还包括:
接收除等待进行时间同步的设备之外的其他设备发送的数据报文;
基于目标模式为第一模式,根据数据报文和第一同步时钟,通过主时钟算法确定作为时钟源的第二同步时钟;
生成第二控制指令,第二控制指令用于控制等待进行时间同步的设备和发送所数据报文的设备根据第二同步时钟进行时间同步。
在一些实施例中,所时间同步方法还包括:
基于目标模式为第二模式,在确定发送数据报文的设备被配置为主机的情况下,则获取发送数据报文的设备的时间,并将时间确定为第二同步时钟;
生成第二控制指令,第二控制指令用于控制等待进行时间同步的设备根据第二同步时钟进行时间同步。
在一些实施例中,时间同步方法还包括:
基于发送数据报文的设备未被配置为主机,将第一同步时钟作为第二同步时钟;
生成第二控制指令,第二控制指令用于控制发送数据报文的设备根据第二同步时钟进行时间同步。
在一些实施例中,生成第一控制指令,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步,包括:
接收等待进行时间同步的设备发送的请求信息;
根据请求信息生成第一控制指令,并将第一控制指令发送至等待进行时间同步的设备,其中,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步。
在一些实施例中,时间同步方法还包括:
基于在预设时间内未接收到由等待进行时间同步的设备根据第一控制指令生成的响应信息,周期性的向等待进行时间同步的设备发送更新后的第一控制指令。
第二方面,本公开实施例提供了一种时间同步装置,包括:
获取单元,用于获取目标信息,目标信息包括预设模式信息;
第一确定单元,用于根据所述预设模式信息,确定目标模式;
第二确定单元,用于在目标模式下,确定作为时钟源的第一同步时钟;
生成单元,用于生成第一控制指令,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步。
第三方面,本公开实施例提供了一种电子设备,包括:
存储器;
处理器;和
计算机程序,
其中,计算机程序存储在存储器中,并被配置为由处理器执行以实现如上述的时间同步方法。
第四方面,本公开实施例提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现如上述的时间同步方法的步骤。
第五方面,本公开实施例提供了一种计算机程序产品,所述计算机程序产品中包括计算机程序代码,当所述计算机程序代码在计算机上运行时,以执行第一方面所述的时间同步方法。
第六方面,本公开实施例还提供了一种计算机程序,所述计算机程序包括计算机程序代码,当所述计算机程序代码在计算机上运行时,以使得计算机执行第一方面所述的时间同步方法。
本公开实施例提供了一种时间同步方法、装置、电子设备、存储介质、计算机程序产品和计算机程序。时间同步方法包括:获取目标信息,目标信息包括预设模式信息,随后根据预设模式信息,确定要进行时间同步的目标模式,在目标模式下,确定作为时钟源的第一同步时钟,生成包括第一同步时钟的第一控制指令,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步,也就是根据目标模式采用不同的时间同步方法,不同目标模式可以适用于不同的应用场景,例如适用于标准时间同步方法的场景或是适用于汽车领域,兼容性比较好,且也不需要等待的步骤,就能够快速准确的进行时间同步,不需要耗费大量时间,处理效率高。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的一种时间同步方法的流程示意图;
图2为本公开实施例提供的一种时间同步的结构示意图;
图3为本公开实施例提供的一种时间同步方法的流程示意图;
图4为本公开实施例提供的一种时间同步方法的流程示意图;
图5为本公开实施例提供的一种时间同步方法的流程示意图;
图6为本公开实施例提供的一种时间同步方法的流程示意图;
图7为本公开实施例提供的一种时间同步装置的结构示意图;
图8为本公开实施例提供的一种电子设备的结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
具体的,标准的基于时间敏感网络协议(802.1AS协议)的时间同步系统,需要经过等待报文、确定主时钟、等待时间同步和根据主时钟进行时间同步等四个步骤,需要等待报文和等待时间同步两个步骤,会耗费大量时间,处理效率低;其次,汽车领域不支持运行最佳主时钟算法(Best Master Clock Algorithm,BMCA),最佳主时钟算法用于确定主时钟,也就是不支持执行确定主时钟的步骤,在汽车领域中,车辆中的设备均已被配置承担相应的功能,设备可以被提前配置为主机或从机,通常会将主机的时间作为主时钟,因此,在汽车领域不支持通过最佳主时钟算法确定主时钟或从时钟,标准的时间敏感网络协议的时间同步系统在汽车领域不适用,所以在汽车领域进行时间同步时,只需要等待时间同步以及根据主时钟进行时间同步两个步骤,虽然不需要等待报文以及确定主时钟的步骤,但依然需要等待时间同步,也会耗费大量时间。标准的时间同步系统在汽车领域不适用,在汽车领域构建的时间同步系统同样无法实现标准的时间同步系统,因此在不同应用场景中就需要构建不同的时间同步系统,容易造成资源的浪费。
针对上述技术问题,本公开实施例提供了一种时间同步方法,通过获取目标信息,目标信息包括预设模式信息,随后根据预设模式信息,确定目标模式,在目标模式下,确定作为时钟源的第一同步时钟,最后等待进行时间同步的设备根据第一同步时钟进行时间同步,也就是根据不同的预设模式采用不同的时间同步方法,能够快速准确的进行时间同步,处理速度比较快,其中一个预设模式支持标准的时间同步方法的执行,另一个预设模式支持汽车领域的时间同步方法的执行,使得一个时间同步方法能够适用于多种应用场景,既支持标准的时间同步系统又兼容汽车领域的时间同步系统,且处理速度比较快,处理效率高,也不需要耗费大量时间。具体的,通过下述一个或多个实施例对本公开实施例提供的一种时间同步方法进行详细说明。
图1为本公开实施例提供的一种时间同步方法的流程示意图,可以应用在等待进行时间同步的多个设备上,具体包括如图1所示的如下步骤S110至S140:
S110、获取目标信息,目标信息包括预设模式信息。
可理解的,车辆或其他终端上安装的处理器获取目标信息,目标信息包括预设模式信 息,目标信息可以是预先在处理器中对车辆进行配置时所生成的信息,或是由其他终端发送给处理器的信息;其中,预设模式信息是预先设置的、处理器可以直接获取的信息。
S120、根据预设模式信息,确定目标模式。
可理解的,在上述S110的基础上,获取目标信息后,根据目标信息中的预设模式信息,确定目标模式,目标模式是多个预设模式中的一个模式,也就是要对等待进行时间同步的设备进行时间同步的模式。
在一些实施例中,预设模式包括第一模式和第二模式。
可理解的,根据预设模式信息,确定目标模式是第一模式还是第二模式,其中,第一模式可以理解为预设报文模式,可以实现上述标准时间同步系统,通过预先设置报文,可以减少等待报文的时间,进一步减少时间同步的时间;第二模式可以理解为预设角色模式,预设角色模式是预先将车辆中的多个终端设备分别配置为主机或从机,适用于汽车领域,通常以主机的时间作为主时钟,就不需要确定最佳时钟的步骤,进一步减少了进行时间同步的时间,上述两种模式可以将进行时间同步的时间从2秒以上减少到100毫秒以内,极大的减少了设备进行时间同步所需的时间。
在一些实施例中,参见图2,图2为本公开实施例提供的一种时间同步的结构示意图,包括处理器210、终端设备220、终端设备230、终端设备240和终端设备250,处理器210连接多个终端设备,多个终端设备中包括等待进行时间同步的设备,下述说明等待进行时间同步的设备时也可以用终端设备来表述。处理器210获取目标信息,并根据目标信息中的预设模式信息确定目标模式,基于目标模式是第二模式,也就是预设角色模式,那么可以获取预设模式信息中各终端设备的配置信息,例如从配置信息中确定将终端设备220配置为主机,终端设备230、终端设备240和终端设备250被配置为从机,以终端设备220的时间作为时钟源(主时钟),终端设备230、终端设备240和终端设备250根据终端设备220的时钟源进行时间同步。可理解的是,第二模式下,处理器210连接的多个终端设备中包括主机终端设备220,从机(等待进行时间同步的设备)终端设备230至250。
S130、在目标模式下,确定作为时钟源的第一同步时钟。
可理解的,在上述S120的基础上,根据目标模式,确定作为时钟源的第一同步时钟,第一模式和第二模式分别采用不同的方法确定第一同步时钟,第一同步时钟可以理解为主时钟,处理器连接的其他终端设备都会根据第一同步时钟进行时间同步。
S140、生成第一控制指令,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步。
可理解的,在上述S130的基础上,处理器生成包括第一同步时间的第一控制指令,并将第一控制指令发送至多个等待进行时间同步的设备(终端设备),第一控制指令用于控制没有提供第一同步时钟的设备根据第一同步时钟进行时间同步。
在一些实施例中,参见图2,在上述S130中确定终端设备220的时间是作为时钟源的第一同步时钟后,处理器210向控制终端设备230、终端设备240和终端设备250发送第一控制指令,用于控制终端设备230、终端设备240和终端设备250根据第一同步时钟进 行时间同步。
本公开实施例提供的一种时间同步方法,通过获取目标信息,目标信息包括预设模式信息,随后根据预设模式信息,确定要进行时间同步的目标模式,在目标模式下,确定作为时钟源的第一同步时钟,生成包括第一同步时钟的第一控制指令,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步,也就是根据目标模式对应的方法进行时间同步,不同目标模式可以适用于不同的应用场景,且也不需要等待的步骤,能够快速准确的进行时间同步,不需要耗费大量时间,处理效率高。
在上述实施例的基础上,图3为本公开实施例提供的一种时间同步方法的流程示意图,在一些实施例中,根据预设模式信息,确定目标模式,具体包括如图3所示的如下步骤S310至S320:
S310、基于预设模式信息中包括报文信息,确定目标模式为第一模式。
可理解的,分析预设模式信息中是否包括报文信息,基于获取的预设模式信息中包括各终端设备所对应的报文信息则确定目标模式为第一模式,第一模式包括预先设置各终端设备对应的报文信息,能够减少等待终端设备发出报文的时间,也可以设置终端设备主动、周期性的向处理器发送报文,且发送周期比较短;报文信息包括各等待进行时间同步的设备的时间信息。
在一些实施例中,确定目标模式后,在目标模式下,确定作为时钟源的第一同步时钟,具体包括:在第一模式下,获取预设模式信息中的报文信息;根据报文信息,通过主时钟算法确定作为时钟源的第一同步时钟。
可理解的,在第一模式下,也就是在预设报文的模式下,获取预设模式信息中的报文信息,在进行时间同步的过程中,处理器不需要等待终端设备生成并发送报文,可以直接获取预设模式信息中的报文信息。获取到报文信息后,根据与多个终端设备对应的多个报文信息,通过主时钟算法确定可以作为时钟源的第一同步时钟,主时钟算法可以是上述的最佳时钟算法,最佳时钟算法是根据各终端设备对应的包括时间信息的报文信息,得到准确的时间,并将时间作为第一同时钟。主时钟算法也可以是其他可以确定时钟源的算法,在此不作限定。
可理解的,在第一模式下,通过主时钟算法确定作为时钟源的第一同步时钟后,处理器连接的所有终端设备根据第一同步时钟进行时间同步。在另一个实施例中,基于与处理器连接的所有终端设备中存在与通过主时钟算法确定的作为时钟源的第一同步时钟的时间相同,该时间相同的终端设备可以不进行时间同步,除该终端设备之外的其他终端设备需要根据第一同步时钟进行时间同步。
S320、基于预设模式信息中包括多个设备的配置信息,则确定目标模式为第二模式,多个设备包括等待进行时间同步的设备。
可理解的,基于预设模式信息中包括多个设备的配置信息,则确定目标模式为第二模式,也就是目标模式是预设角色模式,预设角色模式是优先配置了终端设备是作为主机还是从机,多应用在汽车领域中,确定完主机和从机后,在第二模式下,将主机的时间确定 为作为时钟源的第一同步时钟,多个设备也可以指上述的多个终端设备,多个设备中包括等待进行时间同步的设备和主机,也就是多个设备中既有需要进行时间同步的设备(从机),还有提供时钟源的设备(主机)。
在一些实施例中,确定目标模式为第二模式后,在第二模式下,确定作为时钟源的第一同步时钟,还包括:在第二模式下,获取多个设备的配置信息;根据配置信息,确定多个设备中的主机;将主机的时间作为第一同步时钟。
可理解的,在第二模式下,也就是预设角色模式下,获取预设模式信息中多个终端设备的配置信息,配置信息说明了各终端设备是主机还是从机,预设的配置信息可以是车辆生产时预先配置好的,处理器可以直接获取预设的配置信息,随后根据预设的配置信息,获取被配置为主机的终端设备的时间,并将该时间作为第一同步时钟。在第二模式下,不需要等待各终端设备发送报文,也不需要根据报文确定主时钟,极大的减少了进行时间同步的时间。
可理解的,在第二模式下,在确定了作为时钟源的第一同步时钟的情况下,生成第一同步时钟的终端设备就是主机,也就是生成时钟源的终端设备就是主机,其余需要根据第一同步时钟进行时间同步的终端设备就是从机。
本公开实施例提供的一种时间同步方法,根据预设模式信息确定目标模式是第一模式或第二模式,并在不同目标模式下,确定作为时钟源的第一同步时钟。本公开的方法支持多种预设模式,可以在不同模式下,准确的获取作为时钟源的第一同步时钟,能够加快时间同步的进程,减少耗时,便于后续终端设备根据第一同步时钟进行时间同步。
在上述实施例的基础上,在多个终端设备进行时间同步的过程中,有其他新的终端设备加入,且新的终端设备也需要进行时间同步时,具体包括如图4所示的如下步骤S410至S430:
S410、接收除等待进行时间同步的设备之外的其他设备发送的数据报文。
可理解的,处理器接收除等待进行时间同步的设备之外的其他设备发送的数据报文,数据报文是需要进行时间同步的新的终端设备发送的,是由新的终端设备自行生成的,而不是第一模式中预先设置的,上述报文信息和数据报文的形式可能相同,数据报文中可以包括新的终端设备的时间信息。
S420、基于目标模式为第一模式,根据数据报文和第一同步时钟,通过主时钟算法确定作为时钟源的第二同步时钟。
可理解的,在上述S410的基础上,基于目标模式是第一模式,即预设模式是预设报文模式,则根据新的终端设备发出的数据报文,通过主时钟算法确定作为时钟源的第二同步时钟,也就是确定新的终端设备是提供时钟源的设备,还是需要进行时间同步的设备。
S430、生成第二控制指令,第二控制指令用于控制等待进行时间同步的设备和发送数据报文的设备根据第二同步时钟进行时间同步。
可理解的,在上述S420的基础上,确定第二同步时钟后,处理器生成包括第二同步时钟的第二控制指令,并将第二控制指令发送至等待进行时间同步的设备和发送数据报文的 设备,第二控制指令用于控制等待进行时间同步的设备和发送数据报文的设备根据第二同步时钟进行时间同步,也就是在有新的终端设备加入后,需要根据新的终端设备的时间确定作为时钟源的第二同步时钟,也就是重新确定主时钟,生成包括主时钟的第二控制指令。
在一些实施例中,在上述S410的基础上,基于目标模式为第二模式,在确定发送数据报文的设备被配置为主机的情况下,获取发送数据报文的设备的时间,并将时间确定为第二同步时钟;生成第二控制指令,第二控制指令用于控制等待进行时间同步的设备根据第二同步时钟进行时间同步。
可理解的,基于目标模式是第二模式,即目标模式是预设角色模式,则处理器获取发送数据报文的设备的配置信息,判断发送数据报文的设备是否被配置为主机,也就是判断发送数据报文的设备(新的终端设备)是否是提供时钟源的设备;基于发送数据报文的设备被配置为主机,获取发送数据报文的设备的时间,并将该时间作为第二同步时钟,也就是第二同步时钟是由发送数据报文的设备确定的;随后生成包括第二同步时钟的第二控制指令,并将第二控制指令发送至等待进行时间同步的设备,因为第二同步时钟与发送数据报文的设备的时间相同,所以发送数据报文的设备不需要进行时间同步,只需要对多个等待进行时间同步的设备进行时间同步即可,此时上述提供第一同步时钟的主机也是等待进行时间同步的设备。
在一些实施例中,基于发送数据报文的设备未被配置为主机,将第一同步时钟作为第二同步时钟;生成第二控制指令,第二控制指令用于控制发送数据报文的设备根据第二同步时钟进行时间同步。
可理解的,基于发送数据报文的设备没有被配置为主机,将第一同步时钟作为第二同步时钟,第二同步时钟可以是上述多个设备中提供第一同步时钟的设备(主机)的当前时间,第一同步时钟是随着主机的时间随时改变的,此时的第一同步时钟与上述等待进行时间同步的设备进行时间同步时的第一同步时钟的时间不同,是更新后的第一同步时钟;确定作为时钟源的第二同步时钟后,生成包括第二同步时钟的第二控制指令,并将第二控制指令发送给发送数据报文的设备(新的设备),第二控制指令用于控制发送数据报文的设备根据第二同步时钟进行时间同步,此时,等待进行时间同步的设备的时间与主机时间相同,可以不进行时间同步。
可理解的,所有终端设备包括上述多个终端设备和新的设备完成时间同步后,还可以通过现有方法计算各终端设备的时间误差,各终端设备自行调整时间,以维持终端设备进行时间同步后的时间的准确性,使得各终端设备的时间处于同步保持阶段,同步保持阶段是指各终端设备的时间要保持同步,在同步保持阶段可以通过控制器来实现,可以根据实际需求设置控制器的参数,该同步保持阶段的具体实现方法可以参见现有技术中设备自行调整时间的方法,在此不作赘述。
本公开实施例提供的一种时间同步方法,接收除等待进行时间同步的设备之外的其他设备发送的数据报文,基于目标模式为第一模式,根据数据报文和第一同步时钟,通过主时钟算法确定作为时钟源的第二同步时钟,生成第二控制指令,并将第二控制指令发送至 等待进行时间同步的设备和发送数据报文的设备,使得所有终端设备根据第二同步时钟进行时间同步,在进行时间同步的过程中可以加入新的设备,并在不同的预设模式下,根据新的设备的数据报文快速准确的确定第二同步时钟,并随时对终端设备进行时间同步,灵活性比较好,且处理速度比较快。
在上述实施例的基础上,图5为本公开实施例提供的一种时间同步方法的流程示意图,在一些实施例中,生成第一控制指令,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步,具体包括如图5所示的如下步骤S510至S520:
S510、接收等待进行时间同步的设备发送的请求信息。
可理解的,在不同目标模式下,确定了作为时钟源的第一同步时钟之后,处理器可以接收由终端设备发送的请求信息,请求信息是指终端设备请求进行时间同步的信息,请求信息是由各终端设备主动发送的,也就是终端设备主动请求要进行时间同步,该种方式可以称为主动同步机制。但在现有技术中,涉及到的时间同步方法,均需要等待时间同步,也就是需要作为主机的终端设备或处理器向作为从机的终端设备发送控制指令,作为从机的终端设备需要等待作为主机的终端设备或处理器发送控制指令,并接收到控制指令后,才能进行时间同步,该种方式可以称为被动同步机制。即对于作为从机的终端设备来说,本公开提供的时间同步方法,将终端设备被动的进行时间同步(被动同步机制)转为终端设备主动请求进行时间同步(主动同步机制),不需要等待时间,同时也能加快时间同步的流程。
可理解的,处理器接收到各等待进行时间同步的设备发送的请求信息后,还需要确定具体发送请求信息的等待进行时间同步的设备,也就是确定是哪个终端设备发送的请求信息,即哪个终端设备主动请求进行时间同步。
S520、根据请求信息生成第一控制指令,并将第一控制指令发送至等待进行时间同步的设备,其中,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步。
可理解的,在上述S510的基础上,接收到请求信息以及确定发送请求信息的具体设备后,生成包括第一同步时钟的控制指令,并将第一控制指令发送至发送请求信息的终端设备,使得该终端设备根据第一同步时钟进行时间同步。
在一些实施例中,参见图2,终端设备220确定为主机后,终端设备230发出请求信息,处理器接收终端设备230发送的请求信息,并生成第一控制指令,将第一控制指令返回至终端设备230,随后终端设备230根据第一控制指令进行时间同步,各终端设备发送请求信息的顺序不作限定,可以依次发送请求信息,也可以一块向处理器发送请求信息。
在一些实施例中,在处理器向终端设备发送第一控制指令后,基于在预设时间内未接收到由等待进行时间同步的设备(发送请求信息的终端设备)根据第一控制指令生成的响应信息,周期性的向等待进行时间同步的设备发送更新后的第一控制指令。
可理解的,终端设备发送请求信息后,在预设时间内,处理器会判断终端设备是否接收到第一控制指令,也就是终端设备在接收到第一控制指令后会生成响应信息,并将响应 信息返回至处理器,处理器以是否接收到响应信息来判断终端设备是否接收到第一控制指令,在处理器没有接收到响应信息的情况下,则处理器会周期性的向终端设备发送更新后的第一控制指令;其中,预设时间可以是被动同步机制对应的时间的千分之一至十分之一范围内的时间;更新后的第一控制指令是指提供作为时钟源的第一同步时钟的终端设备的当前时间;在作为从机的终端设备没有接收到第一控制指令的情况下,该种情况可能是处理器接收到请求信息后没有生成第一控制指令,或是其他情况使得作为从机的终端设备没有接收到第一控制指令,导致作为从机的终端设备无法根据第一控制指令进行时间同步,可以由作为主机的终端设备直接周期性的向没有接收到第一控制指令的终端设备发送更新后的第一控制指令,或是由处理器周期性的向没有接收到第一控制指令的终端设备发送更新后的第一控制指令,而后作为从机的终端设备接收第一控制指令,并根据第一控制指令中的第一同步时钟进行时间同步;周期性的发送更新后的第一控制指令相当于上述标准时间同步方法中的等待时间同步的步骤,即作为从机的终端设备被动的接收控制指令进行时间同步,也就是被动同步机制。在作为从机的终端设备的主动同步机制没有生效的时候,选择作为从机的终端设备的被动同步机制,确保所有作为从机的终端设备在突发情况下也能完成时间同步,保证可实现性。其中,由主动同步机制转为被动同步机制的方法可以称为超时机制,超时机制是指在预设时间内有接收到响应信息所启动的机制。
本公开实施例提供的一种时间同步方法,通过接收等待进行时间同步的设备发送的请求信息,并确定发送请求信息的具体的终端设备,根据请求信息生成第一控制指令,并将第一控制指令发送至确定的终端设备,随后终端设备根据第一同步时钟进行时间同步,采用从机主动发送请求信息进行时间同步的机制,从机不需要等待处理器发送第一控制指令,处理器可以在接收到请求信息后就向发送请求信息的终端设备发送第一控制指令,能够加快时间同步的流程,减少耗时。
在上述实施例的基础上,图为本公开实施例提供的一种时间同步方法的流程示意图,具体包括如图6所示的如下步骤S610至S690:
S610、获取目标信息,目标信息中包括预设模式信息。
可理解的,在获取目标信息之前,还要进行处理器和终端设备上电启动的步骤,处理器上电启动后,获取包括预设模式信息的目标信息。
S620、根据预设模式信息确定目标模式。
可理解的,在上述S610的基础上,根据预设模式信息确定具体的目标模式,目标模式是预设模式中的一个模式。
S630、判断目标模式是否是第一模式。
可理解的,在上述S620的基础上,确定目标模式之后,判断目标模式是第一模式还是第二模式,也就是判断预设模式是预设报文模式还是预设角色模式,在第一模式的情况下,则执行S640;在第二模式的情况下,则执行S680。
S640、获取预设模式信息中的报文信息。
可理解的,在上述S630的基础上,基于目标模式是第一模式(预设报文模式),直接 获取与各终端设备对应的预设的报文信息,预设的报文信息中包括各终端设备的时间信息。
S650、通过主时钟算法确定作为时钟源的第一同步时钟。
可理解的,在上述S640的基础上,根据报文信息,通过主时钟算法确定作为时钟源的第一同步时钟,也就是通过主时钟算法确定各终端设备的时间是否准确,将确定的准确的时间作为第一同步时钟,也就是将有准确时间的终端设备看作是主机,其余需要进行时间同步的终端设备看作是从机。
S660、接收等待进行时间同步的设备发送的请求信息。
可理解的,在上述S650的基础上,处理器接收由终端设备发送的请求信息,并确定发送请求信息的具体的终端设备,也就是确定是哪个终端设备发送的请求信息,请求信息是指该终端设备请求进行时间同步的信息。
可理解的,由终端设备主动发送请求信息给处理器,请求进行时间同步的方法,可以称为主动同步机制,终端设备不需要等待处理器周期性的发送第一控制指令,处理器可以在接收到请求信息后将生成的第一控制指令直接发送给发送请求信息的终端设备。
可理解的,第一模式下支持标准的时间同步方法进行时间同步。
S670、生成包括第一同步时钟的第一控制指令,并将第一控制指令发送至等待进行时间同步的设备。
可理解的,在上述S660的基础上,处理器接收到请求信息后,根据请求信息生成包括第一同步时钟的第一控制指令,并将第一控制指令发送至等待进行时间同步的设备,第一控制指令用于控制等待进行时间同步的设备根据第一同步时间进行时间同步。
S680、获取预设模式信息中多个设备的配置信息。
可理解的,在上述S630的基础上,基于目标模式是第二模式,在第二模式下,即在预设角色模式下,获取预设模式信息中多个设备的配置信息,根据配置信息可以确定各终端设备是主机还是从机。
S690、将被配置为主机的终端设备的时间作为第一同步时钟。
可理解的,在上述S690的基础上,根据多个设备的配置信息,确定多个设备中的主机,并获取被配置为主机的终端设备的时间,并将该时间作为第一同步时钟,随后,执行S660。
可理解的,第二模式支持在汽车领域或其他不支持最佳时钟算法的设备上进行时间同步。本公开实施例提供的时间同步方法同时兼容标准的时间同步方法和汽车领域的时间同步方法。
图7为本公开实施例提供的一种时间同步装置的结构示意图。本公开实施例提供的时间同步装置可以执行时间同步方法实施例提供的处理流程,如图7所示,时间同步装置700包括:
获取单元710,用于获取目标信息,目标信息包括预设模式信息;
第一确定单元720,用于根据预设模式信息,确定目标模式;
第二确定单元730,用于在目标模式下,确定作为时钟源的第一同步时钟;
生成单元740,用于生成第一控制指令,第一控制指令用于控制等待进行时间同步的 设备根据第一同步时钟进行时间同步。
在一些实施例中,生成单元740中的等待进行时间同步的设备是多个设备。
在一些实施例中,第以一确定单元730中根据预设模式信息,确定目标模式,具体用于:基于预设模式信息中包括报文信息,确定目标模式为第一模式;基于预设模式信息中包括多个设备的配置信息,确定目标模式为第二模式,多个设备包括等待进行时间同步的设备。
在一些实施例中,第二确定单元730中在目标模式下,确定作为时钟源的第一同步时钟,具体用于:在第一模式下,获取预设模式信息中的报文信息;根据报文信息,通过主时钟算法确定作为时钟源的第一同步时钟。
在一些实施例中,第二确定单元730中多个设备还包括主机。
在一些实施例中,第二确定单元730中在目标模式下,确定作为时钟源的第一同步时钟,具体用于:在第二模式下,获取多个设备的配置信息;根据配置信息,确定多个设备中的主机;将主机的时间作为第一同步时钟。
在一些实施例中,装置700还包括新增单元,新增单元具体用于:接收除等待进行时间同步的设备之外的其他设备发送的数据报文;基于目标模式为第一模式,根据数据报文和第一同步时钟,通过主时钟算法确定作为时钟源的第二同步时钟;生成第二控制指令,第二控制指令用于控制等待进行时间同步的设备和发送所数据报文的设备根据第二同步时钟进行时间同步。
在一些实施例中,新增单元中还用于:基于目标模式为第二模式,在确定发送数据报文的设备被配置为主机的情况下,获取发送数据报文的设备的时间,并将时间确定为第二同步时钟;生成第二控制指令,第二控制指令用于控制等待进行时间同步的设备根据第二同步时钟进行时间同步。
在一些实施例中,新增单元还用于:在发送数据报文的设备未被配置为主机的情况下,则将第一同步时钟作为第二同步时钟;生成第二控制指令,第二控制指令用于控制发送数据报文的设备根据第二同步时钟进行时间同步。
在一些实施例中,生成单元740中生成第一控制指令,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步,具体用于:接收等待进行时间同步的设备发送的请求信息;根据请求信息生成第一控制指令,并将第一控制指令发送至等待进行时间同步的设备,其中,第一控制指令用于控制等待进行时间同步的设备根据第一同步时钟进行时间同步。
在一些实施例中,生成单元740还用于:基于在预设时间内未接收到由等待进行时间同步的设备根据第一控制指令生成的响应信息,则周期性的向等待进行时间同步的设备发送更新后的第一控制指令。
图7所示实施例的时间同步装置可用于执行上述时间同步方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图8为本公开实施例提供的一种电子设备的结构示意图。本公开实施例提供的电子设 备可以执行上述实施例提供的处理流程,如图8所示,电子设备800包括:处理器810、通讯接口820和存储器830;其中,计算机程序存储在存储器830中,并被配置为由处理器810执行如上述的时间同步方法。
另外,本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行以实现上述实施例说明的时间同步方法。
此外,本公开实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如上实施例所述的时间同步方法。
此外,本公开实施例还提供了一种计算机程序,该计算机程序包括计算机程序代码,当该计算机程序代码在计算机上运行时,以使得该计算机执行如上任意实施例的时间同步方法。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。
本公开所有实施例均可以单独被执行,也可以与其他实施例相结合被执行,均视为本公开要求的保护范围。

Claims (14)

  1. 一种时间同步方法,其特征在于,包括:
    获取目标信息,所述目标信息包括预设模式信息;
    根据所述预设模式信息,确定目标模式;
    在所述目标模式下,确定作为时钟源的第一同步时钟;
    生成第一控制指令,所述第一控制指令用于控制等待进行时间同步的设备根据所述第一同步时钟进行时间同步。
  2. 根据权利要求1所述的方法,其特征在于,根据所述预设模式信息,确定目标模式,包括:
    基于所述预设模式信息中包括报文信息,确定目标模式为第一模式;
    基于所述预设模式信息中包括多个设备的配置信息,确定目标模式为第二模式,所述多个设备包括所述等待进行时间同步的设备。
  3. 根据权利要求2所述的方法,其特征在于,在所述目标模式下,确定作为时钟源的第一同步时钟,包括:
    在所述第一模式下,获取所述预设模式信息中的所述报文信息;
    根据所述报文信息,通过主时钟算法确定作为时钟源的第一同步时钟。
  4. 根据权利要求2所述的方法,其特征在于,所述多个设备还包括主机,在所述目标模式下,确定作为时钟源的第一同步时钟,包括:
    在所述第二模式下,获取所述多个设备的配置信息;
    根据所述配置信息,确定所述多个设备中的主机;
    将所述主机的时间作为第一同步时钟。
  5. 根据权利要求2或3所述的方法,其特征在于,所述方法还包括:
    接收除所述等待进行时间同步的设备之外的其他设备发送的数据报文;
    基于所述目标模式为所述第一模式,根据所述数据报文和所述第一同步时钟,通过主时钟算法确定作为时钟源的第二同步时钟;
    生成第二控制指令,所述第二控制指令用于控制所述等待进行时间同步的设备和发送所述数据报文的设备根据所述第二同步时钟进行时间同步。
  6. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    基于所述目标模式为所述第二模式,响应于确定发送所述数据报文的设备已被配置为主机,获取所述发送所述数据报文的设备的时间,并将所述时间确定为第二同步时钟;
    生成第二控制指令,所述第二控制指令用于控制所述等待进行时间同步的设备根据所述第二同步时钟进行时间同步。
  7. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    基于所述发送所述数据报文的设备未被配置为主机,将所述第一同步时钟作为第二同步时钟;
    生成第二控制指令,所述第二控制指令用于控制所述发送所述数据报文的设备根据所述第二同步时钟进行时间同步。
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,生成第一控制指令,所述第一控制指令用于控制等待进行时间同步的设备根据所述第一同步时钟进行时间同步,包括:
    接收等待进行时间同步的设备发送的请求信息;
    根据所述请求信息生成第一控制指令,并将所述第一控制指令发送至所述等待进行时间同步的设备,其中,所述第一控制指令用于控制所述等待进行时间同步的设备根据所述第一同步时钟进行时间同步。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    基于在预设时间内未接收到由所述等待进行时间同步的设备根据所述第一控制指令生成的响应信息,周期性的向所述等待进行时间同步的设备发送更新后的第一控制指令。
  10. 一种时间同步装置,其特征在于,包括:
    获取单元,用于获取目标信息,所述目标信息包括预设模式信息;
    第一确定单元,用于根据所述预设模式信息,确定目标模式;
    第二确定单元,用于在所述目标模式下,确定作为时钟源的第一同步时钟;
    生成单元,用于生成第一控制指令,所述第一控制指令用于控制等待进行时间同步的设备根据所述第一同步时钟进行时间同步。
  11. 一种电子设备,其特征在于,包括:
    存储器;
    处理器;和
    计算机程序,
    其中,所述计算机程序存储在所述存储器中,并被配置为由所述处理器执行以实现如权利要求1至9中任一项所述的时间同步方法。
  12. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9中任一所述的时间同步方法的步骤。
  13. 一种计算机程序产品,其特征在于,所述计算机程序产品中包括计算机程序代码,当所述计算机程序代码在计算机上运行时,以执行如权利要求1至9中任一项所述的时间同步方法。
  14. 一种计算机程序,其特征在于,所述计算机程序包括计算机程序代码,当所述计算机程序代码在计算机上运行时,以使得计算机执行如权利要求1至9中任一项所述的时间同步方法。
PCT/CN2022/117111 2021-09-06 2022-09-05 时间同步方法、装置、电子设备和存储介质 WO2023030525A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111040030.1A CN113821074B (zh) 2021-09-06 2021-09-06 一种时间同步方法、装置、电子设备和存储介质
CN202111040030.1 2021-09-06

Publications (1)

Publication Number Publication Date
WO2023030525A1 true WO2023030525A1 (zh) 2023-03-09

Family

ID=78921972

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/117111 WO2023030525A1 (zh) 2021-09-06 2022-09-05 时间同步方法、装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN113821074B (zh)
WO (1) WO2023030525A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821074B (zh) * 2021-09-06 2023-09-08 北京车和家信息技术有限公司 一种时间同步方法、装置、电子设备和存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103763055A (zh) * 2013-10-18 2014-04-30 杭州联汇数字科技有限公司 一种精确同步时间的方法
CN104145435A (zh) * 2012-02-27 2014-11-12 瑞典爱立信有限公司 使用精确时间协议的频率分配
CN111464402A (zh) * 2019-01-21 2020-07-28 杰哈思文化创意(杭州)有限公司 一种智能家居设备的控制方法、终端设备及介质
US20200274690A1 (en) * 2019-02-27 2020-08-27 Sumitomo Electric Industries, Ltd. Control method of optical transceiver and optical transceiver
CN111669245A (zh) * 2020-05-29 2020-09-15 北京百度网讯科技有限公司 车辆的时间同步方法、装置、设备及存储介质
CN112929122A (zh) * 2021-04-26 2021-06-08 新石器慧通(北京)科技有限公司 时间同步方法、装置、终端设备及计算机可读存储介质
CN113273105A (zh) * 2020-05-20 2021-08-17 深圳元戎启行科技有限公司 用于对自动驾驶车辆的多个辅助设备进行时间同步的方法、车辆、计算机设备和存储介质
CN113821074A (zh) * 2021-09-06 2021-12-21 北京车和家信息技术有限公司 一种时间同步方法、装置、电子设备和存储介质

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5822571A (en) * 1996-06-05 1998-10-13 Compaq Computer Corporation Synchronizing data between devices
CN101047711B (zh) * 2006-04-27 2010-08-18 华为技术有限公司 Ip报文传输、协商带宽节省能力和节省网络带宽的方法
CN1925386A (zh) * 2006-09-30 2007-03-07 杭州华为三康技术有限公司 时钟同步方法以及应用该方法的第一部件和第二部件
US8140925B2 (en) * 2007-06-26 2012-03-20 International Business Machines Corporation Method and apparatus to debug an integrated circuit chip via synchronous clock stop and scan
JP2017011452A (ja) * 2015-06-19 2017-01-12 ソニー株式会社 撮像装置および制御方法
CN106130679A (zh) * 2016-06-21 2016-11-16 易事特集团股份有限公司 主从时钟同步方法与系统
CN107786293B (zh) * 2016-08-29 2020-10-16 中兴通讯股份有限公司 时间同步方法、主时钟设备、从时钟设备及时间同步系统
CN106879063B (zh) * 2017-01-22 2020-12-25 新华三技术有限公司 一种时间同步方法及装置
CN109996326B (zh) * 2019-04-11 2024-02-02 北京跟踪与通信技术研究所 通信装置、方法、系统、电子设备及计算机可读存储介质
CN111130676B (zh) * 2019-12-02 2022-06-28 上海赫千电子科技有限公司 一种应用于主时钟与从时钟的时间同步修正方法、装置
CN112713951B (zh) * 2020-08-13 2021-11-23 中车株洲电力机车研究所有限公司 同步时钟的切换方法及装置、存储介质及电子设备
CN113068250B (zh) * 2021-04-01 2023-07-18 广东电网有限责任公司清远供电局 一种时间同步装置、方法、设备及存储介质
CN113225152B (zh) * 2021-07-08 2021-10-15 浙江华睿科技股份有限公司 一种相机同步的方法、装置及计算机可读介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104145435A (zh) * 2012-02-27 2014-11-12 瑞典爱立信有限公司 使用精确时间协议的频率分配
CN103763055A (zh) * 2013-10-18 2014-04-30 杭州联汇数字科技有限公司 一种精确同步时间的方法
CN111464402A (zh) * 2019-01-21 2020-07-28 杰哈思文化创意(杭州)有限公司 一种智能家居设备的控制方法、终端设备及介质
US20200274690A1 (en) * 2019-02-27 2020-08-27 Sumitomo Electric Industries, Ltd. Control method of optical transceiver and optical transceiver
CN113273105A (zh) * 2020-05-20 2021-08-17 深圳元戎启行科技有限公司 用于对自动驾驶车辆的多个辅助设备进行时间同步的方法、车辆、计算机设备和存储介质
CN111669245A (zh) * 2020-05-29 2020-09-15 北京百度网讯科技有限公司 车辆的时间同步方法、装置、设备及存储介质
CN112929122A (zh) * 2021-04-26 2021-06-08 新石器慧通(北京)科技有限公司 时间同步方法、装置、终端设备及计算机可读存储介质
CN113821074A (zh) * 2021-09-06 2021-12-21 北京车和家信息技术有限公司 一种时间同步方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN113821074B (zh) 2023-09-08
CN113821074A (zh) 2021-12-21

Similar Documents

Publication Publication Date Title
AU2021266341B2 (en) Session processing method, device, and system
CN112181339B (zh) 数据传输方法及装置
CN107659494B (zh) 数据处理方法及智能车载网关
US20120158981A1 (en) Fast join of peer to peer group with power saving mode
US10241551B2 (en) Control and synchronization mechanism for a complex distributed power management system
WO2023030525A1 (zh) 时间同步方法、装置、电子设备和存储介质
WO2019052163A1 (zh) 一种唤醒处理的方法及装置
US10034241B2 (en) Wireless communication device and system
JP2002164903A (ja) Ieee1394を用いた同期システム
KR20190074026A (ko) 이더캣 기반의 슬레이브 시스템에 포함된 복수의 마이크로 프로세서간 동기화 방법 및 시스템
WO2015078217A1 (zh) Ras配置的设置方法及装置
WO2017219519A1 (zh) 设备的控制方法、装置及系统
US9043283B2 (en) Opportunistic database duplex operations
WO2019000790A1 (zh) 一种以同步方式进行远程过程调用的方法及装置
WO2022077503A1 (zh) 无线投屏方法、装置及系统
CN113452770A (zh) 数据同步方法、装置、计算机设备及存储介质
JP5505266B2 (ja) 無線通信装置及びプログラム、並びに、通信システム
JP5562124B2 (ja) 通信装置及び通信方法及びプログラム
CN111984581A (zh) 一种基于Linux的SPI总线主从设备通讯系统、方法及装置
EP3723343A1 (en) Resource processing method and system, storage medium and electronic device
US10122879B2 (en) Image processing device, image processing system and non-transitory readable recording medium
CN106453656B (zh) 一种集群主机选取方法及装置
JP2009037387A (ja) ワイヤレスusbシステム、デバイスワイヤアダプタ及び有線usbデバイスの制御方法
CN115208794B (zh) Profibus-DP协议的定时器调整方法、装置、设备及介质
TWI442805B (zh) 控制無線網路裝置進行網路連線的方法及相關的無線網路裝置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22863659

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022863659

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2022863659

Country of ref document: EP

Effective date: 20240408