Global navigation satellite system time synchronization method, device, equipment and storage medium

By managing UTC time and local time in the time synchronization controller, and utilizing the characteristics of the second pulse signal, the problem of low time synchronization accuracy in the existing technology is solved, achieving higher-precision time synchronization and ensuring autonomous driving scenarios. Time consistency between vehicles and roadside facilities.

CN113329341BActive Publication Date: 2024-10-18BLACK SESAME TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110642301.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-09
Publication Date
2024-10-18
Estimated Expiration
2041-06-09

AI Technical Summary

Technical Problem

The existing global navigation satellite system time synchronization method has the problem of low time synchronization accuracy in the processor chip. This is mainly due to the uncertain output of NMEA protocol data packets and the processor's parsing delay of the data packets, resulting in uncertainty in obtaining UTC time. Affects the synchronization accuracy of local time.

Method used

By storing and managing the UTC time and local time in the NMEA protocol data packet in the time synchronization controller, the characteristics of the second pulse signal are used to ensure that the UTC time accurately corresponds to the local time corresponding to the second pulse signal, thereby correcting the local clock and improving the time. Synchronization accuracy.

Benefits of technology

It effectively improves the accuracy of time synchronization, avoids time synchronization errors caused by system task scheduling and data packet parsing delays, ensures time consistency between vehicles and roadside facilities, and reduces the risk of misleading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113329341B_ABST
    Figure CN113329341B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for time synchronization of a global navigation satellite system. The method comprises: receiving a NMEA protocol data packet, reading a valid UTC time from the data packet, and storing the read UTC time in a time synchronization controller; receiving a second pulse signal, and capturing the local time output by the local clock at the moment when the second pulse signal is generated, and storing the local time in the time synchronization controller; when the time synchronization controller receives the current local time, it reads the last local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the last local time; the time synchronization controller determines the local time correction amount according to the last local time and the corresponding UTC time, and corrects the local clock according to the local time correction amount. The use of this method can improve the accuracy of time synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of time synchronization, and in particular to a method, apparatus, computer equipment and storage medium for time synchronization of a global navigation satellite system. Background Art

[0002] With the rapid development of autonomous driving technology, the intelligence level of road vehicles and road facilities has been improved, and the demand for high-precision timing of the Global Navigation Satellite System (GNSS) has become increasingly obvious. For example, in an autonomous driving scenario, road participating vehicles usually need to receive road information released by roadside facilities or other vehicles. This information is usually highly time-sensitive, so the vehicles receiving the information should be highly consistent with the time of the roadside facilities. For example, the error should be less than 1ms, otherwise it is very easy to mislead road vehicles and cause traffic accidents. Vehicles and vehicles, and vehicles and roadside equipment cannot share a clock source. In order to synchronize the time of a large number of devices at low cost, high precision, timely and reliably, the global navigation satellite system timing is a common technical means in the field of time synchronization. The global navigation satellite system includes satellite navigation systems such as the Global Positioning System (GPS), BeiDou Navigation Satellite System (BDS), GLONASS and Galileo satellite navigation system (GALILEO). The cost of global navigation satellite system receivers is low, and the error of the output second pulse signal can be controlled within 100ns, which can meet the time synchronization requirements of autonomous driving.

[0003] In a known global navigation satellite system time synchronization method, when the processor chip is time synchronized, after receiving the National Marine Electronics Association (NMEA) protocol data packet from the global navigation satellite system receiver, the processor chip can read the NMEA protocol data packet, parse the NMEA protocol data packet to obtain the coordinated universal time (UTC) time, and then directly synchronize the obtained UTC time to the local time of the processor chip. However, the time when the global navigation satellite system receiver outputs the NMEA protocol data packet is not certain, and the time recorded in the data packet may be output more than 100ms. In addition, there is a delay in the reception and parsing of the NMEA protocol data packet by the processor chip. When the reception and parsing operations are performed on the operating system of the processor chip, they are also affected by the system task scheduling, resulting in uncertainty in the time obtained by UTC, which in turn makes the synchronization accuracy of the local time using the UTC time low.

[0004] The time synchronization accuracy of the above existing global navigation satellite system time synchronization method still has room for improvement. Summary of the invention

[0005] Based on this, it is necessary to provide a global navigation satellite system time synchronization method, device, computer equipment and storage medium that can improve time synchronization accuracy in response to the above technical problems.

[0006] In one aspect, a global navigation satellite system time synchronization method is provided, comprising:

[0007] Receive NMEA protocol data packets, read valid UTC time from the NMEA protocol data packets, and store the read valid UTC time into the time synchronization controller;

[0008] Receive the pulse-per-second signal, capture the local time output by the local clock when the pulse-per-second signal is generated, and store the local time in the time synchronization controller;

[0009] When receiving the current local time, the time synchronization controller reads the last local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the last local time;

[0010] The time synchronization controller determines a local time correction value according to the last local time and the UTC time corresponding to the last local time, and corrects the local clock according to the local time correction value.

[0011] In one embodiment, a NMEA protocol data packet is received, and a valid UTC time is read from the NMEA protocol data packet, and the read valid UTC time is stored in a time synchronization controller, including: waiting for the NMEA protocol data packet; whenever a NMEA protocol data packet is received, parsing the NMEA protocol data packet to obtain a current positioning state and a current UTC time; determining whether the current positioning state is a valid positioning state; when the current positioning state is not a valid positioning state, returning to the step of waiting for the NMEA protocol data packet; when the current positioning state is a valid positioning state, determining that the current UTC time is a valid UTC time, and passing the current valid UTC time to the time synchronization controller, and then returning to the step of waiting for the NMEA protocol data packet; whenever the time synchronization controller receives the UTC time, saving the UTC time with the largest time value as the latest UTC time.

[0012] In one embodiment, whenever a NMEA protocol data packet is received, the NMEA protocol data packet is parsed to obtain the current positioning status and the current UTC time, including: whenever a NMEA protocol data packet is received, if the previous NMEA protocol data packet has not been parsed when the NMEA protocol data packet is received, then the parsing of the previous NMEA protocol data packet is stopped, and the currently received NMEA protocol data packet is parsed to obtain the current positioning status and the current UTC time; if the previous NMEA protocol data packet has been parsed when the NMEA protocol data packet is received, then the currently received NMEA protocol data packet continues to be parsed to obtain the current positioning status and the current UTC time.

[0013] In one embodiment, whenever the time synchronization controller receives UTC time, the UTC time with the largest time value is saved as the latest UTC time, including: whenever the time synchronization controller receives UTC time, the time synchronization controller determines whether the current time synchronization controller is in an idle state or a busy state; the busy state indicates that the time synchronization controller is using the previous local time and the latest UTC time to perform correction on the local clock; when the time synchronization controller is in an idle state, the UTC time with the largest time value is saved as the latest UTC time; when the time synchronization controller is in a busy state, the UTC time with the largest time value is saved as the latest UTC time after waiting for the time synchronization controller to switch to an idle state.

[0014] In one embodiment, whenever the time synchronization controller receives UTC time, the UTC time with the largest time value is saved as the latest UTC time, including: whenever the time synchronization controller receives UTC time, if there is no stored UTC time, the received UTC time is stored as the latest UTC time; if there is a stored UTC time, when the received UTC time is greater than the stored UTC time, the received UTC time is used as the latest UTC time to overwrite the stored UTC time, and when the received UTC time is less than the stored UTC time, the received UTC time is discarded and the stored UTC time is retained as the latest UTC time; the global navigation satellite system time synchronization method also includes: after the time synchronization controller determines the local time correction amount based on the previous local time and the latest UTC time, the latest UTC time is deleted.

[0015] In one embodiment, receiving a second pulse signal, capturing the local time output by the local clock at the time when the second pulse signal is generated, and storing the local time in a time synchronization controller includes: waiting for the second pulse signal; when receiving the second pulse signal, capturing the local time output by the local clock at the time when the second pulse signal is generated, and triggering a second pulse interrupt response, in which the captured local time is passed to the time synchronization controller; whenever the time synchronization controller receives the local time, the local time is passed through a finite length unit impulse response low-pass filter to obtain the local time after low-pass filtering, and the local time after low-pass filtering is saved.

[0016] In one embodiment, when receiving the current local time, the time synchronization controller reads the previous local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the previous local time, including: the time synchronization controller waits to receive the local time; when receiving the current local time, the time synchronization controller reads whether the previous local time has been stored before the current local time; if not, the time synchronization controller returns to the step of waiting to receive the local time; if so, the time synchronization controller reads whether the latest UTC time has been stored; if the time synchronization controller has not yet stored the latest UTC time, the time synchronization controller deletes the previous local time and returns to waiting to receive the local time; if the time synchronization controller has stored the latest UTC time, the stored latest UTC time is read as the UTC time corresponding to the previous local time; the global navigation satellite system time synchronization method also includes: after the time synchronization controller determines the local time correction amount based on the previous local time and the latest UTC time, the previous local time is deleted.

[0017] In one embodiment, the time synchronization controller determines the local time correction value according to the last local time and the UTC time corresponding to the last local time, including: the time synchronization controller passes the last local time and the UTC time corresponding to the last local time through a proportional integral controller to obtain the local time correction value.

[0018] In another aspect, a global navigation satellite system time synchronization device is provided, comprising:

[0019] The NMEA protocol data packet receiving module is used to receive the NMEA protocol data packet, read the valid UTC time from the NMEA protocol data packet, and store the read valid UTC time into the time synchronization controller;

[0020] A pulse-per-second signal receiving module is used to receive the pulse-per-second signal, capture the local time output by the local clock when the pulse-per-second signal is generated, and store the local time in the time synchronization controller;

[0021] The time matching module is used to enable the time synchronization controller to read the last local time stored before the current local time when receiving the current local time, and read the latest stored UTC time as the UTC time corresponding to the last local time;

[0022] The local clock synchronization module is used for the time synchronization controller to determine the local time correction value according to the last local time and the UTC time corresponding to the last local time, and to correct the local clock according to the local time correction value.

[0023] In another aspect, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0024] Receive NMEA protocol data packets, read valid UTC time from the NMEA protocol data packets, and store the read valid UTC time into the time synchronization controller;

[0025] Receive the pulse-per-second signal, capture the local time output by the local clock when the pulse-per-second signal is generated, and store the local time in the time synchronization controller;

[0026] When receiving the current local time, the time synchronization controller reads the last local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the last local time;

[0027] The time synchronization controller determines a local time correction value according to the last local time and the UTC time corresponding to the last local time, and corrects the local clock according to the local time correction value.

[0028] In another aspect, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0029] Receive NMEA protocol data packets, read valid UTC time from the NMEA protocol data packets, and store the read valid UTC time into the time synchronization controller;

[0030] Receive the pulse-per-second signal, capture the local time output by the local clock when the pulse-per-second signal is generated, and store the local time in the time synchronization controller;

[0031] When receiving the current local time, the time synchronization controller reads the last local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the last local time;

[0032] The time synchronization controller determines a local time correction value according to the last local time and the UTC time corresponding to the last local time, and corrects the local clock according to the local time correction value.

[0033] In the above-mentioned global navigation satellite system time synchronization method, device, computer equipment and storage medium, when the time synchronization controller receives the current local time, it reads the previous local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the previous local time. Since the local time captured by the previous second pulse signal is used to perform time correction, this lag correction method is used, and according to the characteristic that the NMEA protocol data packet containing the UTC time corresponding to the second pulse signal output moment must be output after the second pulse signal is generated, the latest UTC time is used as the UTC time corresponding to the local time captured by the previous second pulse signal. Under the condition that the time deviation can also be corrected, the time update point can be fixed, effectively avoiding the situation that when the NMEA data packet fails to parse or the system task scheduling does not complete the parsing before the next second pulse arrives, the local time captured by the current second pulse signal is directly used to correspond to the UTC time, which may correspond to the wrong UTC time, so that the local time captured by the second pulse signal and the UTC time in the NMEA protocol data packet corresponding to the second pulse signal can be accurately matched, thereby effectively improving the accuracy of time synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A diagram of an application environment of a method for synchronizing a global navigation satellite system in an embodiment;

[0035] Figure 2 A software system architecture diagram of an embedded Linux system of a system-on-chip in one embodiment;

[0036] Figure 3 is a schematic diagram of a flow chart of a method for synchronizing a global navigation satellite system time in one embodiment;

[0037] Figure 4 is a schematic diagram of a process flow of a time synchronization controller in one embodiment;

[0038] Figure 5 is a flow chart of a method for synchronizing a global navigation satellite system in an application example;

[0039] Figure 6 FIG. 4 is a structural block diagram of a global navigation satellite system time synchronization device in an embodiment. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0041] The global navigation satellite system time synchronization method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the processor chip 110 is connected to the global navigation satellite system receiver 120, the processor chip 110 receives the NMEA protocol data packet and the pulse per second (PPS) signal from the global navigation satellite system receiver 120 respectively, and executes the global navigation satellite system time synchronization method of any embodiment of the present application to synchronize the processor chip 110. The processor chip 110 can be, for example, a system on chip (System on Chip, SOC), which can be loaded in vehicles and other equipment. The system-level chip has a pulse per second time capture function. When the system-level chip detects a pulse per second signal at its pulse per second pin, at the rising edge or falling edge of the pulse per second signal, the system-level chip can automatically and quickly capture the current local time and store it.

[0042] In each embodiment of the present application, the output of the global navigation satellite system receiver 120 has two basic characteristics: Characteristic 1: The second pulse signal will only be output when the global navigation satellite system is effectively positioned, otherwise, only the NMEA protocol data packet will be output and no second pulse signal will be input; Characteristic 2: The NMEA protocol data packet containing the UTC time corresponding to the second pulse signal output moment must be output after the second pulse signal is generated.

[0043] In one embodiment, taking the processor chip 110 as a system-level chip as an example, the global navigation satellite system time synchronization method provided in the embodiment of the present application can be applied to an embedded Linux system working in the above-mentioned system-level chip 110. For example, the embedded Linux system can have the following Figure 2 The software system architecture shown in .

[0044] The embedded Linux system may include a Linux system service layer and a Linux kernel layer. The Linux system service layer includes a global navigation satellite system service module, a global navigation satellite system positioning information interface, and a system time interface; the Linux kernel layer includes a universal asynchronous receiver / transmitter (UART) driver module, a second pulse driver module, a second pulse interrupt response module, a time synchronization controller, and a system calendar time module. These modules have the following functions:

[0045] Universal asynchronous receiver / transmitter driver module: used to receive NMEA protocol data packets output by the global navigation satellite system receiver. The global navigation satellite system receiver can output NMEA-0183 protocol data packets through the serial port, such as data packets in formats such as GPGGA, GPZDA, and GPRMC. In the method described in this application, it is required to configure the global navigation satellite system receiver to output NMEA protocol data packets with year, month, day, hour, minute, and second information;

[0046] Second pulse driver module: used to configure the second pulse time capture function of the system-level chip. After the configuration is completed, the local time output by the current local clock is quickly captured and saved at the time when the second pulse signal is generated (depending on the situation of the second pulse signal, the second pulse signal generation time may be the rising edge or the falling edge);

[0047] · Second pulse interrupt response module: used to enter the second pulse interrupt response when the second pulse signal is captured, and pass the local time captured by the second pulse driver module to the time synchronization controller in the second pulse interrupt response;

[0048] Time synchronization controller: used to use the local time captured when the second pulse signal is generated and the UTC time corresponding to the local time obtained by parsing the received NMEA-0183 protocol data packet to correct the local time of the local clock.

[0049] Local time module: used to provide the calendar time of the Linux kernel.

[0050] · GNSS service module: used to call the universal asynchronous receiver and transmitter driver interface provided by the Linux kernel, receive the NMEA protocol data packet output by the GNSS receiver, and parse the NMEA protocol data packet to obtain the positioning information and UTC time in the data packet. After parsing and verification, the GNSS service module provides the GNSS positioning information interface to the application, and passes the UTC time to the Linux kernel time synchronization controller through the clock_settime interface.

[0051] The advantage of placing the parsing of NMEA protocol data packets in the global navigation satellite system service module is that the global navigation satellite system service module can not only complete the parsing of NMEA protocol data packets, but also make it more convenient for applications to configure the global navigation satellite system receiver and transmit RTCM data according to receiver signals and actual needs, making it easier to achieve decoupling of the upper and lower layers of the system; in addition, the real-time requirements for the parsing of NMEA protocol data packets are not high, and the global navigation satellite system service module receives system task scheduling management in user mode to avoid affecting the execution of other tasks due to the occupation of resources by parsing work.

[0052] It is understandable that the above Figure 2 The division of each module in the software system architecture shown in is only an example. In other examples, the division of each software module can be flexibly added, deleted or changed to enable the method of the present application to be executed in different software system architectures, as long as the software system architecture can implement the global navigation satellite system time synchronization method of the embodiment of the present application.

[0053] In one embodiment, Figure 3 As shown, a global navigation satellite system time synchronization method is provided, and the method is applied to Figure 1 The processor chip in FIG. 1 is taken as an example to illustrate, and the following steps are included:

[0054] Step S310, receiving a NMEA protocol data packet, and reading a valid UTC time from the NMEA protocol data packet, and storing the read valid UTC time into a time synchronization controller;

[0055] In this step, the NMEA protocol data packet may be received by the processor chip from the global navigation satellite system receiver.

[0056] The NMEA protocol is an RTCM (Radio Technical Commission for Maritime services) standard protocol for global navigation satellite system receivers to output satellite positioning results. The NMEA protocol data packet includes information such as UTC time, longitude and latitude, satellite ephemeris, speed, and positioning status. The global navigation satellite system receiver is generally configured to output the NMEA protocol data packet once at a predetermined time interval (for example, once every 1 second).

[0057] Valid UTC time refers to UTC time that meets predetermined requirements, which may include, for example: the UTC time is the UTC time contained in the NMEA protocol data packet output when the global navigation satellite system effectively positions, and / or the UTC time is the UTC time obtained by parsing the NMEA protocol data packet within a predetermined time period.

[0058] Step S320, receiving the pulse-per-second signal, capturing the local time output by the local clock at the moment when the pulse-per-second signal is generated, and storing the local time in the time synchronization controller;

[0059] In this step, the NMEA protocol data packet is received by the processor chip from the global navigation satellite system receiver.

[0060] Since the output NMEA protocol data packet contains the results of positioning solution, and the data transmission of the communication port (such as the serial port) also takes time, and the processor chip receives and parses the NMEA protocol data packet also takes time, a high-precision second pulse signal output at the whole second is required to notify the processor chip that the current time is the whole second. The processor chip then receives the NMEA data and obtains the actual UTC time corresponding to the whole second.

[0061] The pulse-per-second signal is a pulse-per-second signal output at the whole second. When the receiver is effectively positioned, the pulse-per-second signal output by the receiver will be strictly aligned with the whole second of the satellite's UTC time, so it has a very high timing accuracy (nanosecond accuracy).

[0062] The local clock is the time recorded by the processor chip itself. Taking the processor chip as a system-level chip as an example, its local clock can be the system clock of the embedded system running on the general-purpose processor inside the system-level chip. The local time output by the local clock is the system time of the system clock.

[0063] Step S330, when receiving the current local time, the time synchronization controller reads the last local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the last local time;

[0064] Each time the time synchronization controller receives a local time, it can store the received local time in the time synchronization controller in the order of reception, and each time the time synchronization controller receives a UTC time, it can determine a latest UTC time from the stored UTC time. The time synchronization controller can determine the latest UTC time in different ways, for example, it can only save one latest UTC time, or although it saves multiple UTC times, it can still determine a UTC time with the largest time value as the latest UTC time based on the size of these UTC times.

[0065] Step S340: The time synchronization controller determines a local time correction value according to the last local time and the UTC time corresponding to the last local time, and corrects the local clock according to the local time correction value.

[0066] In this step, the time synchronization controller corrects the local time of the local clock using the local time correction amount determined according to the last local time and the UTC time corresponding to the last local time, so as to complete the time synchronization of the local clock.

[0067] In the above-mentioned global navigation satellite system time synchronization method, when the time synchronization controller receives the current local time, it reads the previous local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the previous local time. Since the local time captured by the current second pulse signal is used to perform the time correction, this delayed correction method is used, and according to the characteristic that the NMEA protocol data packet containing the UTC time corresponding to the output moment of the second pulse signal must be output after the second pulse signal is generated, the latest UTC time is used as the UTC time corresponding to the local time captured by the previous second pulse signal. This can make the time update point fixed, and effectively avoid the situation where the local time captured by the current second pulse signal is directly used to correspond to the UTC time when the NMEA data packet fails to parse or the system task scheduling does not complete the parsing before the next second pulse arrives, and the local time captured by the second pulse signal and the UTC time in the NMEA protocol data packet corresponding to the second pulse signal can be accurately matched, thereby effectively improving the accuracy of time synchronization.

[0068] In one embodiment, receiving a NMEA protocol data packet in step S310, reading a valid UTC time from the NMEA protocol data packet, and storing the read valid UTC time in a time synchronization controller includes:

[0069] Step S311, waiting for NMEA protocol data packet;

[0070] Step S312, whenever a NMEA protocol data packet is received, the NMEA protocol data packet is parsed to obtain the current positioning state and the current UTC time; and whether the current positioning state is a valid positioning state is determined;

[0071] The valid positioning status may include, for example, single-point three-dimensional (3D) positioning, real-time kinematic (RTK) fixed solution, and real-time kinematic floating solution. The NMEA protocol data contains information about the satellite positioning status. For example, the second field of the GPRMC of the NMEA protocol indicates the positioning status, A for valid positioning, and V for invalid positioning.

[0072] Step S313, when the current positioning state is not a valid positioning state, return to the step of waiting for NMEA protocol data packets;

[0073] Step S314, when the current positioning state is a valid positioning state, the current UTC time is determined to be a valid UTC time, and the current valid UTC time is transmitted to the time synchronization controller, and then the process returns to the step of waiting for the NMEA protocol data packet;

[0074] Step S315: Whenever the time synchronization controller receives the UTC time, the UTC time with the largest time value is saved as the latest UTC time.

[0075] In this embodiment, according to the characteristic of the output of the global navigation satellite system receiver that it will output a second pulse signal only when the global navigation satellite system is effectively positioned, the UTC time in the NMEA protocol data packet is transmitted to the time synchronization controller only when the global navigation satellite system is effectively positioned, that is, when the positioning status in the NMEA protocol data packet is valid positioning, thereby avoiding the situation where the time synchronization controller fails to receive the local time corresponding to the second pulse signal but receives the corresponding UTC time, making it difficult for the time synchronization controller to correspond the UTC time to the correct local time, thereby effectively improving the accuracy of the time synchronization controller in performing time synchronization.

[0076] When parsing a NMEA protocol data packet, if the parsing time is too long, the real-time performance of the UTC time obtained by the parsing is poor, and using the UTC time to perform calibration of the local clock will reduce the accuracy of time synchronization. Therefore, it can be considered that when the time spent on parsing the NMEA protocol data packet exceeds a predetermined time threshold, such as exceeding the time interval output by the global navigation satellite system (i.e., the next NMEA protocol data packet has arrived but the parsing of the current NMEA protocol data packet has not been completed), the UTC time of the NMEA protocol data packet with parsing timeout is not used to correct the local time.

[0077] In the above step S315, the UTC time with the largest time value is saved in the time synchronization controller as the latest UTC time. In this way, even if the UTC time in the timed-out NMEA protocol data packet is parsed and transmitted to the time synchronization controller, the UTC time will be replaced by the next UTC time of the NMEA protocol data packet that arrives later as the latest UTC time, so as to avoid the UTC time that has been parsed out of time from being used as the latest UTC time.

[0078] Further, in order to ensure that the UTC time of the NMEA protocol data packet that has timed out is not used to correct the local time, the parsing of the NMEA protocol data packet can also be stopped when the parsing of the current NMEA protocol data packet times out, so as to avoid transmitting the UTC time of the current parsing timed-out data packet to the time synchronization controller. In one embodiment, in step S312, whenever a NMEA protocol data packet is received, the NMEA protocol data packet is parsed to obtain the current positioning state and the current UTC time, including:

[0079] Step S3121, whenever a NMEA protocol data packet is received, if the previous NMEA protocol data packet has not been parsed when the NMEA protocol data packet is received, then stop parsing the previous NMEA protocol data packet and parse the currently received NMEA protocol data packet to obtain the current positioning status and the current UTC time;

[0080] Step S3122: If the previous NMEA protocol data packet has been parsed when the NMEA protocol data packet is received, continue to parse the currently received NMEA protocol data packet to obtain the current positioning status and the current UTC time.

[0081] In this embodiment, if the next NMEA protocol data packet has arrived before the parsing of the current NMEA protocol data packet is completed, the parsing of the current data packet is abandoned and the next NMEA protocol data packet is parsed instead, thereby avoiding transmitting the UTC time of the current parsing timed-out data packet to the time synchronization controller.

[0082] In one embodiment, in step S315, whenever the time synchronization controller receives the UTC time, the UTC time with the largest time value is saved as the latest UTC time, including:

[0083] Step S3151, whenever the time synchronization controller receives the UTC time, the time synchronization controller determines whether the current time synchronization controller is in an idle state or a busy state;

[0084] The busy state indicates that the time synchronization controller is using the last local time and the latest UTC time to perform correction on the local clock; the idle state indicates that the time synchronization controller is not in the state of using the last local time and the latest UTC time to perform correction on the local clock;

[0085] Whenever the time synchronization controller enters steps S330 and S340, the time synchronization controller may mark its own state as being in a busy state, and whenever the time synchronization controller completes steps S330 and S340, it may mark its own state back to being in an idle state.

[0086] Step S3152, when the time synchronization controller is in an idle state, saving the UTC time with the largest time value as the latest UTC time;

[0087] Step S3153: when the time synchronization controller is in a busy state, wait for the time synchronization controller to switch to an idle state, and save the UTC time with the largest time value as the latest UTC time.

[0088] In this embodiment, when the time synchronization controller receives UTC time, the time synchronization controller may currently be using the UTC time of the previous frame for time synchronization. In order to avoid the new UTC time overwriting the UTC time being calculated and causing possible calculation errors, the time synchronization controller waits until it is in an idle state before saving and updating the latest UTC time. Here, in view of the global navigation satellite system receiver characteristic 2 described above, if the time synchronization controller is in the Busy state, the UTC time corresponding to the last second pulse moment must be used at this time.

[0089] In one embodiment, in step S315, whenever the time synchronization controller receives the UTC time, the UTC time with the largest time value is saved as the latest UTC time, including:

[0090] Step S3154, whenever the time synchronization controller receives UTC time, if there is no stored UTC time, the received UTC time is stored as the latest UTC time;

[0091] Step S3155: If there is a stored UTC time, when the received UTC time is greater than the stored UTC time, the received UTC time is used as the latest UTC time to overwrite the stored UTC time; when the received UTC time is less than the stored UTC time, the received UTC time is discarded and the stored UTC time is retained as the latest UTC time;

[0092] The global navigation satellite system time synchronization method also includes:

[0093] Step S350: After the time synchronization controller determines the local time correction value according to the previous local time and the latest UTC time, the latest UTC time is deleted.

[0094] In this embodiment, the time synchronization controller only saves the latest UTC time with the largest time value. When a new UTC time arrives, the UTC time with a larger time value will overwrite the UTC time with a smaller time value. The latest UTC time will be deleted after use to avoid resource waste and data interference caused by saving redundant UTC time.

[0095] It can be understood that the above two embodiments can be executed in combination, that is, in step S315, the time synchronization controller can wait until it is in an idle state before saving the UTC time with the largest time value as the latest UTC time, and only save the latest UTC time with the largest time value, which will be deleted after use.

[0096] In one embodiment, receiving the pulse per second signal in step S320, capturing the local time output by the local clock at the time when the pulse per second signal is generated, and storing the local time in the time synchronization controller includes:

[0097] Step S321, waiting for the pulse-per-second signal;

[0098] Step S322, when receiving the pulse-per-second signal, capturing the local time output by the local clock when the pulse-per-second signal is generated, and triggering a pulse-per-second interrupt response, in which the captured local time is transmitted to the time synchronization controller;

[0099] Step S323: Whenever the time synchronization controller receives the local time, the local time is filtered through a finite impulse response (FIR) low-pass filter to obtain the low-pass filtered local time, and the low-pass filtered local time is saved.

[0100] In this embodiment, the use of a finite length unit impulse response filter can smooth the noise of the pulse-per-second signal and the noise of the system time capture and maintain phase linearity.

[0101] In one embodiment, in step S330, when the time synchronization controller receives the current local time, it reads the last local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the last local time, including:

[0102] Step S323, the time synchronization controller waits to receive the local time;

[0103] Step S323, when receiving the current local time, the time synchronization controller reads whether a previous local time has been stored before the current local time;

[0104] If the previous local time is not stored before the current local time, step S323 is executed, and the time synchronization controller returns to the step of waiting to receive the local time;

[0105] If the previous local time has been stored before the current local time, then step S323 is executed, and the time synchronization controller reads whether the latest UTC time has been stored;

[0106] If the time synchronization controller has not stored the latest UTC time, step S323 is executed, the time synchronization controller deletes the previous local time, and returns to wait for receiving the local time;

[0107] If the time synchronization controller has stored the latest UTC time, step S323 is executed to read the stored latest UTC time as the UTC time corresponding to the previous local time;

[0108] The global navigation satellite system time synchronization method also includes:

[0109] Step S360: After the time synchronization controller determines the local time correction value according to the previous local time and the latest UTC time, the previous local time is deleted.

[0110] In the aforementioned embodiment of the present application, it is considered that when the time spent on parsing the NMEA protocol data packet exceeds the time interval output by the global navigation satellite system, the UTC time of the NMEA protocol data packet whose parsing has timed out is not used to correct the local time. However, the pulse-per-second signal corresponding to the NMEA protocol data packet whose parsing has timed out can still be received and the local time when the pulse-per-second signal is generated can be captured. In order to avoid the local time captured by the pulse-per-second signal corresponding to the timed-out NMEA protocol data packet being mistakenly corresponded to other UTC times, in this embodiment, if it is determined in step S323 that the time synchronization controller has not yet stored the latest UTC time, it means that after the last pulse-per-second is generated, the UTC time parsed by the system may not be received in time due to parsing failure or parsing delay, then in step S323, the time synchronization controller deletes the last local time and returns to wait for receiving the local time. Thereby effectively avoiding the use of the last local time captured by the pulse-per-second signal corresponding to the timed-out NMEA protocol data packet in time synchronization, so as to further improve the accuracy of time synchronization.

[0111] In one embodiment, in step S350, the time synchronization controller determines the local time correction value based on the last local time and the UTC time corresponding to the last local time, including: the time synchronization controller passes the last local time and the UTC time corresponding to the last local time through a proportional integral (PI) controller to obtain the local time correction value.

[0112] In this embodiment, the local time correction amount is obtained by passing the previous local time and the UTC time corresponding to the previous local time through a proportional-integral controller, and the local time correction amount is used to correct the local time, thereby avoiding the time jump that may be caused by directly using the UTC time to correct the local time, and effectively improving the accuracy and smoothness of the time correction.

[0113] In one embodiment, the time synchronization controller passes the previous local time and the UTC time corresponding to the previous local time through a proportional-integral controller to obtain a local time correction, including: the time synchronization controller passes the previous local time and the UTC time corresponding to the previous local time through a proportional-integral controller to subtract the previous local time from the UTC time corresponding to the previous local time to obtain a time difference, passes the time difference through a proportional link and an integral link respectively, and then adds the output value of the proportional link to the output value obtained by the integral link to obtain the local time correction.

[0114] Among them, the proportional integral controller includes a proportional link (P) and an integral link (I). The proportional link is used to adjust the input object to respond quickly, and the integral link is used to adjust the degree to which the input object reaches the ideal result. The processing performed by the time synchronization controller can be seen in Figure 4 shown.

[0115] In order to make the technical solutions of the global navigation satellite system time synchronization method of each embodiment of the present application clearer and easier to understand, a specific application example is listed below. In this application example, the steps of the global navigation satellite system time synchronization method of each embodiment of the present application are combined. Figure 2 Take the embedded Linux system shown in as an example, accordingly, the local clock is the system clock of the embedded Linux system, and the local time is the system time of the embedded Linux system. The processing flow of the global navigation satellite system time synchronization method in this application example can be referred to Figure 5 shown.

[0116] The global navigation satellite system time synchronization method in this application example can be divided into two parts: a NMEA response process and a second pulse response process, which are executed in parallel on two threads.

[0117] In thread 1, the NMEA response process includes the following steps:

[0118] Step S501, the Linux operating system is powered on to start the global navigation satellite system service module, or the user's application software starts the global navigation satellite system service module, the global navigation satellite system service module configures the parameters of the port used to read data, and configures the parameters of the global navigation satellite system receiver to output the NMEA protocol data packet, so that the NMEA protocol data packet output by the global navigation satellite system contains UTC time information, and the global navigation satellite system receiver can also be configured to output a combination of multiple NMEA protocol data packets;

[0119] Step S502, the global navigation satellite system service module waits for the NMEA protocol data packet;

[0120] Step S503: After receiving the NMEA protocol data packet, the GNSS service module parses the NMEA protocol data packet according to the NMEA-0183 protocol to obtain the positioning status and the UTC time T of the current i-th moment. UTC (i) The data parsing of NMEA protocol data packets should be controlled within the time interval of the second pulse output, that is, within 1s. If it exceeds 1s, the parsing of the data NMEA protocol data packet will be stopped and the NMEA protocol data packet will be discarded;

[0121] Step S504, the GNSS service module determines whether the current positioning state is a valid positioning state. If not, it returns to S502 and continues to wait for the NMEA protocol data packet; if so, it proceeds to step S505;

[0122] Step S505: The GNSS service module calls the clock_settime system call function to pass CLOCK_REALTIME and UTC time T to the time synchronization controller. UTC (i) Two parameters. CLOCK_REALTIME is an input parameter of clock_settime, which is used to indicate that the input time is the system real-time clock. After the parameters are successfully input, return to S502;

[0123] Step S506, the time synchronization controller waits until it is in an idle state;

[0124] Specifically, the time synchronization controller determines whether the current time synchronization controller is in an idle state or a busy state; if it is in an idle state, it directly enters step S507; if it is in a busy state, it waits until it is in an idle state before entering step S507.

[0125] Here, in view of the GNSS receiver characteristic 2 mentioned above, if the time synchronization controller is in a busy state, the UTC time T corresponding to the last second pulse moment must be used at this time.UTC (i-1).

[0126] Step S507, the time synchronization controller updates the saved latest UTC time;

[0127] The time synchronization controller waits until it is in the free state before using the UTC time T UTC (i) Save and update the latest UTC time T UTC The time synchronization controller only stores the latest UTC time T. UTC , when the latest UTC time T is saved UTC After being used for time synchronization, the latest UTC time T used is deleted UTC .

[0128] In Thread II, the pulse-per-second response process includes the following steps:

[0129] Step S511, the GNSS service module configures the pulse-per-second output parameters of the GNSS receiver, including configuring the pulse-per-second automatic capture system time, pulse-per-second interrupt response, and pulse-per-second response mode (rising edge or falling edge) of the system-level chip;

[0130] Step S512, the pulse-per-second driving module waits for the pulse-per-second signal;

[0131] Step S513: When receiving the pulse-per-second signal, the pulse-per-second driving module captures the system time T output by the system clock at the moment when the pulse-per-second signal is generated. sys (i) and trigger the pulse-per-second interrupt response module to enter the pulse-per-second interrupt response. In the pulse-per-second interrupt response, the pulse-per-second interrupt response module obtains the captured system time T from the pulse-per-second driving module. sys (i) Set the system time T sys (i) transmitting to a time synchronization controller;

[0132] Step S514: the time synchronization controller receives the system time T sys (i) After passing through a finite length unit impulse response low-pass filter, the system time T after low-pass filtering is obtained sys (i).

[0133] Step S515: the time synchronization controller converts the low-pass filtered system time T sys (i) Stored in the system time series.

[0134] Step S516: The time synchronization controller determines whether the currently received system time T sys(i) Whether it is the first data (i.e., the earliest received data), that is, whether the previous system time has been stored before the current system time is read; if it is the first data, it means that the previous system time has not been stored before the current system time, and then the process returns to step S512 and continues to wait for the next second pulse signal; if it is not the first data, it means that the previous system time has been stored before the current system time, and then the process proceeds to step S517;

[0135] Step S517, the time synchronization controller changes its own state from the idle state to the busy state, and checks whether the latest UTC time is currently saved. In view of the characteristics 1 and 2 of the global navigation satellite system receiver, the latest UTC time T UTC It must be the last system time T captured at the last second pulse moment sys (i-1) corresponds to UTC time T UTC (i-1). If not, it means that after the last second pulse was generated, the time synchronization controller did not receive the parsed UTC time in time due to the NMEA protocol data packet parsing timeout or parsing failure, then the stored last system time is deleted from the system time sequence, and the process returns to step S512; if there is a saved T UTC (i-1), then go to step S518;

[0136] Step S518: The time synchronization controller sets the previous system time T sys (i-1) and the UTC time T corresponding to the previous system time UTC (i-1) The system time correction is obtained through the proportional integral controller;

[0137] Step S519: the time synchronization controller adjusts the system time of the system clock according to the system time correction value to complete the time synchronization of the system clock. After completing the time synchronization, the time synchronization controller deletes the saved UTC time T UTC (i-1) and the system time T stored in the system time series sys (i-1), change its own state from busy state to idle state, and then return to step S512.

[0138] It should be understood that although Figure 3-5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3-5At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0139] In one embodiment, Figure 6 As shown, a global navigation satellite system time synchronization device 600 is provided, comprising:

[0140] The NMEA protocol data packet receiving module 610 is used to receive the NMEA protocol data packet, read the valid UTC time from the NMEA protocol data packet, and store the read valid UTC time into the time synchronization controller;

[0141] The pulse-per-second signal receiving module 620 is used to receive the pulse-per-second signal, capture the local time output by the local clock when the pulse-per-second signal is generated, and store the local time in the time synchronization controller; sys(i)

[0142] The time matching module 630 is used to enable the time synchronization controller to read the last local time stored before the current local time when receiving the current local time, and read the latest stored UTC time as the UTC time corresponding to the last local time;

[0143] The local clock synchronization module 640 is used for the time synchronization controller to determine the local time correction value according to the last local time and the UTC time corresponding to the last local time, and to correct the local clock according to the local time correction value.

[0144] For the specific definition of the global navigation satellite system time synchronization device 600, please refer to the definition of the global navigation satellite system time synchronization method above, which will not be repeated here. Each module in the above-mentioned global navigation satellite system time synchronization device 600 can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0145] In one embodiment, a computer device is provided, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:

[0146] Receive NMEA protocol data packets, read valid UTC time from the NMEA protocol data packets, and store the read valid UTC time into the time synchronization controller;

[0147] Receive the pulse-per-second signal, capture the local time output by the local clock when the pulse-per-second signal is generated, and store the local time in the time synchronization controller;

[0148] When receiving the current local time, the time synchronization controller reads the last local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the last local time;

[0149] The time synchronization controller determines a local time correction value according to the last local time and the UTC time corresponding to the last local time, and corrects the local clock according to the local time correction value.

[0150] The computer device may be, for example, a system-on-chip.

[0151] In other embodiments, when the processor executes the computer program, it also implements the global navigation satellite system time synchronization method of any of the above embodiments, and has corresponding beneficial effects.

[0152] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0153] Receive NMEA protocol data packets, read valid UTC time from the NMEA protocol data packets, and store the read valid UTC time into the time synchronization controller;

[0154] Receive the pulse-per-second signal, capture the local time output by the local clock when the pulse-per-second signal is generated, and store the local time in the time synchronization controller;

[0155] When receiving the current local time, the time synchronization controller reads the last local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the last local time;

[0156] The time synchronization controller determines a local time correction value according to the last local time and the UTC time corresponding to the last local time, and corrects the local clock according to the local time correction value.

[0157] In other embodiments, when the computer program is executed by the processor, the global navigation satellite system time synchronization method of any of the above embodiments is also implemented, and has corresponding beneficial effects.

[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0160] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A global navigation satellite system time synchronization method, the method comprising: Receive a NMEA protocol data packet, read a valid UTC time from the NMEA protocol data packet, and store the read valid UTC time into a time synchronization controller; Receive a pulse-per-second signal, and capture the local time output by the local clock when the pulse-per-second signal is generated, and store the local time in the time synchronization controller; wherein the output time of each pulse-per-second signal is aligned with the corresponding UTC time; When receiving the current local time captured at the time when the current second pulse signal is generated, the time synchronization controller reads the previous local time captured at the time when the previous second pulse signal is generated and stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the previous local time; The time synchronization controller determines a local time correction value according to the last local time and a UTC time corresponding to the last local time, and corrects the local clock according to the local time correction value.

2. The method for GNSS time synchronization according to claim 1, characterized in that: The receiving of the NMEA protocol data packet, and reading the valid UTC time from the NMEA protocol data packet, and storing the read valid UTC time into the time synchronization controller, comprises: Waiting for NMEA protocol data packet; Whenever a NMEA protocol data packet is received, the NMEA protocol data packet is parsed to obtain the current positioning state and the current UTC time; and whether the current positioning state is a valid positioning state is determined; When the current positioning state is not a valid positioning state, returning to the step of waiting for the NMEA protocol data packet; When the current positioning state is a valid positioning state, the current UTC time is determined to be a valid UTC time, and the current valid UTC time is transmitted to the time synchronization controller, and then the step of waiting for the NMEA protocol data packet is returned; Whenever the time synchronization controller receives the UTC time, the UTC time with the largest time value is saved as the latest UTC time.

3. The method for GNSS time synchronization according to claim 2, characterized in that: Whenever a NMEA protocol data packet is received, the NMEA protocol data packet is parsed to obtain the current positioning status and the current UTC time, including: Whenever a NMEA protocol data packet is received, if the previous NMEA protocol data packet has not been parsed when the NMEA protocol data packet is received, the parsing of the previous NMEA protocol data packet is stopped, and the currently received NMEA protocol data packet is parsed to obtain the current positioning status and the current UTC time; If the previous NMEA protocol data packet has been parsed when a NMEA protocol data packet is received, the currently received NMEA protocol data packet continues to be parsed to obtain the current positioning state and the current UTC time.

4. The method for GNSS time synchronization according to claim 2, characterized in that: Whenever the time synchronization controller receives the UTC time, the UTC time with the largest time value is saved as the latest UTC time, including: Whenever the time synchronization controller receives UTC time, the time synchronization controller determines whether the time synchronization controller is currently in an idle state or a busy state; the busy state indicates that the time synchronization controller is using the last local time and the latest UTC time to perform correction on the local clock; When the time synchronization controller is in an idle state, the UTC time with the largest time value is saved as the latest UTC time; When the time synchronization controller is in a busy state, the UTC time with the largest time value is saved as the latest UTC time after the time synchronization controller is switched to an idle state.

5. The method for GNSS time synchronization according to claim 2, characterized in that: Whenever the time synchronization controller receives the UTC time, the UTC time with the largest time value is saved as the latest UTC time, including: Whenever the time synchronization controller receives UTC time, if there is no stored UTC time, the received UTC time is stored as the latest UTC time; If there is a stored UTC time, when the received UTC time is greater than the stored UTC time, the received UTC time is used as the latest UTC time to overwrite the stored UTC time; when the received UTC time is less than the stored UTC time, the received UTC time is discarded and the stored UTC time is retained as the latest UTC time; The method further comprises: After the time synchronization controller determines the local time correction amount according to the previous local time and the latest UTC time, the latest UTC time is deleted.

6. The method for GNSS time synchronization according to any one of claims 1 to 5, characterized in that: The receiving of the pulse-per-second signal, capturing the local time output by the local clock at the time when the pulse-per-second signal is generated, and storing the local time in the time synchronization controller comprises: Wait for the second pulse signal; When receiving a second pulse signal, capturing the local time output by the local clock at the time when the second pulse signal is generated, and triggering a second pulse interrupt response, in which the captured local time is transmitted to the time synchronization controller; Whenever the time synchronization controller receives the local time, the local time is passed through a finite length unit impulse response low-pass filter to obtain the local time after low-pass filtering, and the local time after low-pass filtering is saved.

7. The method for GNSS time synchronization according to any one of claims 1 to 5, characterized in that: When receiving the current local time, the time synchronization controller reads the last local time stored before the current local time, and reads the latest stored UTC time as the UTC time corresponding to the last local time, including: The time synchronization controller waits to receive the local time; When receiving the current local time, the time synchronization controller reads whether a previous local time has been stored before the current local time; If not, the time synchronization controller returns to the step of waiting to receive the local time; If yes, the time synchronization controller reads whether the latest UTC time has been stored; If the time synchronization controller has not stored the latest UTC time, the time synchronization controller deletes the previous local time and returns to the waiting for receiving local time; If the time synchronization controller has stored the latest UTC time, reading the stored latest UTC time as the UTC time corresponding to the previous local time; The method further comprises: After the time synchronization controller determines the local time correction amount according to the previous local time and the latest UTC time, the previous local time is deleted.

8. The method for GNSS time synchronization according to any one of claims 1 to 5, characterized in that: The time synchronization controller determines the local time correction value according to the last local time and the UTC time corresponding to the last local time, including: The time synchronization controller passes the last local time and the UTC time corresponding to the last local time through a proportional integral controller to obtain a local time correction value.

9. A global navigation satellite system time synchronization device, characterized in that: The device comprises: A NMEA protocol data packet receiving module, used for receiving a NMEA protocol data packet, and reading a valid UTC time from the NMEA protocol data packet, and storing the read valid UTC time into a time synchronization controller; A pulse-per-second signal receiving module, used to receive a pulse-per-second signal, and capture the local time output by the local clock when the pulse-per-second signal is generated, and store the local time into the time synchronization controller; wherein the output time of each pulse-per-second signal is aligned with the corresponding UTC time; A time matching module, configured to enable the time synchronization controller to read the last local time captured at the last second pulse signal generation time stored before the current local time when receiving the current local time captured at the current second pulse signal generation time, and read the latest stored UTC time as the UTC time corresponding to the last local time; The local clock synchronization module is used for the time synchronization controller to determine the local time correction value according to the previous local time and the UTC time corresponding to the previous local time, and to correct the local clock according to the local time correction value.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the global navigation satellite system time synchronization method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the global navigation satellite system time synchronization method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Timing terminal

    CN107037722A