Method and apparatus for converting time service signal, and computer-readable medium
Provided are a method for converting a time service signal, an apparatus for converting a time service signal, and a computer-readable medium. The method may include: obtaining, by a conversion unit according to a first time service signal, a second initial time service signal, the first time service signal and the second initial time service signal corresponding to a same time, and outputting the second initial time service signal; and receiving, by a logic OR gate, a trigger signal of the first time service signal and the second initial time service signal, and outputting a second time service signal. The first time service signal has a first format, the second initial time service signal and the second time service signal each have a second format, on time points of the trigger signal, the second initial time service signal, and the second time service signal are all rising edges thereof.
1 . A method for converting a time service signal, comprising:
obtaining, by a conversion unit according to a first time service signal, a second initial time service signal, the first time service signal and the second initial time service signal corresponding to a same time, and outputting the second initial time service signal; and
receiving, by a logic OR gate, a trigger signal of the first time service signal and the second initial time service signal, and outputting a second time service signal;
wherein the first time service signal has a first format, the second initial time service signal and the second time service signal each have a second format, and on time points of the trigger signal of the first time service signal, the second initial time service signal, and the second time service signal are all rising edges thereof.
2 . The method according to claim 1 , wherein
the conversion unit comprises a micro controller unit (MCU).
3 . The method according to claim 1 , wherein
the first format is 1 pulse per second plus time of day (1PPS+TOD);
the second format is inter-range instrumentation group-B (IRIG-B); and
the trigger signal of the first time service signal is a 1 pulse per second (1PPS) signal.
4 . The method according to claim 3 , wherein the obtaining, by the conversion unit according to the first time service signal, the second initial time service signal, the first time service signal and the second initial time service signal corresponding to the same time, and outputting the second initial time service signal comprises:
acquiring, by the conversion unit, a time of day (TOD) signal and a 1PPS signal of the first time service signal;
generating, by the conversion unit according to time obtained by adding a preset time length to time corresponding to the TOD signal, information of the second initial time service signal, and storing the information in a buffer; and
acquiring, by the conversion unit in response to one rising edge of the 1PPS signal of the first time service signal, the information of the second initial time service signal generated according to the first time service signal before the preset time length from the buffer, to generate and output the second initial time service signal.
5 . The method according to claim 4 , wherein
the preset time length is 1 second; and
the buffer is a ping-pong buffer.
6 . The method according to claim 4 , wherein the information of the second initial time service signal is pulse width modulation (PWM) information of each pulse of the second initial time service signal.
7 . An apparatus for converting a time service signal, comprising:
a conversion unit configured to obtain, according to a first time service signal, a second initial time service signal, the first time service signal and the second initial time service signal corresponding to a same time, and output the second initial time service signal; and
a logic OR gate configured to receive a trigger signal of the first time service signal and the second initial time service signal, and output a second time service signal;
wherein the first time service signal has a first format, the second initial time service signal and the second time service signal each have a second format, and on time points of the trigger signal of the first time service signal, the second initial time service signal, and the second time service signal are all rising edges thereof.
8 . The apparatus according to claim 7 , wherein
the conversion unit comprises a micro controller unit (MCU).
9 . The apparatus according to claim 7 , wherein
the first format is 1 pulse per second plus time of day (1PPS+TOD);
the second format is inter-range instrumentation group-B (IRIG-B); and
the trigger signal of the first time service signal is a 1PPS signal.
10 . The apparatus according to claim 9 , wherein the conversion unit is configured to:
acquire a time of day (TOD) signal and a 1PPS signal of the first time service signal;
generate, according to time obtained by adding a preset time length to time corresponding to the TOD signal, information of the second initial time service signal, and store the information in a buffer; and
acquire, in response to one rising edge of the 1PPS signal of the first time service signal, the information of the second initial time service signal generated according to the first time service signal before the preset time length from the buffer, to generate and output the second initial time service signal.
11 . The apparatus according to claim 10 , wherein
the preset time length is 1 second; and
the buffer is a ping-pong buffer.
12 . The apparatus according to claim 10 , wherein the information of the second initial time service signal is pulse width modulation (PWM) information of each pulse of the second initial time service signal.
13 . A non-transitory computer-readable medium storing a computer program thereon which, when executed by a processor, causes the processor to implement a method for converting a time service signal comprising:
obtaining, by a conversion unit according to a first time service signal, a second initial time service signal, the first time service signal and the second initial time service signal corresponding to a same time, and outputting the second initial time service signal; and
receiving, by a logic OR gate, a trigger signal of the first time service signal and the second initial time service signal, and outputting a second time service signal;
wherein the first time service signal has a first format, the second initial time service signal and the second time service signal each have a second format, and on time points of the trigger signal of the first time service signal, the second initial time service signal, and the second time service signal are all rising edges thereof.
14 . The non-transitory computer-readable medium according to claim 13 , wherein
the conversion unit comprises a micro controller unit (MCU).
15 . The non-transitory computer-readable medium according to claim 13 , wherein
the first format is 1 pulse per second plus time of day (1PPS+TOD);
the second format is inter-range instrumentation group-B (IRIG-B); and
the trigger signal of the first time service signal is a 1 pulse per second (1PPS) signal.
16 . The non-transitory computer-readable medium according to claim 15 , wherein the obtaining, by the conversion unit according to the first time service signal, the second initial time service signal, the first time service signal and the second initial time service signal corresponding to the same time, and outputting the second initial time service signal comprises:
acquiring, by the conversion unit, a time of day (TOD) signal and a 1PPS signal of the first time service signal;
generating, by the conversion unit according to time obtained by adding a preset time length to time corresponding to the TOD signal, information of the second initial time service signal, and storing the information in a buffer; and
acquiring, by the conversion unit in response to one rising edge of the 1PPS signal of the first time service signal, the information of the second initial time service signal generated according to the first time service signal before the preset time length from the buffer, to generate and output the second initial time service signal.
17 . The non-transitory computer-readable medium according to claim 16 , wherein
the preset time length is 1 second; and
the buffer is a ping-pong buffer.
18 . The non-transitory computer-readable medium according to claim 16 , wherein the information of the second initial time service signal is pulse width modulation (PWM) information of each pulse of the second initial time service signal.