CN117908630A - High-precision time service system and method based on PCIE board card - Google Patents
High-precision time service system and method based on PCIE board card Download PDFInfo
- Publication number
- CN117908630A CN117908630A CN202311782164.XA CN202311782164A CN117908630A CN 117908630 A CN117908630 A CN 117908630A CN 202311782164 A CN202311782164 A CN 202311782164A CN 117908630 A CN117908630 A CN 117908630A
- Authority
- CN
- China
- Prior art keywords
- time
- pulse signal
- millisecond
- board card
- millisecond pulse
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 20
- 239000013078 crystal Substances 0.000 claims description 12
- 230000001360 synchronised effect Effects 0.000 claims description 9
- 238000010586 diagram Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Landscapes
- Electric Clocks (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
The invention discloses a high-precision time service system and method based on PCIE boards, and relates to the technical field of non-real-time operation system time service. The method comprises the following steps: receiving a second pulse signal T and a millisecond pulse signal T which are output by a PCIE board card; recording the time stamp of the received millisecond pulse signal, and recording the time stamp of the received second pulse signal; meanwhile, counting the millisecond pulse signals after receiving one millisecond pulse signal, and clearing millisecond pulse count after receiving the second pulse signal; calculating an error between the received millisecond pulse signal and the millisecond pulse signal output by the PCIE board card; capturing the time with the minimum error between the PCIE board card and the local time, immediately modifying the time of the system to be the current time at the moment, and completing one time service correction; repeating the steps to finish high-precision time service. The invention saves the computing resource while realizing the high-precision time service of the non-real-time system.
Description
Technical Field
The invention relates to the technical field of non-real-time operation system time service, in particular to a high-precision time service system and method based on a PCIE board card.
Background
The automatic time service method of the non-real-time operating system (windows, linux) system in the market at present is mainly an NTP network time service method, the NTP time service is affected by the asymmetry of network transmission, and the precision can only reach the millisecond level. The time service precision of the PCIE board card can be made to be a subtle level, the time service frequency can be improved, and the time precision of the operating system running environment can be improved.
The difficulty of non-real time operating system timing is that the system cannot respond to the interrupt signal of the external board card in real time. The signal entering the system needs to wait in the message queue, and the interrupt signal entering the system can not be responded until the previous task is processed, and the number of the previous tasks in the current system is also uncertain, so that errors are not well known, and the time cannot be accurately transmitted. In addition, referring to fig. 3, the pcie board sends out pulses with a second signal and a millisecond signal, the pulse signals received by the system are often delayed, on the other hand, the actual signal time has randomness due to the time slices of time service, and the pulse signals for time service have unavoidable errors, so that the sent pulse signals and the received pulse signals cannot be consistent all the time.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides a high-precision time service system and method based on a PCIE board card, which reduce the time difference between the board card and a non-real-time operation system and achieve the purpose of high-precision time service.
The aim of the invention is realized by the following technical scheme:
First aspect:
A high-precision time service system based on PCIE board card includes: the system comprises an antenna, a time server, a clock synchronization switch, a plurality of PCIE boards and a plurality of host servers;
the antenna is connected with the N-F port of the time server and is used for receiving satellite signals and providing a reference clock for the time server;
The time server is also connected with the clock synchronous switch through an RJ45 interface and is used for acquiring actual time according to a reference clock and transmitting time information to the clock synchronous switch by utilizing a computer network;
The clock synchronization switch is used for providing PTP signals to the PCIE board card according to a reference clock source;
The PCIE board is connected with the clock synchronous switch network and is used for providing a second pulse signal and a millisecond pulse signal for the host server according to satellite signals or PTP signals;
The host server is connected with the PCIE board card in one-to-one correspondence, and performs accurate time service and correction on the local time according to the received second pulse signal and millisecond pulse signal.
Further, the PCIE board card comprises a signal receiving unit, a time difference measuring unit, a central processing unit, a crystal oscillator, a second pulse generating unit and a millisecond pulse generating unit;
The signal receiving unit is used for analyzing the received satellite signals or PTP signals into time signals and sending the time signals to the time difference measuring unit;
the time difference measuring unit is used for calculating the difference value between the local time and the input reference time according to the time signal and sending the difference value to the central processing unit;
the central processing unit is used for adjusting the crystal oscillator frequency according to the difference value and controlling the starting of the timer according to the crystal oscillator frequency change;
The crystal oscillator is used for generating a clock signal;
the second pulse generating unit is used for triggering the second timer to generate an output second pulse signal through the central processing unit;
The millisecond pulse generating unit is used for triggering the millisecond timer to generate an output millisecond pulse signal through the output second pulse signal.
Further, the host server is a non-real-time operating system and comprises a pulse receiving module, a time service error calculating module and a time service correcting module.
Second aspect:
A PCIE board card based high precision time service method, the method being executed by the host server according to any one of the first aspect, comprising the steps of:
(1) Receiving a second pulse signal T and a millisecond pulse signal T output by the PCIE board card of any one of claims 1-3;
(2) Recording the time stamp of the received millisecond pulse signal, denoted T n, where n=1, 2,3,..1000, recording the time stamp of the received second pulse signal, denoted T 0; meanwhile, counting the millisecond pulse signals after receiving the millisecond pulse signals, recording the millisecond pulse signals as N, and clearing the millisecond pulse count N after receiving the second pulse signals; calculating an error between the received millisecond pulse signal and the millisecond pulse signal output by the PCIE board card;
(3) Capturing the time with the minimum error between the PCIE board card and the local time, immediately modifying the time of the system to be the current time at the moment, and completing one time service correction;
(4) Repeating the steps (2) - (3) to finish high-precision time service.
Further, the time stamp of the millisecond pulse signal and the time stamp of the second pulse signal are in microsecond level.
Further, the specific step of calculating the error between the received millisecond pulse signal and the millisecond pulse signal output by the PCIE board card in the step (2) includes:
Based on the millisecond pulse count N, the microsecond theoretical time difference T N,TN of the current millisecond pulse signal received with respect to the last second pulse time is calculated by the following formula:
;
Based on the recorded time stamp T n of the received current millisecond pulse signal and the time stamp T0 of the last second pulse time, the microsecond actual time difference value of the current operating system relative to the last second pulse time when the current millisecond pulse signal is received is calculated through the following formula :
;
Calculating a theoretical time difference T N and an actual time differenceAnd setting a time difference threshold T w according to the time difference, and when the absolute value of the time difference is smaller than the time difference threshold T w, considering the current time as the time with the minimum error between the PCIE board card and the local time.
The beneficial effects of the invention are as follows:
the invention uses PCIE board card with time service precision reaching microsecond level to time service the non-real-time operation system, captures the relative accurate time of millisecond pulse, corrects the local time of the system for many times while time service, and saves the computing resource of the computer. This is because there are 999 millisecond pulses between two second pulses, and the millisecond pulses, although not having an absolute coincidence moment, also have a relatively close moment, the invention can achieve coincidence of system time accuracy and board height only by correcting at the moment judged to be close. The time stamp can reach a subtle level, and the system time can be consistent with the board card after repeated for a plurality of times.
Drawings
FIG. 1 is a schematic diagram of a high-precision time service system according to a first embodiment of the present invention;
Fig. 2 is a block diagram of a PCIE board card composition module according to the first embodiment of the present invention;
fig. 3 is a schematic diagram of a high-precision time service method according to a second embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments, and it is apparent that the described embodiments are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by a person skilled in the art without any inventive effort, are intended to be within the scope of the present invention, based on the embodiments of the present invention.
Referring to fig. 1-3, the present invention provides a technical solution:
Embodiment one:
A high-precision time service system based on PCIE board card includes: the system comprises an antenna, a time server, a clock synchronization switch, a plurality of PCIE boards and a plurality of host servers, wherein the schematic diagram of the system is shown in figure 1;
the antenna is connected with the N-F port of the time server and is used for receiving satellite signals and providing a reference clock for the time server;
The time server is also connected with the clock synchronous switch through an RJ45 interface and is used for acquiring actual time according to a reference clock and transmitting time information to the clock synchronous switch by utilizing a computer network;
The clock synchronization switch is used for providing PTP signals to the PCIE board card according to a reference clock source;
The PCIE board is connected with the clock synchronous switch network and is used for providing a second pulse signal and a millisecond pulse signal for the host server according to satellite signals or PTP signals;
The host server is connected with the PCIE board card in one-to-one correspondence, and performs accurate time service and correction on the local time according to the received second pulse signal and millisecond pulse signal.
As shown in fig. 2, the PCIE board card includes a signal receiving unit, a time difference measuring unit, a central processing unit, a crystal oscillator, a second pulse generating unit and a millisecond pulse generating unit;
The signal receiving unit is used for analyzing the received satellite signals or PTP signals into time signals and sending the time signals to the time difference measuring unit;
the time difference measuring unit is used for calculating the difference value between the local time and the input reference time according to the time signal and sending the difference value to the central processing unit;
the central processing unit is used for adjusting the crystal oscillator frequency according to the difference value and controlling the starting of the timer according to the crystal oscillator frequency change;
The crystal oscillator is used for generating a clock signal;
the second pulse generating unit is used for triggering the second timer to generate an output second pulse signal through the central processing unit;
The millisecond pulse generating unit is used for triggering the millisecond timer to generate an output millisecond pulse signal through the output second pulse signal.
The process of triggering the millisecond timer by the second pulse signal is that the millisecond timer is triggered to start when the second pulse signal is output, and 1000 pulses with 1 millisecond interval are continuously output.
Further, the host server is a non-real-time operating system and comprises a pulse receiving module, a time service error calculating module and a time service correcting module.
Embodiment two:
A PCIE board card based high precision time service method, the method being executed by the host server according to any one of the first aspect, comprising the steps of:
(1) Receiving a second pulse signal T and a millisecond pulse signal T output by the PCIE board card as described in embodiment one;
(2) Recording the time stamp of the received millisecond pulse signal, denoted T n, where n=1, 2,3,..1000, recording the time stamp of the received second pulse signal, denoted T 0; meanwhile, counting the millisecond pulse signals after receiving the millisecond pulse signals, recording the millisecond pulse signals as N, and clearing the millisecond pulse count N after receiving the second pulse signals; calculating an error between the received millisecond pulse signal and the millisecond pulse signal output by the PCIE board card;
(3) Capturing the time with the minimum error between the PCIE board card and the local time, immediately modifying the time of the system to be the current time at the moment, and completing one time service correction;
(4) Repeating the steps (2) - (3) to finish high-precision time service.
Further, the time stamp of the millisecond pulse signal and the time stamp of the second pulse signal are in microsecond level.
As shown in fig. 3, the PCIE board emits pulses with a second signal and a millisecond signal, and the millisecond pulse interval of two adjacent intervals is 1ms. Two adjacent pulses per second are separated by 1 second, with 999 pulses per millisecond. Because the pulse signals received by the system always lag the actual signal time, the lag time is inconsistent due to the uneven size of the time slices, and the signals are always sent and received without consistency.
In this embodiment, the specific step of calculating the error between the received millisecond pulse signal and the millisecond pulse signal output by the PCIE board card in step (2) includes:
Based on the millisecond pulse count N, the microsecond theoretical time difference T N,TN of the current millisecond pulse signal received with respect to the last second pulse time is calculated by the following formula:
;
Based on the recorded time stamp T n of the received current millisecond pulse signal and the time stamp T0 of the last second pulse time, the microsecond actual time difference value of the current operating system relative to the last second pulse time when the current millisecond pulse signal is received is calculated through the following formula :
;
Calculating a theoretical time difference T N and an actual time differenceAnd setting a time difference threshold T w according to the time difference, and when the absolute value of the time difference is smaller than the time difference threshold T w, considering the current time as the time with the minimum error between the PCIE board card and the local time.
The invention uses PCIE board card with time service precision reaching microsecond level to time service the non-real-time operation system, captures the relative accurate time of millisecond pulse, corrects the local time of the system for many times while time service, and saves the computing resource of the computer. This is because there are 999 millisecond pulses between two second pulses, and the millisecond pulses, although not having an absolute coincidence moment, also have a relatively close moment, the invention can achieve coincidence of system time accuracy and board height only by correcting at the moment judged to be close. The time stamp can reach a subtle level, and the system time can be consistent with the board card after repeated for a plurality of times.
The foregoing is merely a preferred embodiment of the invention, and it is to be understood that the invention is not limited to the form disclosed herein but is not to be construed as excluding other embodiments, but is capable of numerous other combinations, modifications and environments and is capable of modifications within the scope of the inventive concept, either as taught or as a matter of routine skill or knowledge in the relevant art. And that modifications and variations which do not depart from the spirit and scope of the invention are intended to be within the scope of the appended claims.
Claims (6)
1. High accuracy time service system based on PCIE integrated circuit board, characterized by comprising: the system comprises an antenna, a time server, a clock synchronization switch, a plurality of PCIE boards and a plurality of host servers;
the antenna is connected with the N-F port of the time server and is used for receiving satellite signals and providing a reference clock for the time server;
The time server is also connected with the clock synchronous switch through an RJ45 interface and is used for acquiring actual time according to a reference clock and transmitting time information to the clock synchronous switch by utilizing a computer network;
The clock synchronization switch is used for providing PTP signals to the PCIE board card according to a reference clock source;
The PCIE board is connected with the clock synchronous switch network and is used for providing a second pulse signal and a millisecond pulse signal for the host server according to satellite signals or PTP signals;
The host server is connected with the PCIE board card in one-to-one correspondence, and performs accurate time service and correction on the local time according to the received second pulse signal and millisecond pulse signal.
2. The PCIE board card-based high-precision time service system as defined in claim 1 wherein: the PCIE board card comprises a signal receiving unit, a time difference measuring unit, a central processing unit, a crystal oscillator, a second pulse generating unit and a millisecond pulse generating unit;
The signal receiving unit is used for analyzing the received satellite signals or PTP signals into time signals and sending the time signals to the time difference measuring unit;
the time difference measuring unit is used for calculating the difference value between the local time and the input reference time according to the time signal and sending the difference value to the central processing unit;
the central processing unit is used for adjusting the crystal oscillator frequency according to the difference value and controlling the starting of the timer according to the crystal oscillator frequency change;
The crystal oscillator is used for generating a clock signal;
the second pulse generating unit is used for triggering the second timer to generate an output second pulse signal through the central processing unit;
The millisecond pulse generating unit is used for triggering the millisecond timer to generate an output millisecond pulse signal through the output second pulse signal.
3. The PCIE board card-based high-precision time service system as defined in claim 1 wherein: the host server is a non-real-time operating system and comprises a pulse receiving module, a time service error calculating module and a time service correcting module.
4. A PCIE board card based high-precision time service method, characterized in that the method is executed by the host server according to any one of claims 1-3, and comprises the following steps:
(1) Receiving a second pulse signal T and a millisecond pulse signal T output by the PCIE board card of any one of claims 1-3;
(2) Recording the time stamp of the received millisecond pulse signal, denoted T n, where n=1, 2,3,..1000, recording the time stamp of the received second pulse signal, denoted T 0; meanwhile, counting the millisecond pulse signals after receiving the millisecond pulse signals, recording the millisecond pulse signals as N, and clearing the millisecond pulse count N after receiving the second pulse signals; calculating an error between the received millisecond pulse signal and the millisecond pulse signal output by the PCIE board card;
(3) Capturing the time with the minimum error between the PCIE board card and the local time, immediately modifying the time of the system to be the current time at the moment, and completing one time service correction;
(4) Repeating the steps (2) - (3) to finish high-precision time service.
5. The high-precision time service method based on the PCIE board card of claim 4, wherein the method comprises the following steps: the time stamp of the millisecond pulse signal and the time stamp of the second pulse signal are in microsecond level.
6. The high-precision time service method based on the PCIE board card of claim 5, wherein the method comprises the following steps: the specific step of calculating the error between the received millisecond pulse signal and the millisecond pulse signal output by the PCIE board card in the step (2) includes:
Based on the millisecond pulse count N, the microsecond theoretical time difference T N,TN of the current millisecond pulse signal received with respect to the last second pulse time is calculated by the following formula:
;
Based on the recorded time stamp T n of the received current millisecond pulse signal and the time stamp T0 of the last second pulse time, the microsecond actual time difference value of the current operating system relative to the last second pulse time when the current millisecond pulse signal is received is calculated through the following formula :
;
Calculating a theoretical time difference T N and an actual time differenceAnd setting a time difference threshold T w according to the time difference, and when the absolute value of the time difference is smaller than the time difference threshold T w, considering the current time as the time with the minimum error between the PCIE board card and the local time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311782164.XA CN117908630A (en) | 2023-12-22 | 2023-12-22 | High-precision time service system and method based on PCIE board card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311782164.XA CN117908630A (en) | 2023-12-22 | 2023-12-22 | High-precision time service system and method based on PCIE board card |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117908630A true CN117908630A (en) | 2024-04-19 |
Family
ID=90688847
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311782164.XA Pending CN117908630A (en) | 2023-12-22 | 2023-12-22 | High-precision time service system and method based on PCIE board card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117908630A (en) |
-
2023
- 2023-12-22 CN CN202311782164.XA patent/CN117908630A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6535926B1 (en) | Time synchronization system for industrial control network using global reference pulses | |
CN109669899B (en) | Method for adaptively adjusting serial port communication baud rate and serial port device | |
CN112653533B (en) | Intelligent time service management method for complex system | |
CN110928176B (en) | Multifunctional time service equipment supporting multiple time service technologies | |
US20210281339A1 (en) | Communication system and slave device | |
CN107229219A (en) | It is a kind of based on GPS module, the computer precision time service method of embedded system and its to realize system | |
US11303376B2 (en) | Information processing apparatus and time synchronization method | |
CN112395231B (en) | Method and device for calculating data delay time among multiple processors | |
WO2022062670A1 (en) | Timing method, visual navigational aid device control method, and related apparatus | |
CN113419598B (en) | Clock synchronization system and method for multi-SOC (system on chip) | |
CN117908630A (en) | High-precision time service system and method based on PCIE board card | |
CN109752738A (en) | Target IMU and GNSS data synchronous method when based on standard | |
US20200348715A1 (en) | Clock calibration | |
CN117320144A (en) | Primary and secondary clock time synchronization method and system based on wireless communication | |
CN113267186B (en) | Data synchronous acquisition system and data synchronous acquisition method | |
KR101965932B1 (en) | UTC Time Synchronization Method for a Device using GPS Module | |
CN109167736B (en) | High-uniformity data packet sending method and device | |
CN112558685B (en) | Method for synchronizing time between power distribution terminal modules | |
US20180253062A1 (en) | Clocking device, image forming apparatus, and time point correction method | |
CN111190344B (en) | Design method of satellite navigation military code time service equipment | |
CN104614980A (en) | Clock synchronizing optimizing method for automatic identification system (AIS) terminal device | |
EP0459039A1 (en) | Apparatus and method for generating time data for computer networks | |
JPH1098763A (en) | Method and circuit for synchronizing pilot signal between base stations | |
CN111600825B (en) | Synchronization method based on equidistant time pulses | |
CN113141226A (en) | Global clock synchronization method combining data packets and short pulses |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |