Time synchronization method of AIS forwarding device based on GNSS and AIS message fusion

By using a time synchronization method that integrates GNSS second pulse signals with AIS messages, the time accuracy problem of shipborne AIS forwarding equipment in the absence of network access is solved, achieving accurate timestamps for AIS messages and ensuring data reliability and integrity.

CN121619646BActive Publication Date: 2026-06-02THE NAVIGATION GUARANTEE CENT OF NORTH CHINA SEA NGCN MOT +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
THE NAVIGATION GUARANTEE CENT OF NORTH CHINA SEA NGCN MOT
Filing Date
2026-02-02
Publication Date
2026-06-02

Smart Images

  • Figure CN121619646B_ABST
    Figure CN121619646B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of ship communication, in particular to a time synchronization method of AIS forwarding equipment based on GNSS and AIS message fusion. The AIS forwarding equipment comprises an AIS receiving module, a time synchronization module, an AIS data storage module and a communication module. The time synchronization method comprises: working condition I. If mobile network can be accessed, NTP protocol is used for time calibration, and local clock and second counting module are synchronized; working condition II. If mobile network cannot be accessed, network-free time synchronization mode is started, second counting beat is maintained through GNSS second pulse, and second counting module and local clock are periodically calibrated in combination with UTC second mark in AIS message data, and time stamp is marked for AIS message data. The present application ensures that the forwarding equipment can still mark accurate time with error less than 1 second for stored AIS message under long-time offline state, and provides key technical support for realizing dynamic seamless supervision of ships in whole voyage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ship communication technology, and specifically to a time synchronization method for AIS forwarding equipment based on the fusion of GNSS and AIS messages. Background Technology

[0002] The Automatic Identification System (AIS) is a core technology for ensuring maritime navigation safety and improving maritime regulatory efficiency. However, in vast open seas, oceans, or certain special waters, the reception of AIS shore-based and satellite signals is poor, creating regulatory blind spots. This leads to interruptions in the ship's dynamic information chain, severely restricting applications such as ship trajectory playback, accident tracing, and search and rescue command. To overcome this shortcoming, developing low-cost, highly reliable shipborne AIS data forwarding equipment has become an effective solution. This equipment can automatically store AIS data of the ship itself and nearby vessels in AIS coverage blind spots, and then perform a delay-forwarding process upon entering network coverage areas, thereby achieving seamless continuation of AIS data transmission.

[0003] In AIS systems, the application of historical data is highly dependent on accurate time information. While shore base stations can add timestamps to received packets, shipborne forwarding equipment must perform this task independently in offline mode. The equipment typically has a built-in local clock driven by a common crystal oscillator, which has limited accuracy, with a daily error of ±2.6 seconds. Without calibration, accumulated errors will invalidate the timestamps, rendering the collected data useless. When the ship is within mobile network coverage, the local clock can be periodically calibrated using the Network Time Protocol (NTP). However, when entering a dual blind zone without shore base stations or mobile networks, the equipment becomes completely disconnected from external time references. Therefore, designing a network-independent, high-precision time synchronization algorithm is the bottleneck and core of AIS forwarding equipment development.

[0004] Based on the above background, this invention proposes a time synchronization method for AIS forwarding devices based on the fusion of GNSS and AIS messages, in order to solve the time accuracy problem of AIS forwarding devices in the absence of network. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a time synchronization method for AIS forwarding devices based on the fusion of GNSS and AIS messages. This method can accurately timestamp AIS messages in the absence of network by adjusting the local clock.

[0006] To solve the above problems, the technical solution adopted by the present invention is as follows:

[0007] The key to the time synchronization method for AIS forwarding devices based on GNSS and AIS message fusion lies in the fact that the AIS forwarding device includes:

[0008] The AIS receiving module is connected to the AIS ship station to receive AIS message data in real time and parse the UTC second mark of the AIS message. The AIS message data includes AIS messages broadcast by the ship itself and surrounding ships.

[0009] The time synchronization module includes a local clock and a second counting module. The local clock is connected to the communication module and the AIS receiving module to receive a calibration signal with standard UTC time obtained via the NTP protocol from the communication module when there is a network, and to receive the UTC second mark in the AIS message received by the AIS receiving module when there is no network. The second counting module is connected to the AIS shipboard equipment to receive the GNSS second pulse signal output by the AIS shipboard equipment. The local clock is connected to the second counting module to calibrate and synchronize the local clock time when there is no network.

[0010] The AIS data storage module, which is connected to the time synchronization module and the AIS receiving module, is used to attach a timestamp to the AIS message using the local clock and store it when the AIS receiving module receives the AIS message.

[0011] The communication module, which is connected to the data storage module, is used to obtain standard UTC time via the NTP protocol when accessing the mobile network, and is also used to forward the stored AIS message data with timestamps to the data center in the network coverage area;

[0012] The time synchronization method includes:

[0013] Operating Condition I. If a mobile network can be accessed, the NTP protocol is used for time calibration to synchronize the local clock and the second counter module;

[0014] Operating Condition II. If mobile network access is unavailable, network-free time synchronization mode is activated. The second counting beat is maintained by GNSS second pulses, and the second counting module and local clock are periodically calibrated by combining the UTC second mark in the AIS message data to mark the AIS message data with timestamps.

[0015] As a further improvement of the present invention, step condition I includes the following sub-steps:

[0016] S101, The communication module requests standard UTC time T from the mobile network time server at a preset frequency. NTP and the local clock T LOCAL Forced update to T NTP That is, T LOCAL ←T NTP ;

[0017] S102. Extract the updated second count value S of the local clock. LOCAL The value C of the second counter module PPS Synchronization is S LOCAL C PPS ←S LOCAL After synchronization, the second counting module is driven by the GNSS second pulse.

[0018] As a further improvement of the present invention, in step S101, the preset frequency of the communication module requesting standard UTC time is 30s-2h / time.

[0019] As a further improvement of the present invention, in step S101, the preset frequency of the communication module requesting standard UTC time is 30s-5min / time.

[0020] As a further improvement of the present invention, the following sub-steps are included in condition II:

[0021] S201. Maintaining the Second Counting Cycle: Continuously monitor the GNSS second pulse signal. Whenever a rising edge of the 1PPS signal is detected, increment the second counting module by one and perform a modulo-60 operation. The update formula is: C PPS (t n )=(C PPS (t n-1 )+1)(mod60), where t n t is the rising edge time of the current 1PPS signal. n-1 This refers to the rising edge time of the previous 1PPS signal;

[0022] S202, Real-time Reception and Calibration Second Count Module: Monitors AIS message data in real time. When it receives an AIS message containing a UTC time stamp, it parses out the UTC second stamp S. AIS , will S AIS Compared with the current second count module value C PPS Perform a comparison;

[0023] S203. If the comparison results are inconsistent, according to S... AIS Combine the rising edge of the 1PPS signal with C pps Update, if the rising edge of the 1PPS signal has arrived during the update, then S... AIS Update C after adding 1 PPS That is, C PPS ←S AIS +1, otherwise directly use S AIS Update C PPS C PPS ←S AIS ;

[0024] S204. Calibrate the local clock: Extract the second count value S from the local clock. LOCAL If S LOCAL With calibrated C PPS If they are inconsistent, then C shall prevail. PPS For reference calibration S LOCAL S LOCAL ←C PPS .

[0025] As a further improvement of the present invention, in S204 if S before calibration LOCAL The value is 59 and after calibration, C PPS If the value is 0, then the minutes of the local clock will be incremented by one.

[0026] As a further improvement of the present invention, the GNSS second pulse signal is provided by the GNSS module inside the AIS shipboard equipment.

[0027] As a further improvement of the present invention, the data storage module is a Flash memory or an SD card.

[0028] As a further improvement of the present invention, the AIS forwarding device further includes a power supply module for supplying power to the AIS receiving module, the time synchronization module, the AIS data storage module, and the communication module.

[0029] The beneficial effects of adopting the above technical solution are as follows:

[0030] This invention innovatively integrates the device's local clock, high-precision GNSS pulse-per-second (1PPS) signal, and UTC timestamps in AIS messages, providing a time synchronization method for AIS forwarding devices based on the fusion of GNSS and AIS messages. This method can accurately timestamp AIS messages in the absence of a network by adjusting the local clock.

[0031] The method provided by this invention effectively solves the long-term drift problem of ordinary crystal oscillator local clocks. It ensures the basic timing of time measurement through a 1PPS signal and periodically corrects the reading of the local clock by using the high-precision UTC second information in the AIS message as an external truth reference. This ensures that the forwarding device can still mark the stored AIS message with an error of less than 1 second even when it is offline for a long time, providing key technical support for realizing seamless dynamic monitoring of ships throughout the entire voyage.

[0032] This solution does not rely on external networks, is low in cost, and has high reliability. It can ensure that AIS forwarding devices can still provide reliable timestamps with second-level accuracy for data packets even when they are offline for a long time. It has important theoretical value and practical significance for building a fully covered and highly complete maritime dynamic sensing network. Attached Figure Description

[0033] Figure 1 This is a hardware principle block diagram of the AIS forwarding device of the present invention.

[0034] Figure 2 This is a flowchart of the time synchronization method of the present invention.

[0035] Figure 3 This is a simulation diagram of time error accumulation without AIS calibration in this invention.

[0036] Figure 4 This is a simulation diagram of the time error after the start of the time synchronization algorithm of this invention. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of the present invention clearer, the invention will be described clearly and completely below in conjunction with specific embodiments.

[0038] The present invention proposes a time synchronization method for AIS forwarding devices based on the fusion of GNSS and AIS messages. This method is based on AIS message data forwarding devices. (See also: [link to relevant documentation]). Figure 1 The AIS forwarding device includes an AIS receiving module, a time synchronization module, an AIS data storage module, a communication module, and a power supply module.

[0039] The AIS receiving module is connected to the AIS ship station to receive AIS message data in real time and parse the UTC second mark of the AIS message. The AIS message data includes AIS messages broadcast by the ship itself and surrounding ships.

[0040] The time synchronization module includes a local clock and a second counting module. The local clock is connected to the communication module and the AIS receiving module to receive a calibration signal with standard UTC time obtained via the NTP protocol from the communication module when there is a network, and to receive the UTC second mark in the AIS message received by the AIS receiving module when there is no network. The second counting module is connected to the AIS shipboard equipment to receive the GNSS second pulse signal output by the AIS shipboard equipment. The local clock is connected to the second counting module to calibrate and synchronize the local clock's time when there is no network, and to synchronize the local clock with the second counting module when there is a network.

[0041] The AIS data storage module, which is connected to the time synchronization module and the AIS receiving module, is used to attach a timestamp to the AIS message using the local clock and store it when the AIS receiving module receives the AIS message.

[0042] The communication module, which is connected to the data storage module, is used to obtain standard UTC time via the NTP protocol when accessing the mobile network, and is also used to forward the stored AIS message data to the data center in the network coverage area. The mobile network is specifically a 4G network.

[0043] The power supply module is used to supply power to the AIS receiving module, the time synchronization module, the AIS data storage module, and the communication module.

[0044] The 1PPS signal is output by the AIS shipboard equipment. In essence, it is provided by the GNSS module inside the shipboard equipment. It is an extremely precise metronome that ensures the accuracy of the length and boundaries of the second as a unit of time. It does not contain specific hour, minute, or second values.

[0045] Local clock time (T) LOCAL A time structure containing year, month, day, hour, minute, and second, providing a continuous and uninterrupted time basis, with the second portion denoted as S. LOCAL .

[0046] Second counting module (C) PPS The accuracy of this module is determined by the nanosecond-level precision of the GNSS second pulse. Therefore, the one-second time interval it records is extremely accurate and will not accumulate errors due to local crystal oscillator speed fluctuations. Its core task is to accurately record the passage of each second, unaffected by local clock crystal oscillator drift. The update logic of this module can be described by a concise mathematical formula:

[0047] C PPS (t n )=(C PPS (t n-1 +1)(mod60)

[0048] In the formula C PPS For the seconds counter module itself, it is an integer, always ranging from 0 to 59, corresponding to the number of seconds on the clock; t n The current moment specifically refers to the precise instant when the rising edge of the nth GNSS pulse-per-second (1PPS) signal arrives; t n-1 This refers to the previous moment, which is the instant the (n-1)th second pulse arrives; C PPS (t n-1 ) indicates that at the previous time t n-1 The value of the second counter module. Simply put, it's the count value from the previous second; (mod60) is the modulo 60 operation, responsible for implementing cyclic counting.

[0049] AIS message UTC second stamp (S AISThe second field of the UTC timestamp parsed from the AIS message has a value range of [0, 59]. This value is obtained by the AIS device's own GNSS synchronization and can be considered an error-free true value.

[0050] The time synchronization method for AIS forwarding devices based on GNSS and AIS message fusion includes the following steps:

[0051] Operating Condition I

[0052] When the device can access a mobile network, the highest priority calibration process is performed using the NTP protocol, as follows: Figure 2 The left part shows the following two steps:

[0053] S101: Overlay local clock, meaning the local clock is synchronized with NTP time. The AIS forwarding device requests standard UTC time T from the mobile network time server at a fixed frequency. NTP After obtaining T NTP Then, force an update to the local clock using the following command, which completely rewrites all time registers of the local RTC, including year, month, day, hour, minute, and second, using the network standard time: T LOCAL ←T NTP .

[0054] S102: Synchronizer, i.e., alignment of the seconds counter module. After completing the local clock update, via C... PPS ←S LOCAL The instruction aligns the value of the independent second counter module driven by 1PPS with the second value of the time that was just calibrated, ensuring that all time-related modules within the system are fully synchronized. Afterwards, C... PPS Continue to be driven by the 1PPS signal. This step ensures that even during network calibration intervals, the second jump strictly follows the GNSS beat.

[0055] Operating Condition II

[0056] When a ship enters a mobile blind zone, the network-free time synchronization algorithm is activated, and the algorithm process is as follows: Figure 2 As shown in the right part.

[0057] S201. Maintaining the Second Counting Cycle: The AIS forwarding device continuously monitors the 1PPS signal provided by the AIS device. Whenever a rising edge of a 1PPS pulse is detected, regardless of the local clock, the second counting module C... PPS Perform an increment operation (mod 60). This ensures that even if the local clock crystal oscillator speeds up or slows down, C... PPS The counting rate is always accurate, once per second.

[0058] S202. Real-time reception and calibration: When the AIS forwarding device receives a message containing a UTC timestamp in real time, it immediately parses out the UTC second stamp field S. AIS S AIS The value C of the current seconds counter module PPS And compare with the rising edge of 1pps. To avoid comparison at the instant of minute alternation (e.g., S... AIS =0,C PPS =59) A misjudgment occurs, requiring the addition of a minute-to-flip judgment logic based on the 1pps rising edge. A more robust calibration logic is: once a valid S is received... AIS C PPS The value is forcibly updated to S AIS C PPS ←S AIS .

[0059] S203, regarding C PPS When updating the value, it is necessary to combine it with 1pps for judgment. If C is found during the comparison... PPS With S AIS When an update is about to be performed, a rising edge of 1pps arrives, at which point S needs to be changed. AIS Update C by incrementing its value by 1. PPS This is due to the S encapsulation of the message. AIS The process of transmitting data to the AIS forwarding device for resolution also occurs within 1 second, and there is encapsulation involved. AIS The situation where a rising edge of 1pps is about to arrive. Therefore, when performing C... PPS The update requires consideration of the rising edge of 1pps. This operation uses the absolute second value of the AIS message to correct C. PPS The cumulative deviation may be due to initial equipment startup or signal interference.

[0060] S204, Calibrate Local Clock: Local Clock T LOCAL The second count value S LOCAL Need with precise C PPS To maintain consistency. Due to the drift of the local crystal oscillator, after a period of time, S LOCAL The transition time will gradually deviate from the 1PPS pulse, and S may occur. LOCAL Unlike C PPS In the case of inconsistency, when C is detected... PPS Using T as a reference, calibrate LOCAL The second and minute portions, S LOCAL ←C PPS .

[0061] There may be minute carry-over operations during the calibration process. If S is before calibration... LOCAL The value is 59 and after calibration, C PPSIf T is 0, then T LOCAL The number of minutes needs to be increased by 1.

[0062] Through the above steps, the long-term drift of the local clock is broken down into two problems: the tick accuracy of seconds is guaranteed by 1PPS, and the numerical accuracy of seconds is guaranteed by AIS messages. The combination of these two ensures that the second-level error of the local clock does not accumulate and is always limited to the interval between two valid AIS message calibrations.

[0063] When any AIS message that needs to be stored is received, the device reads the currently calibrated T. LOCAL It is attached to the message as a timestamp and then stored in the storage module.

[0064] Verification Example

[0065] To verify the effectiveness of the algorithm, a test platform was built to simulate a local clock with a daily drift of +2.6 seconds in a network-free environment. Simultaneously, a standard 1PPS signal was input, and AIS message input was simulated. In this embodiment, message number 1 was input every 10 seconds, with its S... AIS The field is synchronized with the standard time. It records the difference between the timestamp marked on the device and the standard UTC time. A simulation diagram showing the accumulation of time errors without AIS calibration is shown below. Figure 3 As shown, the results show that without AIS message calibration, the local clock timestamp error changes over time, accumulating to approximately 0.325 seconds within a 3-hour simulation period.

[0066] The effect after starting the time synchronization algorithm is as follows Figure 4 The error of the local clock, as shown, increases slowly due to crystal oscillator drift. However, whenever a 10-second cycle arrives and a simulated AIS message is received, the error is immediately calibrated, pulling it back to near zero. This results in a clear "sawtooth" pattern in the error curve, and the error value is always kept within a very small range, thus verifying the effectiveness of the algorithm.

[0067] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A time synchronization method for an AIS forwarding device based on GNSS and AIS message fusion, characterized in that, The AIS forwarding device includes: The AIS receiving module is used to receive AIS message data in real time and parse the UTC second mark in the AIS message. The AIS message data includes AIS messages broadcast by this ship and surrounding ships. The time synchronization module includes a local clock and a second counting module. The local clock is used to receive a calibration signal with standard UTC time obtained via the NTP protocol from the communication module when there is a network, and to receive the UTC second mark in the AIS message when there is no network. The second counting module is used to receive the GNSS second pulse signal output by the AIS shipboard equipment. In the absence of a network, the second counting module calibrates and synchronizes the local clock, and in the presence of a network, the local clock synchronizes the second counting module. The AIS data storage module is used to attach a timestamp to the AIS message when the AIS receiving module receives the AIS message, and then store it using a local clock. The communication module is used to obtain standard UTC time via the NTP protocol when accessing the mobile network, and also to forward stored AIS message data with timestamps to the data center in the network coverage area; The time synchronization method includes: Operating Condition I. If a mobile network can be accessed, the NTP protocol is used for time calibration to synchronize the local clock and the second counter module; Operating Condition II. If the mobile network cannot be accessed, the network-free time synchronization mode is activated. The second counting beat is maintained by the GNSS second pulse. The second counting module and the local clock are calibrated by combining the UTC second mark in the AIS message data, and the AIS message data is timestamped. Condition II includes the following sub-steps: S201, maintain the second counting beat: continuously monitor the GNSS second pulse signal, and whenever the rising edge of the 1PPS signal is detected, perform the increment operation on the second counting module and the modulo 60 operation, and the update formula is: C PPS (t n )=(C PPS (t n-1 )+1)(mod60), where t n is the current 1PPS signal rising edge time, t n-1 is the last 1PPS signal rising edge time; S202, real-time receiving and calibrating second counting module: real-time monitoring AIS message data, when receiving AIS message containing UTC time mark, parsing UTC second mark S AIS , S AIS is compared with the current second counting module value C PPS ; S203、If the comparison result is inconsistent, update S AIS C is updated in combination with the rising edge of 1PPS signal pps , if the rising edge of 1PPS signal has come when updating, then S AIS is added 1 and C is updated PPS , that is, C PPS ← S AIS + 1, otherwise directly update C AIS with S PPS , that is, C PPS ← S AIS ; S204, calibrating the local clock: extracting the second count value S of the local clock LOCAL , if S LOCAL is inconsistent with the calibrated C PPS , then calibrating S PPS based on C LOCAL , i.e. S LOCAL ← C PPS .

2. The time synchronization method of claim 1, wherein, Step condition I includes the following sub-steps: S101、The communication module requests the standard UTC time T from the mobile network time server at a preset frequency NTP , and updates the local clock T LOCAL forcibly to T NTP ; S102, extract the second count value S of the updated local clock LOCAL the value C of the second count module is updated PPS synchronization is S LOCAL the second count module is driven by the GNSS second pulse after synchronization 3. The time synchronization method of claim 2, wherein, In step S101, the communication module requests standard UTC time at a preset frequency of 30s-2h / time.

4. The time synchronization method of claim 1, wherein, If the pre-calibration S LOCAL is 59 and the post-calibration C PPS is 0, a one is performed on the number of minutes of the local clock.

5. The time synchronization method of claim 1, wherein, The GNSS second pulse signal is provided by the GNSS module inside the AIS shipboard equipment.

6. The time synchronization method of claim 1, wherein, The data storage module is a Flash memory or an SD card.

7. The time synchronization method of claim 1, wherein, The AIS forwarding device also includes a power module for supplying power to the AIS receiving module, the time synchronization module, the AIS data storage module, and the communication module.