CN109217959B - Method, device and server for synchronizing time - Google Patents

Method, device and server for synchronizing time Download PDF

Info

Publication number
CN109217959B
CN109217959B CN201710538846.4A CN201710538846A CN109217959B CN 109217959 B CN109217959 B CN 109217959B CN 201710538846 A CN201710538846 A CN 201710538846A CN 109217959 B CN109217959 B CN 109217959B
Authority
CN
China
Prior art keywords
time
information
correction
file
processed
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710538846.4A
Other languages
Chinese (zh)
Other versions
CN109217959A (en
Inventor
王超
李冲冲
姜媛
石庭敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201710538846.4A priority Critical patent/CN109217959B/en
Publication of CN109217959A publication Critical patent/CN109217959A/en
Application granted granted Critical
Publication of CN109217959B publication Critical patent/CN109217959B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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/0647Synchronisation among TDM nodes
    • H04J3/065Synchronisation among TDM nodes using timestamps

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Electric Clocks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The application discloses a method, a device and a server for synchronizing time. One embodiment of the method comprises: receiving reference time information in real time; setting marking time for the reference time information, and predicting time point information when the reference time information changes according to the marking time; the pulse signal is set by the time point information. This embodiment achieves time synchronization.

Description

Method, device and server for synchronizing time
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, an apparatus, and a server for synchronizing time.
Background
The automobile expands the range of people going out, brings convenience to people going out and improves the quality of life of people. With the development and progress of science and technology, the unmanned vehicle controlled by the intelligent system can acquire more driving information than the manned vehicle, has higher safety and becomes an important trend of future vehicle development. The unmanned vehicle adopts a robot operating System to transmit information, and can automatically and safely run without any assistance by means of cooperation of methods such as artificial intelligence, visual calculation and the like and hardware such as a video camera, a laser radar and a Global Positioning System (GPS) Positioning System.
Unmanned vehicles include a variety of sensors, each of which is collecting data. The processor controls the unmanned vehicle based on the collected data. However, due to the reasons of different sizes of the collected data, different transmission times or different frequencies of the collected data, the times of arrival of the data collected by the sensors at the same time to the processor are often different, which makes the processor make an erroneous judgment.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, and a server for synchronizing time, so as to solve the technical problems mentioned in the above background.
In a first aspect, an embodiment of the present application provides a method for synchronizing time, where the method includes: receiving reference time information in real time, wherein the reference time information is used for carrying out time synchronization operation and comprises time point information; setting a marking time for the reference time information, and predicting the local time when the reference time information changes according to the marking time, wherein the marking time is used for marking the reference time information; setting a pulse signal according to the local time when the reference time information changes; at the time point of the rising edge of the pulse signal, the reference time information is set as correction time information, and the correction time information is sent out, the correction time information being used for performing a correction operation on time.
In some embodiments, the setting a marking time for the reference time information, and predicting the local time when the reference time information changes according to the marking time includes: setting a marking time when time point information contained in the reference time information changes to obtain a marking time sequence; calculating the time difference between adjacent mark times in the mark time sequence to obtain a time difference set, and determining the interval time of the change of the time point information contained in the reference time information according to the time difference set; and predicting the local time when the reference time information changes based on the interval time.
In some embodiments, the determining, by the time difference set, an interval time at which the time point information included in the reference time information changes includes: and averaging the set number of time differences in the time difference set to obtain the interval time.
In some embodiments, the predicting the local time when the reference time information changes based on the interval time includes: and increasing the interval time of a set number based on the time point information contained in the current reference time information, and predicting to obtain the local time when the current time changes within the set time.
In some embodiments, the setting the pulse signal according to the local time when the reference time information is changed includes: and setting the time point of the rising edge of the pulse signal according to the local time when the reference time information changes.
In a second aspect, an embodiment of the present application provides a method for synchronizing time, where the method includes: receiving correction time information, wherein the correction time information is used for performing correction operation on time and comprises time point information; extracting time point information from the correction time information, and modifying the local time into the time corresponding to the correction time information; determining a period of a file to be processed according to the receiving time of the file to be processed, correspondingly setting the starting time of the period and the time corresponding to the correction time information, determining a plurality of first time corresponding points of the period and the local time, determining a plurality of second time corresponding points of the receiving time of the file to be processed and the local time, and determining the previous first time corresponding point of the second time corresponding points as a time stamp of the file to be processed, wherein the receiving time of the file to be processed has periodicity, and the time stamp is used for representing the generation time of the file to be processed.
In a third aspect, an embodiment of the present application provides an apparatus for synchronizing time, where the apparatus includes: the receiving unit is used for receiving reference time information in real time, and the reference time information is used for carrying out time synchronization operation and comprises time point information; a time point information acquisition unit, configured to set a marking time for the reference time information, and predict time point information when the reference time information changes according to the marking time, where the marking time is used for marking the reference time information; a pulse signal setting unit for setting a pulse signal by time point information when the reference time information is changed; and a correction time information transmitting unit configured to set the reference time information as correction time information at a time point of a rising edge of the pulse signal, and transmit the correction time information, the correction time information being used for performing a correction operation on time.
In some embodiments, the time point information obtaining unit includes: a marked time sequence obtaining subunit, configured to set a marked time when time point information included in the reference time information changes, so as to obtain a marked time sequence; the interval time acquiring subunit is used for calculating the time difference between adjacent mark times in the mark time sequence to obtain a time difference set, and determining the interval time of the change of the time point information contained in the reference time information according to the time difference set; and the time point information acquisition subunit is used for predicting the local time when the reference time information changes based on the interval time.
In some embodiments, the interval time acquiring subunit includes: and averaging the set number of time differences in the time difference set to obtain the interval time.
In some embodiments, the time point information obtaining subunit includes: and increasing the interval time of a set number based on the time point information contained in the current reference time information, and predicting to obtain the local time when the current time changes within the set time.
In some embodiments, the pulse signal setting unit includes: and setting the time point of the rising edge of the pulse signal according to the local time when the reference time information changes.
In a fourth aspect, an embodiment of the present application provides an apparatus for synchronizing time, where the apparatus includes: an information receiving unit for receiving correction time information for performing a correction operation on time, the correction time information including a time point information; the synchronization unit is used for extracting time point information from the correction time information and modifying the local time into the time corresponding to the correction time information; the time stamping unit comprises a period determining subunit, a first time corresponding point determining subunit and a time stamping subunit, wherein the period determining subunit is used for determining the period of the file to be processed according to the receiving time of the file to be processed, the first time corresponding point determining subunit is used for correspondingly setting the starting time of the period and the time corresponding to the correction time information and determining a plurality of first time corresponding points of the period and the local time, the time stamping subunit is used for determining a plurality of second time corresponding points of the receiving time of the file to be processed and the local time, and then determining the previous first time corresponding point of the second time corresponding point as the time stamp of the file to be processed, wherein the receiving time of the file to be processed has periodicity, and the time stamp is used for representing the generating time of the file to be processed.
In a fifth aspect, an embodiment of the present application provides a server, including: one or more processors; storage means for storing one or more programs; the GPS device is used for receiving reference time information in real time, setting a pulse signal according to the reference time information, setting the reference time information into correction time information containing time point information, and sending the correction time information at the rising edge of the pulse signal, wherein the reference time information is used for carrying out time synchronization operation and comprises the time point information; the time correction device is used for receiving the correction time information and modifying the local time into the time corresponding to the correction time information; the time stamp device is used for adding a time stamp to the file to be processed according to the correction time information, wherein the receiving time of the file to be processed is periodic; when the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method for synchronizing time of the first aspect or the method for synchronizing time of the second aspect.
In a sixth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is configured to, when executed by a processor, implement the method for synchronizing time of the first aspect or the method for synchronizing time of the second aspect.
The method, the device and the server for synchronizing the time provided by the embodiment of the application receive the reference time information in real time; setting marking time for the reference time information, and predicting time point information when the reference time information changes according to the marking time; and finally, the pulse signals are set through the time point information, so that the time synchronization of the pulse signals is realized.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram for one embodiment of a method for synchronizing time according to the present application;
FIG. 3 is a flow diagram of another embodiment of a method for synchronizing time according to the present application;
FIG. 4 is a schematic diagram of an application scenario of a method for synchronizing time according to the present application;
FIG. 5 is a schematic diagram illustrating one embodiment of an apparatus for synchronizing time according to the present application;
FIG. 6 is a schematic block diagram of another embodiment of an apparatus for synchronizing time according to the present application;
FIG. 7 is a block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the present method for synchronizing time or apparatus for synchronizing time may be applied.
As shown in fig. 1, the system architecture 100 may include devices 101, 102, 103, a network 104, a GPS105, and satellites 106. Network 104 is the medium used to provide communication links between devices 101, 102, 103 and GPS 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The devices 101, 102, 103 interact with the GPS105 over the network 104 to receive or send messages and the like. The devices 101, 102, 103 may have installed thereon various data processing applications, such as an application for acquiring data, an application for acquiring picture information, an application for data analysis, and the like.
The devices 101, 102, 103 may be various electronic devices having the ability to acquire data and process data, including but not limited to radar, cameras, laptop and desktop computers, and the like.
The GPS105 may obtain reference time information (e.g., coordinated universal time, etc.) from the satellite 106 in real time for time synchronization operations of time or files on the devices 101, 102, 103 over the network 104.
It should be noted that the method for synchronizing time provided by the embodiment of the present application is generally performed by the GPS105, and accordingly, the device for synchronizing time is generally disposed in the GPS 105.
It should be understood that the number of devices, networks, GPS and satellites in fig. 1 is merely illustrative. There may be any number of devices, networks, GPS and satellites, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for synchronizing time in accordance with the present application is shown. The method for synchronizing time includes the steps of:
step 201, receiving the reference time information in real time.
In the present embodiment, an electronic device (for example, the GPS105 shown in fig. 1) on which the method for synchronizing time operates may acquire reference time information in real time from the satellite 106, wherein the reference time information is used for performing a time synchronization operation, including one time point information.
The GPS105 can not only provide a positioning signal but also acquire reference time information from the satellite 106 in real time. For example, the reference time information may be coordinated universal time, which is also called universal time, or international coordinated time, and is a time measurement system that is as close to universal time as possible in time based on atomic time-seconds, and is an accurate time of the current time. Therefore, after the GPS105 receives the reference time information, the time synchronization operation can be performed on the time or file on the devices 101, 102, 103 with data connection to the GPS105 through the reference time information, so that the time or file on the devices 101, 102, 103 adopts the same time standard.
Step 202, setting a marking time for the reference time information, and predicting the local time when the reference time information changes according to the marking time.
After the GPS105 receives the reference time information, the marker time may be set according to the reference time information. Wherein, the marking time is used for marking the reference time information. Since the reference time is received in real time, and the reference time information is periodically changed. Therefore, by setting the marker time for the reference time information, the period in which the satellite 106 transmits the reference time information can be determined. The time point information included in the reference time information changes once every time the reference time information is transmitted, and for example, the corresponding time point information in the first reference time information is: 2017-06-30T12:00:00.000Z, 12 o 'clock 00 min 00 s 000 ms on 30 o' clock in 2017; the corresponding time point information in the second reference time information is: 2017-06-30T12:00:01.000Z, representing 12 o 'clock 00 min 01 s 000 ms on 30 o' clock in 2017 in 06 months. That is, the satellite 106 transmits the reference time information to the GPS105 every 1 second. The GPS105 sets a marker time for the reference time information after receiving the reference time information. The time-stamped may use the time existing on the GPS 105. For example, if the first reference time information is received at the time of 59 minutes 59 seconds at 11 o ' clock of 30 o ' clock of 06 p.t. 30 of 2017 on the GPS105, the first marker time may be 59 minutes 59 seconds at 11 o ' clock of 06 p.t. 30 of 2017; if the second reference time information is received at 12 o 'clock 00 min 00 sec on GPS105 at time 2017, 06, 30, the second marked time may be 12 o' clock 00 min 00 sec at 2017, 06, 30. In this way, the period of the reference time information transmitted by the satellite 106 can be determined by marking the time, so that the time points at which the reference time information can be received in a future period of time can be predicted.
In some optional implementation manners of this embodiment, the setting a marking time for the reference time information, and predicting a local time when the reference time information changes according to the marking time may include the following steps:
firstly, setting a marking time when time point information contained in the reference time information changes to obtain a marking time sequence.
The GPS105 receives reference time information at regular intervals, the reference time information includes time point information, and each of the reference time information includes different time point information. Therefore, the time when the GPS105 receives the reference time information is the time when the time point information changes. At this time, a marker time may be set for the time point information. When a plurality of pieces of reference time information are received continuously, a plurality of continuous marking times are obtained, and a marking time sequence is obtained.
And secondly, calculating the time difference between adjacent mark times in the mark time sequence to obtain a time difference set, and determining the interval time of the change of the time point information contained in the reference time information through the time difference set.
As is apparent from the above description, the marker time may be different from the time corresponding to the time point information included in the reference time information. However, since the satellite 106 transmits the reference time information to the GPS105 at a set period and the tag time is set when the GPS105 receives the reference time information, the time interval between the tag times is the time interval at which the satellite 106 transmits the reference time information. To obtain accurate information, a set of time differences may be constructed by the time differences between adjacent marker times in the marker time series. The time interval at which the time point information included in the reference time information changes is determined by the time difference set.
And thirdly, predicting the local time when the reference time information changes based on the interval time.
After the interval time at which the time point information included in the reference time information changes is determined, the time point information at which the reference time information is received can be predicted based on the mark time on the GPS 105.
In some optional implementations of this embodiment, the determining, by the time difference set, an interval time at which time point information included in the reference time information changes may include: and averaging the set number of time differences in the time difference set to obtain the interval time.
Since the marking time is marked after the reference time information is received, an error may occur between the marking times due to a network speed or other reasons. Therefore, the accuracy of the interval time can be improved by averaging a set number of time differences in the time difference set and using the average of the time differences as the interval time.
In some optional implementation manners of this embodiment, the predicting, based on the interval time, a local time when the reference time information changes may include: and increasing the interval time of a set number based on the time point information contained in the current reference time information, and predicting to obtain the local time when the current time changes within the set time.
After the interval time in which the time point information included in the reference time information changes is determined, the time point at which the reference time information is received is determined by adding one interval time based on the mark time on the GPS105 (i.e., the time corresponding to the time point information included in the current reference time information).
And step 203, setting a pulse signal through the time point information.
The GPS105 may send out a pulse signal. After the time point information is determined, the GPS105 may set the pulse signal by the time point information, so that the transmission time of the pulse signal may be the same as the time corresponding to the time point information.
In some optional implementations of this embodiment, the setting the pulse signal according to the time point information may include: and setting the time point of the rising edge of the pulse signal according to the time point information.
The pulse signal may include a rising edge and a falling edge, and the present embodiment aligns the rising edge of the pulse signal with a time corresponding to the time point information. In this way, the emission time of the pulse signal is the same as the time corresponding to the time point information included in the reference time information.
In some optional implementations of this embodiment, the method may further include: at the time point of the rising edge of the pulse signal, the reference time information is set as the correction time information, and the correction time information is sent out.
The GPS105 obtains the reference time information, determines time point information of the reference time information by time stamping, and finally determines a rising edge of the pulse signal so that the rising edge of the pulse signal has the same time as the time corresponding to the time point information included in the reference time information. Then, the reference time information is set as the correction time information, and the correction time information is sent out at the rising edge time of the pulse signal, so that when other equipment acquires the correction time information, the time corresponding to the time point information contained in the correction time information can be directly synchronized into the time of the equipment, and the time accuracy on the equipment is improved. Wherein, the correction time information is used for correcting time.
With continued reference to FIG. 3, a flow 300 of one embodiment of a method for synchronizing time in accordance with the present application is shown. The method for synchronizing time includes the steps of:
step 301, receiving correction time information.
In this embodiment, the electronic device (e.g., devices 101, 102, 103 shown in fig. 1) on which the method for synchronizing time operates may receive the corrected time information from the GPS 105. The correction time information is used for correcting time and comprises time point information.
Step 302, extracting time point information from the corrected time information, and modifying the local time into the time corresponding to the corrected time information.
After the devices 101, 102 and 103 receive the corrected time information, time point information is extracted from the corrected time information, and the time information on the devices 101, 102 and 103 is modified into the time corresponding to the time point information contained in the corrected time information, so that the time synchronization of the devices 101, 102 and 103 through the corrected time information is realized.
In some optional implementation manners of this embodiment, the method may further include a step of adding a timestamp to the file to be processed according to the corrected time information, where the receiving time of the file to be processed has periodicity, and the timestamp is used to represent the generation time of the file to be processed, and the step of adding a timestamp to the file to be processed according to the corrected time information may include the following steps:
firstly, determining the period of the file to be processed according to the receiving time of the file to be processed.
Some devices (which may be devices 101, 102) do not have a time system themselves and cannot synchronize the time on the devices by correcting the time information, but can use the corrected time information as a trigger signal and acquire data by the trigger signal. For example, a camera does not acquire images at a frequency of 30 hertz. The correction time information is sent to the camera at the frequency of 1 Hz, and after the camera receives the correction time information, the trigger signal can be adjusted to 30 Hz through a frequency multiplier and other devices, and 30 images can be obtained at every Hz. However, since the camera itself has no time system, it is impossible to timestamp the image, and the device (e.g. device 103) receiving the image cannot determine the shooting time of the image, and thus cannot perform corresponding data processing on the image. For this reason, the apparatus receiving the image may determine the period of the image according to the reception time of the image (the file to be processed). For example, if the device 103 receives 30 images from the device 102 within one second, the period of the images can be determined to be 30 minutes of a second.
And setting the starting time of the period corresponding to the time corresponding to the correction time information, and determining a plurality of first time corresponding points of the period and the local time.
Taking the above-mentioned camera as an example, the camera also triggers to acquire the image after receiving the correction time information and multiplying the frequency, so that the sending period of the correction time information and the acquisition period of the image are in an integer multiple relationship. Considering that there is a time delay in sending an image to a device processing the image by a camera, a time corresponding to the received image (i.e., the start time of the period) may be set corresponding to a time corresponding to the correction time information, so as to align the time corresponding to each received image with the time corresponding to the correction time information, and thereby determine a plurality of first time corresponding points at which the time corresponding to the received image corresponds to the local time of the device processing the image. That is, the first time corresponding point is obtained strictly according to the time corresponding to the correction time information, and is the actual acquisition time of the image.
And thirdly, determining a plurality of second time corresponding points of the receiving time of the file to be processed and the local time, and determining a previous first time corresponding point of the second time corresponding points as the time stamp of the file to be processed.
The receiving time of the file to be processed is the time for the file to be processed to reach the equipment after being generated and transmitted, the time has delay compared with the point corresponding to the first time, and the delay is usually very small considering the propagation speed of the electric signal. And determining the receiving time of the file to be processed and a plurality of second time corresponding points of the local time, wherein the previous first time corresponding point of the second time corresponding points is the real generation time of the file to be processed, and the previous first time corresponding point of the second time corresponding points is the time stamp of the file to be processed. In this way, the true timestamp of the file to be processed is obtained. For example, the first time corresponding points are 1.000 seconds, 2.000 seconds, 3.000 seconds, 4.000 seconds, 5.000 seconds; the second time corresponding points are 1.010 second, 2.010 second, 3.010 second, 4.010 second and 5.010 second, and the time for receiving the file to be processed is advanced by 0.01 second, which is the time for generating the file to be processed really.
With continued reference to fig. 4, fig. 4 is a schematic diagram of an application scenario of the method for synchronizing time according to the present embodiment. In the application scenario of fig. 4, a satellite 401 sends reference time information to a GPS402 in real time; after receiving the reference time information, the GPS402 sets a mark time for the reference time information, predicts time point information at which the reference time information changes, and sets a pulse signal according to the time point information, thereby synchronizing the time corresponding to the pulse signal and the reference time information.
The method provided by the above embodiment of the present application realizes time synchronization of time and/or files to be processed through the reference time information.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for synchronizing time, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the apparatus 500 for synchronizing time of the present embodiment may include: a receiving unit 501, a time point information acquiring unit 502, and a pulse signal setting unit 503. The receiving unit 501 is configured to receive reference time information in real time, where the reference time information is used for performing time synchronization operation and includes a time point information; the time point information obtaining unit 502 is configured to set a marking time for the reference time information, and predict a local time when the reference time information changes according to the marking time, where the marking time is used for marking the reference time information; the pulse signal setting unit 503 is configured to set the pulse signal by the local time.
In some optional implementations of the present embodiment, the time point information obtaining unit 502 may include: a mark time series acquisition sub-unit (not shown), an interval time acquisition sub-unit (not shown), and a time point information acquisition sub-unit (not shown). The marking time sequence acquiring subunit is configured to set a marking time when time point information included in the reference time information changes, so as to obtain a marking time sequence; the interval time acquiring subunit is configured to calculate a time difference between adjacent marker times in the marker time sequence to obtain a time difference set, and determine, according to the time difference set, an interval time at which time point information included in the reference time information changes; the time point information acquiring subunit is configured to predict a local time when the reference time information changes based on the interval time.
In some optional implementations of this embodiment, the interval time acquiring subunit may include: and averaging the set number of time differences in the time difference set to obtain the interval time.
In some optional implementation manners of this embodiment, the time point information obtaining subunit may include: and increasing the interval time of a set number based on the time point information contained in the current reference time information, and predicting to obtain the local time when the current time changes within the set time.
In some optional implementations of this embodiment, the pulse signal setting unit 503 may include: and setting the time point of the rising edge of the pulse signal according to the local time.
In some optional implementations of this embodiment, the apparatus 500 for synchronizing time may further include: and a correction time information transmitting unit (not shown) for setting the reference time information as correction time information for performing a correction operation on time at a time point of a rising edge of the pulse signal and transmitting the correction time information.
With further reference to fig. 6, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for synchronizing time, which corresponds to the method embodiment shown in fig. 3, and which is particularly applicable to various electronic devices.
As shown in fig. 6, the apparatus 600 for synchronizing time of the present embodiment may include: an information receiving unit 601 and a synchronization unit 602. The information receiving unit 601 is configured to receive correction time information, where the correction time information is used for performing a correction operation on time and includes a time point information; the synchronization unit 602 is configured to extract time point information from the corrected time information, and modify the local time to a time corresponding to the corrected time information.
In some optional implementation manners of this embodiment, the apparatus 600 for synchronizing time may further include a time stamp unit (not shown in the figure) configured to add a time stamp to the file to be processed according to the corrected time information, where the receiving time of the file to be processed has periodicity, and the time stamp is used to characterize the generating time of the file to be processed, and the time stamp unit may include: a period determining sub-unit (not shown in the drawings), a first time corresponding point determining sub-unit (not shown in the drawings), and a time stamp sub-unit (not shown in the drawings). The period determining subunit is used for determining the period of the file to be processed according to the receiving time of the file to be processed; the first time corresponding point determining subunit is configured to set a start time of the period and a time corresponding to the corrected time information, and determine a plurality of first time corresponding points of the period and the local time; the time stamp subunit is configured to determine a plurality of second time corresponding points between the receiving time of the file to be processed and the local time, and determine a previous first time corresponding point of the second time corresponding points as a time stamp of the file to be processed.
The present embodiment further provides a server, including: one or more processors; storage means for storing one or more programs; the GPS device is used for receiving reference time information in real time, setting a pulse signal according to the reference time information, setting the reference time information into correction time information containing time point information, and sending the correction time information at the rising edge of the pulse signal, wherein the reference time information is used for carrying out time synchronization operation and comprises the time point information; the time correction device is used for receiving the correction time information and modifying the local time into the time corresponding to the correction time information; the time stamp device is used for adding a time stamp to the file to be processed according to the correction time information, wherein the receiving time of the file to be processed is periodic; when executed by the one or more processors, cause the one or more processors to perform the method for synchronizing time described above.
The present embodiment also provides a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the above-mentioned method for synchronizing time.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use in implementing a server according to embodiments of the present application. The server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by a Central Processing Unit (CPU)701, performs the above-described functions defined in the method of the present application.
It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a time point information acquiring unit, and a pulse signal setting unit. The names of these units do not in some cases constitute a limitation on the unit itself, and for example, the pulse signal setting unit may also be described as a "unit for setting the rising edge time of a pulse signal".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: receiving reference time information in real time, wherein the reference time information is used for carrying out time synchronization operation and comprises time point information; setting a marking time for the reference time information, and predicting time point information when the reference time information changes according to the marking time, wherein the marking time is used for marking the reference time information; the pulse signal is set by the time point information.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (14)

1. A method for synchronizing time, the method comprising:
receiving reference time information in real time, wherein the reference time information is used for carrying out time synchronization operation and comprises time point information;
setting marking time for the reference time information, and predicting local time when the reference time information changes according to the marking time, wherein the marking time is used for marking the reference time information;
setting a pulse signal according to the local time when the reference time information changes;
setting reference time information as correction time information at the time point of the rising edge of the pulse signal, and sending the correction time information out, wherein the correction time information is used for performing correction operation on time and adding a time stamp to a file to be processed, the receiving time of the file to be processed has periodicity, the period of the file to be processed and the sending period of the correction time information are in integral multiple relation, and the time stamp is used for representing the generation time of the file to be processed.
2. The method according to claim 1, wherein a marking time is set for the reference time information, and predicting the local time when the reference time information changes according to the marking time comprises:
setting a marking time when time point information contained in the reference time information changes to obtain a marking time sequence;
calculating the time difference between adjacent mark times in the mark time sequence to obtain a time difference set, and determining the interval time of the change of the time point information contained in the reference time information through the time difference set;
and predicting the local time when the reference time information changes based on the interval time.
3. The method according to claim 2, wherein the determining, by the set of time differences, an interval time at which point-in-time information included in the reference time information changes comprises:
and averaging the set number of time differences in the time difference set to obtain the interval time.
4. The method of claim 2, wherein predicting the local time when the reference time information changes based on the interval time comprises:
and increasing the interval time of a set number based on the time point information contained in the current reference time information, and predicting to obtain the local time when the current time changes within the set time.
5. The method according to claim 2, wherein said setting the pulse signal by the local time when the reference time information is changed comprises:
and setting the time point of the rising edge of the pulse signal according to the local time when the reference time information changes.
6. A method for synchronizing time, the method comprising:
receiving correction time information, wherein the correction time information is used for performing correction operation on time and comprises time point information;
extracting time point information from the correction time information, and modifying the local time into the time corresponding to the correction time information;
determining a period of a file to be processed according to receiving time of the file to be processed, correspondingly setting starting time of the period and time corresponding to correction time information, determining a plurality of first time corresponding points of the period and the local time, determining a plurality of second time corresponding points of the receiving time of the file to be processed and the local time, and determining a previous first time corresponding point of the second time corresponding points as a timestamp of the file to be processed, wherein the receiving time of the file to be processed has periodicity, the period of the file to be processed and the sending period of the correction time information are in integral multiple relation, the first time corresponding point is sending time of the file to be processed, the second time corresponding point is receiving time of the file to be processed, and the timestamp is used for representing generating time of the file to be processed.
7. An apparatus for synchronizing time, the apparatus comprising:
the receiving unit is used for receiving reference time information in real time, and the reference time information is used for carrying out time synchronization operation and comprises time point information;
the time point information acquisition unit is used for setting marking time for the reference time information, and predicting local time when the reference time information changes according to the marking time, wherein the marking time is used for marking the reference time information;
the pulse signal setting unit is used for setting a pulse signal according to the local time when the reference time information changes;
the device comprises a correction time information sending unit, a time delay unit and a time delay unit, wherein the correction time information sending unit is used for setting reference time information as correction time information at the time point of the rising edge of a pulse signal and sending out the correction time information, the correction time information is used for carrying out correction operation on time and adding a time stamp to a file to be processed, the receiving time of the file to be processed is periodic, the period of the file to be processed and the sending period of the correction time information are in integral multiple relation, and the time stamp is used for representing the generation time of the file to be processed.
8. The apparatus of claim 7, wherein the time point information obtaining unit comprises:
a marked time sequence obtaining subunit, configured to set a marked time when time point information included in the reference time information changes, so as to obtain a marked time sequence;
the interval time acquiring subunit is used for calculating the time difference between adjacent marking times in the marking time sequence to obtain a time difference set, and determining the interval time of the change of the time point information contained in the reference time information according to the time difference set;
and the time point information acquisition subunit is used for predicting the local time when the reference time information changes based on the interval time.
9. The apparatus of claim 8, wherein the inter-time acquisition subunit comprises:
and averaging the set number of time differences in the time difference set to obtain the interval time.
10. The apparatus of claim 8, wherein the time point information obtaining subunit comprises:
and increasing the interval time of a set number based on the time point information contained in the current reference time information, and predicting to obtain the local time when the current time changes within the set time.
11. The apparatus of claim 8, wherein the pulse signal setting unit comprises:
and setting the time point of the rising edge of the pulse signal according to the local time when the reference time information changes.
12. An apparatus for synchronizing time, the apparatus comprising:
an information receiving unit for receiving correction time information for performing a correction operation on time, the correction time information including a time point information;
the synchronization unit is used for extracting time point information from the correction time information and modifying the local time into the time corresponding to the correction time information;
the time stamping unit comprises a period determining subunit, a first time corresponding point determining subunit and a time stamping subunit, wherein the period determining subunit is used for determining the period of the file to be processed according to the receiving time of the file to be processed, the first time corresponding point determining subunit is used for correspondingly setting the starting time of the period and the time corresponding to the correction time information and determining a plurality of first time corresponding points of the period and the local time, the time stamping subunit is used for determining a plurality of second time corresponding points of the receiving time of the file to be processed and the local time and determining the previous first time corresponding point of the second time corresponding points as the time stamp of the file to be processed, the receiving time of the file to be processed has periodicity, the first time corresponding point is the sending time of the file to be processed, and the second time corresponding point is the receiving time of the file to be processed, the time stamp is used for representing the generation time of the file to be processed.
13. A server, comprising:
one or more processors;
storage means for storing one or more programs;
the GPS device is used for receiving reference time information in real time, setting a pulse signal according to the reference time information, setting the reference time information into correction time information containing time point information, and sending the correction time information at the rising edge of the pulse signal, wherein the reference time information is used for carrying out time synchronization operation and comprises the time point information;
the time correction device is used for receiving the correction time information and modifying the local time into the time corresponding to the correction time information;
the time stamp device is used for adding a time stamp to the file to be processed according to the correction time information, wherein the receiving time of the file to be processed is periodic;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1 to 5 or the method of any one of claim 6.
14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 5 or the method of any one of claim 6.
CN201710538846.4A 2017-07-04 2017-07-04 Method, device and server for synchronizing time Active CN109217959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710538846.4A CN109217959B (en) 2017-07-04 2017-07-04 Method, device and server for synchronizing time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710538846.4A CN109217959B (en) 2017-07-04 2017-07-04 Method, device and server for synchronizing time

Publications (2)

Publication Number Publication Date
CN109217959A CN109217959A (en) 2019-01-15
CN109217959B true CN109217959B (en) 2021-04-20

Family

ID=64993020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710538846.4A Active CN109217959B (en) 2017-07-04 2017-07-04 Method, device and server for synchronizing time

Country Status (1)

Country Link
CN (1) CN109217959B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111756463B (en) * 2019-03-29 2021-09-24 北京航迹科技有限公司 Time synchronization system and method for vehicle
CN113204516A (en) * 2021-04-26 2021-08-03 北京京东乾石科技有限公司 Method and device for time synchronization of processors

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102088397A (en) * 2009-12-03 2011-06-08 中兴通讯股份有限公司 Communication network element and clock frequency correction system and method
CN105867778A (en) * 2016-03-28 2016-08-17 联想(北京)有限公司 Information processing method and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2392353B (en) * 2002-08-21 2005-11-02 Zarlink Semiconductor Ltd Method and apparatus for distributing timing data across a packet network
CN101841736B (en) * 2009-03-20 2014-03-12 中兴通讯股份有限公司 Method and system for transferring time in passive optical network (PON)
CN101945468B (en) * 2009-07-08 2012-12-26 大唐移动通信设备有限公司 Method, system and device for clock synchronization
CN102130764A (en) * 2010-12-01 2011-07-20 华为技术有限公司 Method, system and device for sending time synchronization information
CN106788854A (en) * 2017-02-08 2017-05-31 上海航天控制技术研究所 A kind of spacecraft time base correction method of high reliability

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102088397A (en) * 2009-12-03 2011-06-08 中兴通讯股份有限公司 Communication network element and clock frequency correction system and method
CN105867778A (en) * 2016-03-28 2016-08-17 联想(北京)有限公司 Information processing method and electronic equipment

Also Published As

Publication number Publication date
CN109217959A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
CN110213614B (en) Method and device for extracting key frame from video file
CN109871385B (en) Method and apparatus for processing data
CN109217959B (en) Method, device and server for synchronizing time
CN111831054B (en) Asynchronous system clock synchronization method, device, system and storage medium
CN115205706B (en) Remote sensing data acquisition method and device, electronic equipment and computer readable medium
CN111309747A (en) Data synchronization method, system and device
CN111898815A (en) Typhoon track prediction method and device, electronic equipment and computer readable medium
CN109787829B (en) Method and device for generating information
CN115391422A (en) Vehicle perception information generation method, apparatus, device, medium, and program product
CN113992469A (en) Data fusion method and device, electronic equipment and computer readable medium
CN111445499B (en) Method and device for identifying target information
CN113780247B (en) Traffic light detection method and device, electronic equipment and computer readable medium
CN111694875B (en) Method and device for outputting information
CN110209849B (en) Method and device for marking key points
CN110553639B (en) Method and apparatus for generating location information
CN107655492B (en) Method and device for inquiring information
CN108875638B (en) Face matching test method, device and system
CN112346870A (en) Model processing method and system
CN111314021A (en) Data transmission method and device, electronic equipment and computer readable storage medium
CN111488928B (en) Method and device for acquiring samples
CN114513548B (en) Directional call information processing method and device
CN112328341B (en) Model display method, device, electronic equipment and storage medium
CN109116357B (en) Method, device and server for synchronizing time
CN111325712B (en) Method and device for detecting image validity
CN116010289B (en) Automatic driving simulation scene test method and device, electronic equipment and readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant