Method and apparatus for measuring time

文档序号:1830563 发布日期:2021-11-12 浏览:27次 中文

阅读说明:本技术 用于测量时间的方法和装置 (Method and apparatus for measuring time ) 是由 陈柳平 范永胜 付仁清 张国峰 万相奎 张建 于 2021-10-15 设计创作,主要内容包括:本发明提供用于测量时间的方法和装置以及用于量子通信设备的可编程控制器,所述方法包括:接收START信号和STOP信号;使用同一时钟对所述信号进行采样,以产生与所述START信号对应的START比特串以及与所述STOP信号对应的STOP比特串;从所述START比特串中提取所述START信号的上升沿,从所述STOP比特串中提取所述STOP信号的上升沿;基于所述START信号的上升沿与所述STOP信号的上升沿之间的比特位的计数以及所述时钟的周期来确定所述START信号与所述STOP信号之间的时间间隔。本发明无需设置延时链以及复杂的运算即可实现对诸如,但不限于,光子到达信号的时间测量。(The invention provides a method and a device for measuring time and a programmable controller for a quantum communication device, wherein the method comprises the following steps: receiving a START signal and a STOP signal; sampling the signal using the same clock to generate a START bit string corresponding to the START signal and a STOP bit string corresponding to the STOP signal; extracting a rising edge of the START signal from the START bit string, extracting a rising edge of the STOP signal from the STOP bit string; determining a time interval between the START signal and the STOP signal based on a count of bits between a rising edge of the START signal and a rising edge of the STOP signal and a period of the clock. The invention can realize the time measurement of the signal such as, but not limited to, the photon arrival without setting a delay chain and complicated operation.)

1. A method for measuring time, the method comprising:

receiving a START signal and a STOP signal;

sampling the signal using the same clock to generate a START bit string corresponding to the START signal and a STOP bit string corresponding to the STOP signal, a high level in the signal being indicated with a first bit and a low level in the signal being indicated with a second bit in the bit strings;

extracting a rising edge of the START signal from the START bit string, the rising edge of the STOP signal from the STOP bit string, wherein the rising edge of the START signal corresponds to a bit in the START bit string that jumps from a second bit to a first bit, and the rising edge of the STOP signal corresponds to a bit in the STOP bit string that jumps from a second bit to a first bit;

determining a time interval between the START signal and the STOP signal based on a count of bits between a rising edge of the START signal and a rising edge of the STOP signal and a period of the clock.

2. The method of claim 1, wherein the rising edge of the START signal is extracted from the START bit string, and wherein the step of extracting the rising edge of the STOP signal from the STOP bit string comprises:

converting the START bit string and the STOP bit string from serial data to parallel data;

processing a plurality of consecutive adjacent first bits in the parallel data into a one-hot code corresponding to bits of the bit string that transition from a second bit to a first bit;

extracting a rising edge of the START signal from the START bit string and a rising edge of the STOP signal from the STOP bit string according to the one-hot code.

3. The method of claim 2, wherein determining the time interval between the START signal and the STOP signal based on the count of bits between the rising edge of the START signal and the rising edge of the STOP signal and the period of the clock comprises:

calculating a rough measurement time interval between the START signal and the STOP signal according to a count of bits in parallel data included between parallel data where a rising edge of the START signal is located and parallel data where a rising edge of the STOP signal is located and a period of the clock;

calculating a first fine time interval for a rising edge of the START signal according to a bit in which the rising edge of the START signal is located and a period of the clock;

calculating a second fine time interval for a rising edge of the STOP signal according to a bit in which the rising edge of the STOP signal is located and a period of the clock;

summing the coarse time interval, the first fine time interval, and the second fine time interval to obtain a time interval between the START signal and the STOP signal.

4. The method of claim 2, wherein the bit width of the parallel data is one of 8 bits, 16 bits, 32 bits, and 64 bits.

5. The method of claim 1, wherein the first bit is a 1 and the second bit is a 0.

6. An apparatus for measuring time, the apparatus comprising:

a signal receiving unit configured to receive a START signal and a STOP signal;

a bit string generation unit configured to sample the signal using the same clock to generate a START bit string corresponding to the START signal and a STOP bit string corresponding to the STOP signal, in which a high level in the signal is indicated by a first bit and a low level in the signal is indicated by a second bit;

a rising edge extraction unit configured to extract a rising edge of the START signal from the START bit string, wherein the rising edge of the START signal corresponds to a bit in the START bit string that jumps from a second bit to a first bit, and the rising edge of the STOP signal corresponds to a bit in the STOP bit string that jumps from a second bit to a first bit; and

a time measurement unit configured to determine a time interval between the START signal and the STOP signal based on a count of bits between a rising edge of the START signal and a rising edge of the STOP signal and a period of the clock.

7. The apparatus of claim 6, wherein the rising edge extraction unit comprises:

a serial-to-parallel conversion unit configured to convert the START bit string and the STOP bit string from serial data to parallel data;

a one-hot code processing unit configured to process a plurality of first bits consecutively adjacent in the parallel data into one-hot codes corresponding to bits of the bit string that jump from a second bit to a first bit;

a one-hot code extraction unit configured to extract a rising edge of the START signal from the START bit string and a rising edge of the STOP signal from the STOP bit string according to the one-hot code.

8. The apparatus of claim 7, wherein the time measurement unit comprises:

a time rough measurement unit configured to calculate a rough measurement time interval between the START signal and the STOP signal from a count of bits in parallel data included between parallel data at which a rising edge of the START signal is located and parallel data at which a rising edge of the STOP signal is located and a period of the clock;

a first time subtest unit configured to calculate a first subtest time interval for a rising edge of the START signal according to a bit in which the rising edge of the START signal is located and a period of the clock;

a second time subtest unit configured to calculate a second subtest time interval of the rising edge of the STOP signal according to the bit where the rising edge of the STOP signal is located and the period of the clock;

a summary summing unit configured to sum the coarse time interval, the first fine time interval, and the second fine time interval to obtain a time interval between the START signal and the STOP signal.

9. The apparatus of claim 7, wherein the bit width of the parallel data is one of 8 bits, 16 bits, 32 bits, and 64 bits.

10. The apparatus of claim 6, wherein the first bit is a 1 and the second bit is a 0.

11. A programmable controller for a quantum communication device, characterized in that the programmable controller is configured to perform the method for measuring time of any of claims 1 to 5.

Technical Field

The present invention relates to the field of time measurement technology, and in particular, to a method and an apparatus for measuring time and a programmable controller for a quantum communication device.

Background

In the related art, a TDC (Time To Digital converter) module or an FPGA-based TDC module is mainly used To measure the arrival Time of photons, and the TDC module usually achieves the above measurement through a plurality of delay chains arranged inside the TDC module. However, since the delay chain may cause the measured time result to shift with the temperature change, the TDC module needs to correct the measured result in real time with the temperature change, which not only occupies a large amount of computing resources (such as FPGA resources, DSP resources, etc.), but also is difficult to meet the high-speed operation requirement of the system (such as, but not limited to, a quantum communication system).

Disclosure of Invention

The invention aims to provide a method and a device for measuring time and a programmable controller for a quantum communication device.

According to an aspect of the present invention, there is provided a method for measuring time, the method comprising: receiving a START signal and a STOP signal; sampling the signal using the same clock to generate a START bit string corresponding to the START signal and a STOP bit string corresponding to the STOP signal, a high level in the signal being indicated with a first bit and a low level in the signal being indicated with a second bit in the bit strings; extracting a rising edge of the START signal from the START bit string, the rising edge of the STOP signal from the STOP bit string, wherein the rising edge of the START signal corresponds to a bit in the START bit string that jumps from a second bit to a first bit, and the rising edge of the STOP signal corresponds to a bit in the STOP bit string that jumps from a second bit to a first bit; determining a time interval between the START signal and the STOP signal based on a count of bits between a rising edge of the START signal and a rising edge of the STOP signal and a period of the clock.

According to one embodiment of the invention, the step of extracting the rising edge of the START signal from the START bit string comprises: converting the START bit string and the STOP bit string from serial data to parallel data; processing a plurality of consecutive adjacent first bits in the parallel data into a one-hot code corresponding to bits of the bit string that transition from a second bit to a first bit; extracting a rising edge of the START signal from the START bit string and a rising edge of the STOP signal from the STOP bit string according to the one-hot code.

According to one embodiment of the present invention, the step of determining the time interval between the START signal and the STOP signal based on the count of bits between the rising edge of the START signal and the rising edge of the STOP signal and the period of the clock comprises: calculating a rough measurement time interval between the START signal and the STOP signal according to a count of bits in parallel data included between parallel data where a rising edge of the START signal is located and parallel data where a rising edge of the STOP signal is located and a period of the clock; calculating a first fine time interval for a rising edge of the START signal according to a bit in which the rising edge of the START signal is located and a period of the clock; calculating a second fine time interval for a rising edge of the STOP signal according to a bit in which the rising edge of the STOP signal is located and a period of the clock; summing the coarse time interval, the first fine time interval, and the second fine time interval to obtain a time interval between the START signal and the STOP signal.

According to one embodiment of the invention, the bit width of the parallel data is one of 8 bits, 16 bits, 32 bits, and 64 bits.

According to an embodiment of the invention, the first bit is a 1 and the second bit is a 0.

According to another aspect of the present invention, there is provided an apparatus for measuring time, the apparatus comprising: a signal input unit configured to receive a START signal and a STOP signal; a bit string generation unit configured to sample the signal using the same clock to generate a START bit string corresponding to the START signal and a STOP bit string corresponding to the STOP signal, in which a high level in the signal is indicated by a first bit and a low level in the signal is indicated by a second bit; a rising edge extraction unit configured to extract a rising edge of the START signal from the START bit string, wherein the rising edge of the START signal corresponds to a bit in the START bit string that jumps from a second bit to a first bit, and the rising edge of the STOP signal corresponds to a bit in the STOP bit string that jumps from a second bit to a first bit; a time measurement unit configured to determine a time interval between the START signal and the STOP signal based on a count of bits between a rising edge of the START signal and a rising edge of the STOP signal and a period of the clock.

According to an embodiment of the present invention, the rising edge extracting unit includes: a serial-to-parallel conversion unit configured to convert the START bit string and the STOP bit string from serial data to parallel data; a one-hot code processing unit configured to process a plurality of first bits consecutively adjacent in the parallel data into one-hot codes corresponding to bits of the bit string that jump from a second bit to a first bit; a one-hot code extraction unit configured to extract a rising edge of the START signal from the START bit string and a rising edge of the STOP signal from the STOP bit string according to the one-hot code.

According to one embodiment of the invention, the time measuring unit comprises: a time rough measurement unit configured to calculate a rough measurement time interval between the START signal and the STOP signal from a count of bits in parallel data included between parallel data at which a rising edge of the START signal is located and parallel data at which a rising edge of the STOP signal is located and a period of the clock; a first time subtest unit configured to calculate a first subtest time interval for a rising edge of the START signal according to a bit in which the rising edge of the START signal is located and a period of the clock; a second time subtest unit configured to calculate a second subtest time interval for a rising edge of the STOP signal according to a bit in which the rising edge of the STOP signal is located and a period of the clock; a summary summing unit configured to sum the coarse time interval, the first fine time interval, and the second fine time interval to obtain a time interval between the START signal and the STOP signal.

According to one embodiment of the invention, the bit width of the parallel data is one of 8 bits, 16 bits, 32 bits, and 64 bits.

According to an embodiment of the invention, the first bit is a 1 and the second bit is a 0.

According to another aspect of the present invention, there is provided a programmable controller for a quantum communication device, the programmable controller being configured to perform the method for measuring time as described above.

The method and the device for measuring time and the programmable controller for the quantum communication equipment can realize the time measurement of photon arrival signals without setting a delay chain and complicated operation, so that a hardware circuit and a chip used for an external TDC module can be omitted, the integration and miniaturization of the equipment are improved, and the high-speed operation requirement of a system (such as but not limited to a quantum communication system) can be met.

Drawings

The above objects and features of the present invention will become more apparent from the following description when taken in conjunction with the accompanying drawings.

Fig. 1 shows a flowchart of a method for measuring time according to an exemplary embodiment of the present invention.

Fig. 2 shows a schematic diagram for extracting a rising edge of a START signal and a rising edge of a STOP signal from a bit string according to an exemplary embodiment of the present invention.

Fig. 3 illustrates a block diagram of an apparatus for measuring time according to an exemplary embodiment of the present invention.

Fig. 4 shows a schematic diagram of measuring photon arrival times via a programmable controller in a quantum communication device according to an exemplary embodiment of the invention.

Fig. 5 shows a schematic diagram of a bit string generated via a programmable controller in a quantum communication device according to an exemplary embodiment of the invention.

Detailed Description

Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

Fig. 1 shows a flowchart of a method for measuring time according to an exemplary embodiment of the present invention.

Referring to fig. 1, a method for measuring time according to an exemplary embodiment of the present invention may include the following steps.

At step 110, a START signal and a STOP signal may be received.

For example, in a quantum communication device (such as a receiving end in a quantum key distribution system), an electrical pulse signal triggered by synchronous light may be received as a START signal, and an electrical pulse signal triggered by signal light may be received as a STOP signal. However, the present invention is not limited thereto. If necessary, an electric pulse signal or other electric pulse signal triggered by another optical signal may be received as a START signal, and an electric pulse signal or other electric pulse signal triggered by another optical signal may be received as a STOP signal.

In step 120, the signal may be sampled using the same clock to generate a START bit string corresponding to the START signal and a STOP bit string corresponding to the STOP signal, where a first bit indicates a high level in the signal and a second bit indicates a low level in the signal.

For example, a high level in the signal may be indicated by a bit "1", and a low level in the signal may be indicated by a bit "0". However, the present invention is not limited to this, and for example, a high level in the signal may be indicated by a bit "0" and a low level in the signal may be indicated by a bit "1" as needed.

At step 130, a rising edge of the START signal may be extracted from the START bit string, and a rising edge of the STOP signal corresponding to a bit in the START bit string that jumps from the second bit to the first bit may be extracted from the STOP bit string, and a rising edge of the STOP signal corresponding to a bit in the STOP bit string that jumps from the second bit to the first bit.

In an example, the START bit string and the STOP bit string may be converted from serial data to parallel data; processing a plurality of consecutive adjacent first bits in the parallel data into a one-hot code corresponding to bits in the bit string that hop from the second bit to the first bit; the rising edge of the START signal is extracted from the START bit string and the rising edge of the STOP signal is extracted from the STOP bit string according to the one-hot code.

Fig. 2 shows a schematic diagram for extracting a rising edge of a START signal and a rising edge of a STOP signal from a bit string according to an exemplary embodiment of the present invention.

Referring to fig. 2, a signal shown in a first line is a START signal 1010, a signal shown in a second line is a STOP signal 1020, a signal shown in a third line is a clock 1030, Bit strings shown in fourth and fifth lines are serial data 1040 corresponding to the START signal 1010 generated by sampling (i.e., an and operation) the START signal 1010 through a rising edge of the clock 1030 and serial data 1050 corresponding to the STOP signal 1020 generated by sampling the STOP signal 1020 through a rising edge of the clock 1030, respectively, Bit strings shown in sixth and seventh lines are parallel data 1060 generated by serial-to-parallel converting the serial data 1040 in 8-Bit width and parallel data 1070 generated by serial-to-parallel converting the serial data 1050 in 8-Bit width, respectively, and Bit strings shown in eighth and ninth lines are parallel data 1080 generated by processing a plurality of consecutively adjacent bits "1" in the parallel data 1060 into a one-hot code Bit1 and parallel data 1080 generated by processing a plurality of consecutively adjacent bits "1" in the parallel data 1070 as a plurality of consecutively adjacent bits in the parallel data 1070 The parallel data 1090 in which the Bit "1" is processed into the one-hot code Bit2 (i.e., the Bit values at the Bit1 and the Bit2 that jump from the Bit "0" to the Bit "1" in the parallel data are kept unchanged, and the Bit value "1" at the other Bit in the parallel data is set to "0"), based on the above serial-parallel conversion and one-hot code processing, the one-hot code Bit1 can be extracted from the parallel data 1080 as the rising edge of the START signal, and the one-hot code Bit2 can be extracted from the parallel data 1090 as the rising edge of the STOP signal.

It should be understood that although fig. 2 shows an example of converting a bit string from serial data to parallel data in 8-bit widths, the example is merely illustrative and the present invention is not limited thereto. If necessary, the bit string may be converted from serial data to parallel data in a bit width of 16 bits, 32 bits, 64 bits, or the like.

At step 140, the time interval between the START signal and the STOP signal may be determined based on the count of bits between the rising edge of the START signal and the rising edge of the STOP signal and the period of the clock.

In an example, the rough measurement time interval between the START signal and the STOP signal may be calculated from a count of bits in the parallel data included between the parallel data at which the rising edge of the START signal is located and the parallel data at which the rising edge of the STOP signal is located and a period of the clock; calculating a first fine time interval for a rising edge of the START signal according to a bit in which the rising edge of the START signal is located and a period of the clock; calculating a second fine time interval aiming at the rising edge of the STOP signal according to the bit where the rising edge of the STOP signal is located and the period of the clock; and summing the rough measurement time interval, the first fine measurement time interval and the second fine measurement time interval to obtain the time interval between the START signal and the STOP signal.

Referring again to FIG. 2, T0For a coarse time interval T between the START signal and the STOP signal0,T1For a first fine time interval, T, for the rising edge of the START signal2Is the second fine time interval for the rising edge of the STOP signal.

In the example shown in fig. 2, 2 parallel data are included between the parallel data on which the rising edge of the START signal is located and the parallel data on which the rising edge of the STOP signal is located, and since 8 bits exist in one parallel data, the parallel data is not limited to the parallel data on which the rising edge of the START signal is locatedThe count of the bits comprised between the parallel data on which the rising edge of the START signal is located and the parallel data on which the rising edge of the STOP signal is located is 16, from which the rough measurement time interval T between the START signal and the STOP signal can be calculated0Calculated as 16 x τ, which is the clock period.

In addition, in the example shown in fig. 2, the Bit1 at which the rising edge of the START signal is located is the second Bit in the parallel data at which it is located, in other words, the count of bits included between the rising edge of the START signal and the end of the parallel data at which it is located is 7, from which the first fine time interval T for the rising edge of the START signal can be derived1The calculation is 7 x τ, which is the clock period.

In addition, in the example shown in fig. 2, the Bit2 at which the rising edge of the STOP signal is located at the third Bit in the parallel data at which it is located, in other words, the count of bits included between the rising edge of the STOP signal and the head end of the parallel data at which it is located is 3, from which count the second fine time interval T for the rising edge of the STOP signal can be measured2Calculated as 3 x τ, which is the clock period.

Thus, in the example shown in FIG. 2, the time interval between the START signal and the STOP signal may be calculated as 16 × τ + 7 × τ + 3 × τ.

It should be understood that although fig. 2 also shows an example for measuring the time interval between the START signal and the STOP signal, this example is merely illustrative and the present invention is not limited thereto. The time interval between the START signal and the STOP signal can also be calculated, for example, by directly counting the number of bits between the rising edge of the START signal and the rising edge of the STOP signal.

Fig. 3 illustrates a block diagram of an apparatus for measuring time according to an exemplary embodiment of the present invention.

Referring to fig. 3, an exemplary apparatus for measuring time according to the present invention may include at least a signal receiving unit 310, a bit string generating unit 320, a rising edge extracting unit 330, and a time measuring unit 340, wherein the signal receiving unit 310 may be configured to receive a START signal and a STOP signal; the bit string generating unit 320 may be configured to sample the signals using the same clock to generate a START bit string corresponding to the START signal and a STOP bit string corresponding to the STOP signal, in which a high level in the signals is indicated by a first bit and a low level in the signals is indicated by a second bit; the rising edge extraction unit 330 may be configured to extract a rising edge of the START signal from the START bit string, extract a rising edge of the STOP signal from the STOP bit string, the rising edge of the START signal corresponding to a bit in the START bit string that jumps from the second bit to the first bit, the rising edge of the STOP signal corresponding to a bit in the STOP bit string that jumps from the second bit to the first bit; the time measurement unit 340 may be configured to determine a time interval between the START signal and the STOP signal based on a count of bits between a rising edge of the START signal and a rising edge of the STOP signal and a period of the clock.

In the apparatus shown in fig. 3, the rising edge extraction unit 330 may further include a serial-to-parallel conversion unit, a one-hot processing unit, and a one-hot extraction unit (not shown), wherein the serial-to-parallel conversion unit may be configured to convert the START bit string and the STOP bit string from serial data to parallel data; the one-hot code processing unit may be configured to process a plurality of first bits consecutively adjacent in the parallel data into one-hot codes, and the one-hot codes may correspond to bits in the bit string that jump from the second bit to the first bit; the one-hot extraction unit may be configured to extract a rising edge of the START signal from the START bit string and a rising edge of the STOP signal from the STOP bit string according to the one-hot. In addition, in the example, the bit width of the parallel data may be 8 bits, or may be 16 bits, 32 bits, or 64 bits. The appropriate bit width can be selected for the above serial-to-parallel conversion and unique code processing, as desired.

In the apparatus shown in fig. 3, the time measurement unit 340 may further include a time rough measurement unit, a first time fine measurement unit, a second time fine measurement unit, and a summary summation unit (not shown), wherein the time rough measurement unit may be configured to calculate a rough measurement time interval between the START signal and the STOP signal according to a count of bits in parallel data included between the parallel data where the rising edge of the START signal is located and the parallel data where the rising edge of the STOP signal is located and a period of a clock; the first time subtest unit may be configured to calculate a first subtest time interval for a rising edge of the START signal according to a bit in which the rising edge of the START signal is located and a period of the clock; the second time subtest unit may be configured to calculate a second subtest time interval for the rising edge of the STOP signal according to a bit in which the rising edge of the STOP signal is located and a period of the clock; the summary summing unit may be configured to sum the coarse time interval, the first fine time interval, and the second fine time interval together to obtain a time interval between the START signal and the STOP signal.

In the following, the application of the above-described method and apparatus for measuring time in a quantum communication device will be described in further detail with reference to fig. 4 and 5.

Fig. 4 shows a schematic diagram of measuring photon arrival times via a programmable controller in a quantum communication device (such as a receiving end or Bob end in a quantum communication system) according to an exemplary embodiment of the invention. Fig. 5 shows a schematic diagram of a bit string generated via a programmable controller in a quantum communication device according to an exemplary embodiment of the invention.

In the quantum communication device shown in fig. 4 and 5, a single photon detector D0Can transmit the electric pulse signal generated by the arrival of the synchronous light as a START signal to the FPGA and the single photon detector D1Can transmit the electric pulse signal generated by signal light as STOP signal to FPGA, and single-photon detector D2And an electric pulse signal generated when the signal light arrives can be transmitted to the FPGA as a STOP signal. The programmable controller FPGA may be configured to receive the START signal and the STOP signal via a transceiver provided therein and then sample the signals using the same Clock through a serial-to-parallel conversion module SIPO (not shown) in the transceiver to generate a bit string START corresponding to the START signal and bit strings STOP0 and STOP1 corresponding to the STOP signal, in which the signals are indicated by a bit "1" in the bit stringIndicates a low level in the above signal with a bit "0", and converts the generated above bit string from serial data to parallel data. Further, the programmable controller FPGA may be further configured to process a plurality of bits "1" consecutively adjacent in the parallel data into a one-hot code, to extract a rising edge of the START signal and a rising edge of each STOP signal from the bit string, respectively, and then to determine a time interval between the START signal and each STOP signal based on a count of bit positions between the rising edge of the START signal and the rising edge of each STOP signal and a period of the Clock in the method as described above.

It should be understood that although fig. 4 and 5 show examples of measuring photon arrival times in a quantum communication device, the present invention is not limited thereto, and the time between signals may be measured in other devices or systems using the above-described method and apparatus for measuring time.

It can be seen that the method and apparatus for measuring time according to the exemplary embodiment of the present invention can achieve time measurement of signals such as, but not limited to, photon arrival signals without setting a delay chain and complicated operations, which not only can save hardware circuits and chips used for external TDC modules, promote integration and miniaturization of devices, but also can meet high-speed operation requirements of systems such as, but not limited to, quantum communication systems.

While the present application has been shown and described with reference to preferred embodiments, it will be understood by those skilled in the art that various changes and modifications may be made to these embodiments without departing from the spirit and scope of the present application as defined by the following claims.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:可穿戴设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!