WO2023220939A1 - 时延测量方法、装置、设备、系统、存储介质及芯片 - Google Patents

时延测量方法、装置、设备、系统、存储介质及芯片 Download PDF

Info

Publication number
WO2023220939A1
WO2023220939A1 PCT/CN2022/093402 CN2022093402W WO2023220939A1 WO 2023220939 A1 WO2023220939 A1 WO 2023220939A1 CN 2022093402 W CN2022093402 W CN 2022093402W WO 2023220939 A1 WO2023220939 A1 WO 2023220939A1
Authority
WO
WIPO (PCT)
Prior art keywords
timestamp
test
output signal
counter
measurement
Prior art date
Application number
PCT/CN2022/093402
Other languages
English (en)
French (fr)
Inventor
徐凌峰
张元星
曾凡
Original Assignee
北京小米移动软件有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to PCT/CN2022/093402 priority Critical patent/WO2023220939A1/zh
Priority to CN202280004555.6A priority patent/CN115669043A/zh
Publication of WO2023220939A1 publication Critical patent/WO2023220939A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/12Synchronisation of different clock signals provided by a plurality of clock generators
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic

Definitions

  • the present disclosure relates to the field of wireless network equipment, and in particular, to a delay measurement method, device, equipment, system, storage medium and chip.
  • wireless network applications become more and more popular, some wireless network technologies have emerged, such as Bluetooth, thread (home Internet of Things communication protocol technology), zigbee (Zigbee), etc.
  • Thread home Internet of Things communication protocol technology
  • Zigbee Zigbee
  • In order to test the relative delay between different devices it is usually necessary to synchronize time between the devices to be tested.
  • wireless networks due to the large number of devices and the physical distribution of the devices may be scattered, wireless transmission delays are caused Larger, so it is more difficult for different devices to maintain more accurate time synchronization, making it difficult to make a more accurate assessment of the relative delay of the devices.
  • the present disclosure provides a delay measurement method, device, equipment, system, storage medium and chip.
  • a delay measurement method is provided, applied to a first test device, and the method includes:
  • the measurement start time is when the counter of the first test equipment is cleared and timing is restarted, and the counter of the second test equipment is cleared and timing is restarted.
  • the clearing time of the counter of the first testing device is the same as the clearing time of the second testing device, or the clearing time of the counter of the first testing device is the same as that of the second testing device.
  • the time difference between the clearing moments is an integral multiple of the synchronization period;
  • a delay measurement device which is applied to first test equipment, and the device includes:
  • the first acquisition device is configured to acquire the first count value of the first test equipment at the measurement start time;
  • the measurement start time is when the counter of the first test equipment is cleared and timing is restarted, and the second test equipment
  • the moment after the counter is cleared and restarts counting, the clearing moment of the counter of the first testing device is the same as the clearing moment of the second testing device, or the clearing moment of the counter of the first testing device
  • the time difference from the clearing moment of the second test equipment is an integral multiple of the synchronization period;
  • the second acquisition device is configured to acquire the first timestamp corresponding to the first count value according to the counting cycle of the first testing device
  • Determining means configured to determine the relative delay between the first testing device and the second testing device according to the first time stamp and the second time stamp of the second testing device; wherein, The second timestamp is a timestamp corresponding to the second count value of the second test device obtained at the start time of the delay measurement.
  • a delay measurement system includes: a synchronization device, a first measurement device and a second measurement device.
  • the synchronization device is connected with the first measurement device and the second measurement device. connect;
  • the synchronization device is configured to send two output signals to the first measurement device and the second measurement device respectively; the two output signals are any two adjacent output signals output by the synchronization device;
  • the first measurement device is configured to determine the counting period of the first test device based on the count value when two output signals are received, and after the counter of the first test device is cleared and restarts timing, obtain Measuring the first count value of the first test device at the start time, and obtaining the first timestamp corresponding to the first count value according to the counting period of the first test device;
  • the second measuring device is configured to determine the counting period of the second testing device based on the count value when two output signals are received, and after the counter of the second testing device is cleared and timing is restarted, obtain Measure the second count value of the second test device at the start time, and obtain the second timestamp corresponding to the second count value according to the counting period of the second test device;
  • the first measurement device and the second measurement device are further configured to determine a relative time between the first test device and the second test device based on the first time stamp and the second time stamp. extension.
  • an electronic device including:
  • a processor configured to execute the computer program in the memory to implement the steps of the delay measurement method provided in the first aspect of the present disclosure.
  • a computer-readable storage medium on which computer program instructions are stored.
  • the program instructions are executed by a processor, the steps of the delay measurement method provided by the first aspect of the present disclosure are implemented. .
  • the first count value of the first test equipment is obtained at the measurement start time; the counter of the first test equipment is cleared and timing is restarted at the measurement start time, and the counter of the second test equipment is cleared and After restarting timing, the clearing time of the counter of the first testing device is the same as the clearing time of the second testing device, or the clearing time of the counter of the first testing device is the same as the clearing time of the second testing device.
  • the time difference at zero time is an integral multiple of the synchronization period; according to the counting period of the first testing device, the first timestamp corresponding to the first count value is obtained; according to the first timestamp, and the second time of the second testing device The timestamp determines the relative delay between the first test device and the second test device; wherein the second timestamp is the time corresponding to the second count value of the second test device obtained at the start time of the delay measurement. stamp.
  • Figure 1 is a flow chart of a delay measurement method according to an exemplary embodiment
  • Figure 2 is a flow chart of another delay measurement method according to an exemplary embodiment
  • Figure 3 is a flow chart of another delay measurement method according to an exemplary embodiment
  • Figure 4 is a schematic diagram showing a relative delay according to an exemplary embodiment
  • Figure 5 is a schematic diagram showing another relative delay according to an exemplary embodiment
  • Figure 6 is a block diagram of a delay measurement device according to an exemplary embodiment
  • Figure 7 is a block diagram of a delay measurement system according to an exemplary embodiment
  • Figure 8 is a block diagram of an electronic device 800 according to an exemplary embodiment
  • FIG. 9 is a block diagram of an electronic device 900 according to an exemplary embodiment.
  • first, second, etc. are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other and do not imply a specific order or importance. In fact, expressions such as “first” and “second” can be used interchangeably.
  • the first test device may also be called a second test device, and similarly, the second test device may also be called a first test device.
  • Figure 1 is a flow chart showing a delay measurement method according to an exemplary embodiment.
  • the delay measurement method can be used for a first test device, and the first test device can be any terminal device.
  • the first test device and the second test device are connected to the synchronization device, and the method may include the following steps.
  • the clearing time of the counter of the first testing equipment is the same as the clearing time of the second testing equipment, or the time difference between the clearing time of the counter of the first testing equipment and the clearing time of the second testing equipment It is an integral multiple of the synchronization period.
  • the synchronization device can be connected to two or more test devices, and the first test device and the second test device can be any two test devices among the test devices connected to the synchronization device.
  • the synchronization device can be any device that can periodically output signals.
  • the synchronization device can be provided with an internal counter and an output interface.
  • the test device can be any terminal device that needs to perform a delay test. In this test Internal counters and input interfaces can be set in the device, and the output interface of the above-mentioned synchronization device is used to connect with the input interface of the test device.
  • the above-mentioned synchronization equipment and test equipment may be independent equipment, or may be different modules or modules in the same equipment.
  • the clock frequency of the counter of the first testing device and the clock frequency of the counter of the second testing device may be the same, and the counting period of the first testing device and the counting period of the second testing device are the same.
  • the clock frequency of the counter of the first testing device and the clock frequency of the counter of the second testing device may be different. Due to the different clock frequencies, the counting cycle of the first testing device may be different from that of the second testing device. The counting periods of the testing equipment are different. Therefore, when the clock frequency of the counter of the first testing equipment is different from the clock frequency of the counter of the second testing equipment, it is necessary to calculate the respective counting periods of the first testing equipment and the second testing equipment.
  • the synchronization device can send two consecutive output signals to the first test device and the second test device respectively, and the first test device calculates the count of the first test device based on the count value when the two output signals are respectively received.
  • cycle please refer to step S104 below.
  • the first test device determines its own counting cycle, in order to maintain synchronization with the output signal sending cycle of the synchronization device, the counter of the first test device needs to be cleared and timing is restarted.
  • the second test device determines the counting period of the second test device based on the count value of the second test device when the two output signals are respectively received. And clear the counter of the second test device to zero, and restart timing.
  • the clearing time of the counter of the first testing device is made the same as the clearing time of the second testing device, or the clearing time of the counter of the first testing device.
  • the time difference between the zero time and the clearing time of the second test equipment is an integral multiple of the synchronization period.
  • the counting cycles of the first test device and the second test device remain synchronized with the output signal sending cycle of the synchronization device.
  • the process can be started. Measurement, the measurement start time may be any time after both the first testing device and the second testing device are cleared and counting is restarted.
  • the measurement start moment can be triggered based on the control command.
  • feedback information can be sent to the synchronization device.
  • the synchronization device receives the first test equipment and the second test equipment.
  • an instruction to start measurement is sent to the first test device and the second test device.
  • the moment when the first test device and the second test device receive the instruction to start measurement is recorded as the measurement start time, or
  • the control command can also be sent by other electronic devices. Among them, since there may be a relative delay between the first test equipment and the second test equipment, there may be a difference in the time when the instruction to start the measurement is received.
  • the measurement start time of the first test equipment and the measurement start time of the second test equipment There may be differences in time, so the first test device obtains the first count value at the measurement start time, and the second test device obtains the second count value at the measurement start time.
  • the count value of the first test equipment refers to the count value of the counter of the first test equipment at the start time of measurement.
  • the count value of the second test equipment refers to the count value of the second test equipment at the start time of measurement. The count value of the counter.
  • S102 Obtain the first timestamp corresponding to the first count value according to the counting cycle of the first testing device.
  • the first testing device converts the first count value to the first timestamp corresponding to the first counting value based on the counting period of the first testing device.
  • the second testing device converts the first counting value to the first timestamp corresponding to the first counting period based on the counting period of the second testing device.
  • the second count value is converted into a second timestamp corresponding to the second count value.
  • S103 Determine the relative delay between the first testing device and the second testing device based on the first time stamp and the second time stamp sent by the second testing device.
  • the time difference between the first timestamp and the second timestamp can be used as the relative delay between the first testing device and the second testing device.
  • the first testing device may receive the second timestamp sent by the second testing device and perform step S103, or the first testing device may send the first timestamp to the second testing device, and the second testing device
  • the device determines the relative delay, or the first test device and the second test device can respectively send the first timestamp and the second timestamp to other devices, and the other devices determine the relative delay.
  • the other devices can be the synchronization device. , or other test equipment connected to the sync device, or any other third-party device.
  • the problem of large delay caused by the scattered physical distribution of the equipment can be avoided, the synchronization accuracy between the equipment to be measured can be higher, the delay measurement can be more accurate, and because the first test equipment and The clearing time of the counter of the second test equipment is the same or an integral multiple of the synchronization period. In this way, the counting period is relatively synchronized.
  • Figure 2 is a flow chart of another delay measurement method according to an exemplary embodiment. As shown in Figure 2, when the clock frequencies of the counter of the first device and the counter of the second device are different Next, before step S101, the method may also include:
  • Step S104 Determine the counting period of the first testing device based on the counting value of the first testing device when receiving the first output signal and the second output signal sent by the synchronization device.
  • the first output signal and the second output signal are any two adjacent output signals output by the synchronization device, and the synchronization period is the output signal transmission period of the synchronization device.
  • Step S105 In response to the second output signal, the counter of the first testing device is cleared and timing is restarted.
  • Figure 3 is a flow chart of another delay measurement method according to an exemplary embodiment.
  • the above step S104 may include the following steps:
  • S1041 Obtain the third count value of the counter of the first testing device when receiving the first output signal sent by the synchronization device.
  • S1042 Obtain the fourth count value of the counter of the first testing device when receiving the second output signal sent by the synchronization device.
  • S1044 Set the upper limit of counting of the counter of the first testing device to a preset multiple of the first counting period, and the preset multiple is an integer multiple.
  • the above-mentioned first output signal and the second output signal can be pulse signals sent by the synchronization device.
  • the counter in the synchronization device has the function of generating interrupts.
  • the first output signal and the second output signal can be interrupt signals sent by the synchronization device.
  • the interrupt signal may be a pulse signal.
  • the synchronization device generates an interrupt when its count value reaches a preset value, generates an interrupt signal as an output signal and sends it to the measurement device, and then the synchronization device restarts counting, and when the count value reaches the preset value, the interrupt signal is sent to the measurement device. When setting the value, an interrupt is generated again, and so on.
  • both the synchronization device and the test device are equipped with counters.
  • the clock source of the counter can be a high-frequency external crystal oscillator. Its actual counting frequency after frequency division is recorded as Freq.
  • the current first count value of the counter of the first test device is recorded as startTick.
  • the first test device receives the second output signal, the first count value of the counter of the first test device is recorded.
  • the second count value of the counter at this time is recorded as stopTick. Then the above-mentioned first counting period of the first testing device is: stoptTick-startTick, and the first counting period can be recorded as tickPeriod.
  • the value corresponding to FFFFFFFF in hexadecimal is multiplied by the floating point calculation value of tickPeriod and the result is obtained as the upper limit of the count of the counter of the first test device.
  • the tickPeriod of different test equipment may be different, but when converted into physical time, it is the same as the output signal transmission period Period of the synchronization device.
  • the starting points of the counters of different test equipment all fall on integer multiples of this Period.
  • the method of determining the corresponding first timestamp according to the first count value may include:
  • timeStamp1 Mark the first timestamp as timeStamp1, timeStamp1 can be calculated by the following formula:
  • timestamp represents the timestamp
  • tick represents the count value of the counter of the current test device
  • tickPeriod is the counting period of the test device
  • Period is the output signal sending period of the above-mentioned synchronization device
  • % represents the remainder operation
  • / represents the floating point operation .
  • the second testing device can perform the same method as the above-mentioned first testing device to obtain the second counting period of the second measuring device.
  • the second testing device may determine the counting period of the second testing device based on the counting value of the second testing device when receiving the third output signal and the fourth output signal sent by the synchronization device.
  • the second test device first obtains the fifth count value of the counter of the third test device when receiving the third output signal sent by the synchronization device, and obtains the fifth count value of the counter when receiving the synchronization device.
  • the fourth output signal sent by the device is the sixth count value of the counter of the second testing device. Then the difference between the sixth count value and the fifth count value is determined as the second counting period. Then, the counting upper limit value of the counter of the second testing equipment is set to a preset multiple of the second counting period, and the preset multiple is an integral multiple.
  • the specific calculation method can refer to the method performed by the first test equipment, and will not be described again.
  • the second test device determines the counting period of the second test device based on the count value of the second test device when receiving the third output signal and the fourth output signal sent by the synchronization device according to the above method, Clear the counter and restart timing.
  • the starting time of restarting timing of the counter of the first testing device is set to the time when the second output signal is received.
  • the starting time of restarting timing of the counter of the second testing device is set to the time when the fourth output signal is received.
  • the second timestamp timeStamp2 corresponding to the second count value can be calculated through the method shown in the above formula (1).
  • the third counting value calculated by the first counting value and the second counting value is The relative delay between the first timestamp timeStamp1 and the second timestamp timeStamp2 is less than one Period.
  • the first output signal and the third output signal are the same signal, and the second output signal and the fourth output signal are the same signal.
  • the synchronization device synchronously sends the first output signal and the second output signal to the first test device and the second test device.
  • the time difference between the first output signal and the third output signal is N times the output signal transmission period of the synchronization device, and the time difference between the first output signal and the third output signal is N times the synchronization period.
  • the output signal of the device is N times the sending period, and N is a positive integer.
  • the output signals sent by the synchronization device to the first test device and the second test device are not sent at the same time, but the two output signals received by the first test device and the two output signals received by the second test device
  • the two output signals are different signals, but since the time difference is N times the output signal transmission period of the synchronization device, the two output signals received by the first test device and the two output signals received by the second test device are both the same as
  • the output signal of the synchronization device is sent periodically for synchronization.
  • the time interval of the second count value may not be limited, that is, in this embodiment, time-sharing measurement of the first testing device and the second testing device may be implemented. And through this time-sharing measurement, when there are many measuring devices, different measuring devices can be connected to the synchronization device for measurement in batches, thereby solving the problem of insufficient interfaces when there are many measuring devices.
  • step S103 determines the relative delay between the first test device and the second test device based on the first timestamp and the second timestamp sent by the second test device, including :
  • the target device determines the relative delay based on the first timestamp and the second timestamp, and the target device is a second test device, or It is other equipment besides the first equipment and the second testing equipment.
  • the target device may be the above-mentioned second test device, or may be a third-party device used to calculate relative delay.
  • the relative delay can be determined in the following way:
  • the relative delay is the difference between the second timestamp and the first timestamp.
  • the relative delay is the sum of the first timestamp and the output signal transmission period minus the first timestamp.
  • the relative delay between the first timestamp and the second timestamp is less than the output signal transmission period Period of a synchronization device, it can be defaulted that the first timestamp is earlier than the second timestamp, and the relative delay can be Expressed as:
  • Relative delay second timestamp – first timestamp
  • Relative delay second timestamp + synchronization period - first timestamp, where the synchronization period refers to the above-mentioned Period.
  • the first test equipment and the second test equipment can calculate the counting period based on the output signal sent by the synchronization device. After the counting period is calculated, it is cleared and re-counted, and the counting period between different test equipment can be realized. Synchronization, so as to measure the relative delay of the first test device and the second test device under the condition that the counting cycle is synchronized. Compared with the method in the related art of publishing time synchronization messages through the wireless network for relative delay calculation, it is possible to This avoids the problem of large delays caused by the dispersed physical distribution of devices, enabling higher synchronization accuracy between devices to be measured and more accurate delay measurements. And through the relatively synchronized counting cycle, it is not necessary to connect all the measuring equipment when there are many measuring equipment. Instead, different measuring equipment can be measured in batches to achieve time-sharing measurement, which can solve the problem when there are many measuring equipment. In the case of insufficient interfaces.
  • Figure 6 is a block diagram of a delay measurement device according to an exemplary embodiment.
  • the delay testing device 600 includes: a first acquisition module 601 , a second acquisition module 602 , and a determination module 603 .
  • the first acquisition module 601 is configured to obtain the first count value of the first test device at the measurement start time; the measurement start time clears the counter of the first test device and restarts timing, and the second test device The moment after the counter is cleared and restarts counting, the clearing moment of the counter of the first testing device is the same as the clearing moment of the second testing device, or the clearing moment of the counter of the first testing device is the same as the clearing moment of the counter of the first testing device.
  • the time difference between the clearing moments of the two test equipment is an integral multiple of the synchronization period;.
  • the second acquisition module 602 is configured to acquire the first timestamp corresponding to the first count value according to the counting cycle of the first test device;
  • the determining module 603 is configured to determine the relative delay between the first testing device and the second testing device according to the first time stamp and the second time stamp of the second testing device; wherein, the second testing device The timestamp corresponds to the second count value of the second test device obtained at the start time of the delay measurement.
  • the delay measurement device also includes:
  • Determining the submodule configured to determine the counting period of the first testing device based on the counting value of the first testing device when receiving the first output signal and the second output signal sent by the synchronization device; wherein, the first output The signal and the second output signal are any two adjacent output signals output by the synchronization device, and the synchronization period is the output signal sending period of the synchronization device;
  • the clearing module is configured to clear the counter of the first test device and restart timing in response to the second output signal.
  • the determination sub-module includes:
  • the first acquisition submodule is configured to acquire the third count value of the counter of the first test device when receiving the first output signal sent by the synchronization device;
  • the second acquisition submodule is configured to acquire the fourth count value of the counter of the first test device when receiving the second output signal sent by the synchronization device;
  • the period determination submodule is configured to determine the first counting period of the first testing device based on the third counting value and the fourth counting value.
  • the cycle determination sub-module is configured as:
  • the upper limit of counting of the counter of the first testing equipment is set to a preset multiple of the first counting period, and the preset multiple is an integral multiple.
  • the second determination module 603 may include:
  • the delay determination submodule is configured to send the first timestamp to the target device so that the target device determines the relative delay based on the first timestamp and the second timestamp of the second test device, the
  • the target device is the second testing device, or other devices other than the first device and the second testing device;
  • receive the second timestamp sent by the second testing device and determine the relative delay based on the first timestamp and the second timestamp.
  • the second test device determines the counting period of the second test device based on the count value of the second test device when receiving the third output signal and the fourth output signal sent by the synchronization device, and then checks the counter. Cleared and restarted;
  • the starting time of restarting timing of the counter of the first testing device is set to the time when the second output signal is received;
  • the starting time of restarting timing of the counter of the second testing device is set to the time when the fourth output signal is received;
  • the first output signal and the third output signal are the same signal, the second output signal and the fourth output signal are the same signal; or the time difference between the first output signal and the third output signal is the synchronization device
  • the time difference between the first output signal and the third output signal is N times the output signal transmission period of the synchronization device.
  • the first timestamp and the second timestamp are timestamps converted to the same output signal transmission cycle
  • the relative delay is the difference between the second timestamp minus the first timestamp
  • the relative delay is the sum of the first timestamp and the output signal transmission period minus the first timestamp.
  • the first test equipment and the second test equipment can calculate the counting period based on the output signal sent by the synchronization device. After the counting period is calculated, it is cleared and re-counted, and the counting period between different test equipment can be realized. Synchronization, so as to measure the relative delay of the first test device and the second test device under the condition that the counting cycle is synchronized. Compared with the method in the related art of publishing time synchronization messages through the wireless network for relative delay calculation, it is possible to This avoids the problem of large delays caused by the dispersed physical distribution of devices, enabling higher synchronization accuracy between devices to be measured and more accurate delay measurements. And through the relatively synchronized counting cycle, it is not necessary to connect all the measuring equipment when there are many measuring equipment. Instead, different measuring equipment can be measured in batches to achieve time-sharing measurement, which can solve the problem when there are many measuring equipment. In the case of insufficient interfaces.
  • the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the delay measurement method provided by the present disclosure are implemented.
  • Figure 7 is a block diagram of a delay measurement system according to an exemplary embodiment.
  • the system includes: a synchronization device 1, a first measurement device 2 and a second measurement device 3.
  • the synchronization device 1 is connected to the first measurement device and the second measurement device; optionally, in the delay measurement system More measuring devices may also be included (such as the measuring devices connected by the dotted line to the synchronization device 1 in Figure 7).
  • the synchronization device 1 is configured to send two output signals to the first measurement device 2 and the second measurement device 3 respectively; the two output signals are any two adjacent output signals output by the synchronization device;
  • the first measuring device 2 is configured to determine the counting period of the first testing device 2 based on the count value when two output signals are received, and after the counter of the first testing device 2 is cleared and restarts timing, obtain Measure the first count value of the first test device 2 at the start time, and obtain the first timestamp corresponding to the first count value according to the counting period of the first test device 2;
  • the second measuring device 3 is configured to determine the counting period of the second testing device 3 based on the count value when two output signals are received, and after the counter of the second testing device 3 is cleared and restarts timing, obtain Measure the second count value of the second test device 3 at the start time, and obtain the second timestamp corresponding to the second count value according to the counting period of the second test device 3;
  • the first measurement device 2 and the second measurement device 3 are further configured to determine the relative time delay between the first test device 2 and the second test device 3 based on the first time stamp and the second time stamp.
  • the system also includes: target device 4;
  • the first measurement device 1 is also configured to send a first timestamp to the target device 4, so that the target device 4 determines the relative delay based on the first timestamp and the second timestamp of the second test device.
  • the target device 4 It is the second test equipment, or it is other equipment other than the first equipment and the second test equipment (in Figure 7, it is taken as an example that the target device 4 is other equipment other than the first equipment and the second test equipment); or, the first measurement Device 1 is also configured to receive a second timestamp sent by the second testing device, and determine the relative delay based on the first timestamp and the second timestamp;
  • the second measurement device 2 is also configured to send the second timestamp to the target device 4 so that the target device can determine the relative delay based on the first timestamp and the second timestamp.
  • the target device 4 is the first test device 1, or other devices; or, the second measurement device 2 is also configured to receive the first timestamp sent by the first testing device 1 and determine the relative delay based on the second timestamp and the first timestamp.
  • the two output signals received by the first measurement device 2 are the same as the two output signals received by the second measurement device 3;
  • the two output signals received by the first measuring device 2 are different from the two output signals received by the second measuring device 3, and the two output signals received by the first measuring device 2 are different from the second measuring device 3.
  • the time difference between the two output signals received by the device 3 is N times the output signal transmission period of the synchronization device 1 .
  • the first test equipment and the second test equipment can calculate the counting period based on the output signal sent by the synchronization device. After the counting period is calculated, it is cleared and re-counted, and the counting period between different test equipment can be realized. Synchronization, so as to measure the relative delay of the first test device and the second test device under the condition that the counting cycle is synchronized. Compared with the method in the related art of publishing time synchronization messages through the wireless network for relative delay calculation, it is possible to This avoids the problem of large delays caused by the dispersed physical distribution of devices, enabling higher synchronization accuracy between devices to be measured and more accurate delay measurements. And through the relatively synchronized counting cycle, it is not necessary to connect all the measuring equipment when there are many measuring equipment. Instead, different measuring equipment can be measured in batches to achieve time-sharing measurement, which can solve the problem when there are many measuring equipment. In the case of insufficient interfaces.
  • FIG. 8 is a block diagram of an electronic device 800 according to an exemplary embodiment.
  • the electronic device 800 may be the above-mentioned test device or synchronization device.
  • the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant. wait.
  • electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communications component 816.
  • processing component 802 memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communications component 816.
  • memory 804 power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communications component 816.
  • I/O input/output
  • Processing component 802 generally controls the overall operations of electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the delay measurement method.
  • processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components.
  • processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
  • Memory 804 is configured to store various types of data to support operations at electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 804 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EEPROM erasable programmable read-only memory
  • EPROM Programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory, magnetic or optical disk.
  • Power supply component 806 provides power to various components of electronic device 800 .
  • Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800 .
  • Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action.
  • multimedia component 808 includes a front-facing camera and/or a rear-facing camera.
  • the front camera and/or the rear camera may receive external multimedia data.
  • Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
  • Audio component 810 is configured to output and/or input audio signals.
  • audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or sent via communication component 816 .
  • audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
  • Sensor component 814 includes one or more sensors for providing various aspects of status assessment for electronic device 800 .
  • the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor component 814 can also detect the electronic device 800 or a component of the electronic device 800. changes in position, the presence or absence of user contact with the electronic device 800 , the orientation or acceleration/deceleration of the electronic device 800 and changes in the temperature of the electronic device 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communications component 816 also includes a near field communications (NFC) module to facilitate short-range communications.
  • NFC near field communications
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • electronic device 800 may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the delay measurement method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmable gate array
  • controller microcontroller, microprocessor or other electronic component implementation is used to perform the delay measurement method.
  • a non-transitory computer-readable storage medium including instructions such as a memory 804 including instructions, which can be executed by the processor 820 of the electronic device 800 to complete the delay measurement method is also provided.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
  • the above device can also be a part of an independent electronic device.
  • the device can be an integrated circuit (Integrated Circuit, IC) or a chip, where the integrated circuit can be an IC. , or it can be a collection of multiple ICs; the chip can include but is not limited to the following types: GPU (Graphics Processing Unit, graphics processor), CPU (Central Processing Unit, central processing unit), FPGA (Field Programmable Gate Array, can Programming logic array), DSP (Digital Signal Processor, digital signal processor), ASIC (Application Specific Integrated Circuit, application specific integrated circuit), SOC (System on Chip, SoC, system on a chip or system-level chip), etc.
  • GPU Graphics Processing Unit, graphics processor
  • CPU Central Processing Unit, central processing unit
  • FPGA Field Programmable Gate Array, can Programming logic array
  • DSP Digital Signal Processor, digital signal processor
  • ASIC Application Specific Integrated Circuit, application specific integrated circuit
  • SOC System on Chip, SoC, system on a chip or system-level chip
  • the above-mentioned integrated circuit or chip can be used to execute executable instructions (or codes) to implement the above-mentioned delay measurement method.
  • the executable instructions can be stored in the integrated circuit or chip, or can be obtained from other devices or devices.
  • the integrated circuit or chip includes a processor, a memory, and an interface for communicating with other devices.
  • the executable instruction can be stored in the processor, and when the executable instruction is executed by the processor, the above-mentioned delay measurement method is implemented; or, the integrated circuit or chip can receive the executable instruction through the interface and transmit it to the processor. processor to implement the above delay measurement method.
  • a computer program product comprising a computer program executable by a programmable device, the computer program having a function for performing the above when executed by the programmable device.
  • the code part of the delay measurement method.
  • FIG. 9 is a block diagram of an electronic device 900 according to an exemplary embodiment.
  • the electronic device 900 may be provided as a server and may serve as the above-mentioned synchronization device or measurement device.
  • electronic device 900 includes a processing component 922 , which further includes one or more processors, and memory resources represented by memory 932 for storing instructions, such as application programs, executable by processing component 922 .
  • the application program stored in memory 932 may include one or more modules, each corresponding to a set of instructions.
  • the processing component 922 is configured to execute instructions to perform the above-described delay measurement method.
  • Electronic device 900 may also include a power supply component 926 configured to perform power management of electronic device 900, a wired or wireless network interface 950 configured to connect electronic device 900 to a network, and an input/output (I/O) interface. 958.
  • the electronic device 900 may operate based on an operating system stored in the memory 932, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

本公开涉及一种时延测量方法、装置、设备、系统、存储介质及芯片,涉及无线网络设备领域,该方法包括:获取测量开始时刻第一测试设备的第一计数值;该测量开始时刻为第一测试设备的计数器清零并重新开始计时和第二测试设备的计数器清零并重新开始计时后的时刻,第一测试设备的计数器的清零时刻与第二测试设备的清零时刻相同,或者第一测试设备的计数器的清零时刻与第二测试设备的清零时刻的时间差为同步周期的整倍数;根据第一测试设备的计数周期,获取第一计数值对应的第一时间戳;根据第一时间戳,以及第二测试设备的第二时间戳确定第一测试设备和第二测试设备之间的相对时延。通过上述方案,能够使待测量的设备之间的同步精度更高,时延测量更准确。

Description

时延测量方法、装置、设备、系统、存储介质及芯片 技术领域
本公开涉及无线网络设备领域,尤其涉及一种时延测量方法、装置、设备、系统、存储介质及芯片。
背景技术
随着无线网络应用越来越普及,产生了一些无线网络技术,例如蓝牙、thread(家庭物联网通讯协定技术)、zigbee(紫蜂)等。为了测试不同设备之间的相对时延,通常需要将待测试的设备之间进行时间同步,但是在无线网络中,由于设备数量比较多,且设备的物理分布可能较分散,导致无线传输延时较大,因此不同的设备之间较难保持比较精确的时间同步,因此导致很难对设备的相对时延做出较为精确地评估。
发明内容
为克服相关技术中存在的问题,本公开提供一种时延测量方法、装置、设备、系统、存储介质及芯片。
根据本公开实施例的第一方面,提供一种时延测量方法,应用于第一测试设备,所述方法包括:
获取测量开始时刻所述第一测试设备的第一计数值;所述测量开始时刻为所述第一测试设备的计数器清零并重新开始计时,以及第二测试设备的计数器清零并重新开始计时之后的时刻,所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻相同,或者所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻的时间差为同步周期的整倍数;
根据所述第一测试设备的计数周期,获取所述第一计数值对应的第一时间戳;
根据所述第一时间戳,以及所述第二测试设备的第二时间戳确定所述第一测试设备和所述第二测试设备之间的相对时延;其中,所述第二时间戳在所述时延测量开始时刻获取的所述第二测试设备的第二计数值对应的时间戳。
根据本公开实施例的第二方面,提供一种时延测量装置,应用于第一测试设备,所述装置包括:
第一获取装置,被配置为获取测量开始时刻所述第一测试设备的第一计数值;所述测量开始时刻为所述第一测试设备的计数器清零并重新开始计时,以及第二测试设备的计数器清零并重新开始计时之后的时刻,所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻相同,或者所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻的时间差为同步周期的整倍数;
第二获取装置,被配置为根据所述第一测试设备的计数周期,获取所述第一计数值对应的第一时间戳;
确定装置,被配置为根据所述第一时间戳,以及所述第二测试设备的第二时间戳确定所述第一测试设备和所述第二测试设备之间的相对时延;其中,所述第二时间戳在所述时延测量开始时刻获取的所述第二测试设备的第二计数值对应的时间戳。
根据本公开实施例的第三方面,提供一种时延测量系统,所述系统包括:同步设备、第一测量设备和第二测量设备,所述同步设备与第一测量设备与第二测量设备连接;
所述同步设备被配置为向所述第一测量设备和所述第二测量设备分别发送两个输出信号;所述两个输出信号是所述同步设备输出的任意相邻的两个输出信号;
所述第一测量设备被配置为根据接收到两个输出信号时的计数值确定所述第一测试 设备的计数周期,并在所述第一测试设备的计数器清零并重新开始计时后,获取测量开始时刻所述第一测试设备的第一计数值,以及根据所述第一测试设备的计数周期,获取所述第一计数值对应的第一时间戳;
所述第二测量设备被配置为根据接收到两个输出信号时的计数值确定所述第二测试设备的计数周期,并在所述第二测试设备的计数器清零并重新开始计时后,获取测量开始时刻所述第二测试设备的第二计数值,以及根据所述第二测试设备的计数周期,获取所述第二计数值对应的第二时间戳;
所述第一测量设备和所述第二测量设备还被配置为根据所述第一时间戳和所述第二时间戳确定所述第一测试设备和所述第二测试设备之间的相对时延。
根据本公开实施例的第四方面,提供一种电子设备,包括:
存储器,其上存储有计算机程序;
处理器,用于执行所述存储器中的所述计算机程序,以实现本公开第一方面所提供的时延测量方法的步骤。
根据本公开实施例的第五方面,提供一种计算机可读存储介质,其上存储有计算机程序指令,该程序指令被处理器执行时实现本公开第一方面所提供的时延测量方法的步骤。
在上述技术方案中,获取测量开始时刻该第一测试设备的第一计数值;该测量开始时刻为该第一测试设备的计数器清零并重新开始计时,以及第二测试设备的计数器清零并重新开始计时之后的时刻,该第一测试设备的计数器的清零时刻与该第二测试设备的清零时刻相同,或者该第一测试设备的计数器的清零时刻与该第二测试设备的清零时刻的时间差为同步周期的整倍数;根据该第一测试设备的计数周期,获取该第一计数值对应的第一时间戳;根据该第一时间戳,以及该第二测试设备的第二时间戳确定该第一测试设备和该第二测试设备之间的相对时延;其中,该第二时间戳在该时延测量开始时刻获取的该第二测试设备的第二计数值对应的时间戳。通过上述方式,能够避免因为设备的物理分布较分散而导致的延时较大的问题,能够使待测量的设备之间的同步精度更高,时延测量更准确,并且由于第一测试设备与该第二测试设备的计数器的清零时刻相同或者为同步周期的整倍数,通过这种计数周期相对同步的方式,能够在测量设备较多的情况下不必连接所有测量设备,而是可以分批次将不同的测量设备进行测量,实现分时测量。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
图1是根据一示例性实施例示出的一种时延测量方法的流程图;
图2是根据一示例性实施例示出的另一种时延测量方法的流程图;
图3是根据一示例性实施例示出的另一种时延测量方法的流程图;
图4是根据一示例性实施例示出的一种相对时延的示意图;
图5是根据一示例性实施例示出的另一种相对时延的示意图;
图6是根据一示例性实施例示出的一种时延测量装置的框图;
图7是根据一示例性实施例示出的一种时延测量系统的框图;
图8是根据一示例性实施例示出的一种电子设备800的框图;
图9是根据一示例性实施例示出的一种电子设备900的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中 所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
可以理解的是,本公开中“多个”是指两个或两个以上,其它量词与之类似。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。
进一步可以理解的是,术语“第一”、“第二”等用于描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开,并不表示特定的顺序或者重要程度。实际上,“第一”、“第二”等表述完全可以互换使用。例如,在不脱离本公开范围的情况下,第一测试设备也可以被称为第二测试设备,类似地,第二测试设备也可以被称为第一测试设备。
进一步可以理解的是,本公开实施例中尽管在附图中以特定的顺序描述操作,但是不应将其理解为要求按照所示的特定顺序或是串行顺序来执行这些操作,或是要求执行全部所示的操作以得到期望的结果。在特定环境中,多任务和并行处理可能是有利的。
需要说明的是,本申请中所有获取信号、信息或数据的动作都是在遵照所在地国家相应的数据保护法规政策的前提下,并获得由相应装置所有者给予授权的情况下进行的。
图1根据一示例性实施例示出的一种时延测量方法的流程图,如图1所示,该时延测量方法可以用于第一测试设备,该第一测试设备可以是任意终端设备,该第一测试设备与第二测试设备与同步设备连接,该方法可以包括以下步骤。
S101,获取测量开始时刻该第一测试设备的第一计数值;该测量开始时刻为该第一测试设备的计数器清零并重新开始计时,以及第二测试设备的计数器清零并重新开始计时之后的时刻,该第一测试设备的计数器的清零时刻与该第二测试设备的清零时刻相同,或者该第一测试设备的计数器的清零时刻与该第二测试设备的清零时刻的时间差为同步周期的整倍数。
其中,该同步设备可以连接两个或两个以上的测试设备,该第一测试设备与第二测试设备可以是该同步设备所连接的测试设备中的任意两个测试设备。
示例地,该同步设备可以是任一能够周期性地输出信号的设备,该同步设备中可以设置有内部计数器和输出接口,测试设备可以是任一需要进行时延测试的终端设备,在该测试设备中可以设置内部计数器和输入接口,上述同步设备的输出接口用于与测试设备的输入接口连接。另外,上述的同步设备和测试设备可以是相互独立设备,也可以是处于同一设备内的不同模组或模块。
其中,在一种实现方式中,上述的第一测试设备的计数器的时钟频率与第二测试设备的计数器的时钟频率可以相同,第一测试设备的计数周期与第二测试设备的计数周期相同。
或者,在另一种实现方式中,上述的第一测试设备的计数器的时钟频率与第二测试设备的计数器的时钟频率可以不同,由于时钟频率不同会导致第一测试设备的计数周期与第二测试设备的计数周期不同,因此对于第一测试设备的计数器的时钟频率与第二测试设备的计数器的时钟频率不同的情况,需要计算第一测试设备和第二测试设备各自的计数周期。
示例地,可以通过该同步设备分别向第一测试设备和第二测试设备发送连续的两个输出信号,第一测试设备基于分别接收到两个输出信号时计数值来计算第一测试设备的计数周期,可参照下文步骤S104。在第一测试设备确定了自身的计数周期后,为了和同步设备的输出信号发送周期保持同步,则需要对第一测试设备的计数器清零,并重新开始计时。同理,第二测试设备也在接收到同步设备的发送的连续的两个输出信号后,基于分别接收到该两个输出信号时第二测试设备的计数值确定第二测试设备的计数周期,并对第二测试 设备的计数器清零,并重新开始计时。为了保持第一测试设备与第二测试设备计数保持同步,需要使得该第一测试设备的计数器的清零时刻与该第二测试设备的清零时刻相同,或者该第一测试设备的计数器的清零时刻与该第二测试设备的清零时刻的时间差为同步周期的整倍数。
在第一测试设备和第二测试设备均清零,并重新开始计之后,第一测试设备和第二测试设备的计数周期均和同步设备的输出信号发送周期保持同步,此情况下可以开始进行测量,该测量开始时刻可以是该第一测试设备和第二测试设备均清零,并重新开始计数之后的任意时刻。
该测量开始时刻,可以基于控制指令触发,在第一测试设备和第二测试设备均清零,并重新开始计之后,可以向同步设备发送反馈信息,同步设备在接收到第一测试设备和第二测试设备的反馈信息后,向第一测试设备和第二测试设备发送测量开始的指令,第一测试设备和第二测试设备接收到该测量开始的指令的时刻记为该测量开始时刻,或者该控制指令也可以由其他的电子设备发送。其中,由于第一测试设备和第二测试设备之间可能存在相对时延,接收到该测量开始的指令的时刻可能存在差异,因此第一测试设备的测量开始时刻和第二测试设备的测量开始时刻可能存在差异,因此第一测试设备获取在测量开始时刻的第一计数值,第二测试设备获取在测量开始时刻的第二计数值。其中,该第一测试设备的计数值指的是在测量开始时刻该第一测试设备的计数器的计数值,同理该第二测试设备的计数值指的是在测量开始时刻该第二测试设备的计数器的计数值。
S102,根据该第一测试设备的计数周期,获取该第一计数值对应的第一时间戳。
示例地,第一测试设备基于第一测试设备的计数周期将该第一计数值换算为该第一计数值对应的第一时间戳,同理,第二测试设备基于第二测试设备的计数周期将该第二计数值换算为该第二计数值对应的第二时间戳。
S103,根据该第一时间戳,以及该第二测试设备发送的第二时间戳确定该第一测试设备和该第二测试设备之间的相对时延。
示例地,第一时间戳和第二时间戳之间的时间差即可作为该第一测试设备和该第二测试设备之间的相对时延。在一种实施方式中,第一测试设备可以接收第二测试设备发送的第二时间戳并执行步骤S103,或者第一测试设备可以将第一时间戳发送给第二测试设备,由第二测试设备确定该相对时延,或者第一测试设备和第二测试设备可以分别将第一时间戳和第二时间戳发送至其他设备,由其他设备确定该相对时延,其他设备可以是该同步设备,或者该同步设备连接的其他测试设备,或者其他任意的第三方设备。
通过上述方式,能够避免因为设备的物理分布较分散而导致的延时较大的问题,能够使待测量的设备之间的同步精度更高,时延测量更准确,并且由于第一测试设备与该第二测试设备的计数器的清零时刻相同或者为同步周期的整倍数,通过这种计数周期相对同步的方式,能够在测量设备较多的情况下不必连接所有测量设备,而是可以分批次将不同的测量设备进行测量,实现分时测量。
可选地,图2是根据一示例性实施例示出的另一种时延测量方法的流程图,如图2所示,在第一设备的计数器和第二设备的计数器的时钟频率不同的情况下,在步骤S101之前,该方法还可以包括:
步骤S104,基于接收到该同步设备发送的第一输出信号和第二输出信号时该第一测试设备的计数值,确定该第一测试设备的计数周期。
其中,该第一输出信号和该第二输出信号是该同步设备输出的任意相邻的两个输出信号,该同步周期为该同步设备的输出信号发送周期。
步骤S105,响应于该第二输出信号,对该第一测试设备的计数器和清零并重新开始计时。
可选地,图3是根据一示例性实施例示出的另一种时延测量方法的流程图,如图3所示,上述步骤S104可以包括以下步骤:
S1041,获取在接收到该同步设备发送的第一输出信号时该第一测试设备的计数器的第三计数值。
S1042,获取在接收到该同步设备发送的第二输出信号时该第一测试设备的计数器的第四计数值。
S1043,将该第四计数值与该第三计数值的差值确定为该第一计数周期。
S1044,将该第一测试设备的计数器的计数上限值设定为该第一计数周期的预设倍数,该预设倍数为整倍数。
其中,上述第一输出信号和第二输出信号可以是同步设备发出的脉冲信号,同步设备中的计数器具有产生中断的功能,第一输出信号和第二输出信号可以是同步设备发出的中断信号,该中断信号可以是脉冲信号,示例地,同步设备在其计数值达到预设值时产生中断,生成一个中断信号作为输出信号发给测量设备,然后同步设备重新开始计数,并在计数值达到预设值时再次产生中断,依次类推。
示例性地,同步设备和测试设备都设置有计数器,该计数器的时钟源可以为高频外部晶振,经分频后的其实际的计数频率记为Freq,同步设备的计数器的计数上限值可以记为Period,Period=Freq*N,单位为ticks(计数值),N为秒数。每当同步设备的计数器的计数值达到Period时,就会产生中断,向测试设备发送一个输出信号,因此同步设备的输出信号发送周期即为该Period。Period需大于测量设备之前预估的最大时延。
当第一测试设备接收到第一输出信号时,将第一测试设备的计数器当前的第一计数值,记为startTick,当第一测试设备接收到第二输出信号时,记录第一测试设备的计数器此时的第二计数值,记为stoptTick。则第一测试设备的上述第一计数周期即为:stoptTick-startTick,该第一计数周期记可以为tickPeriod。并且,可以将该第一测试设备的计数器的计数上限值设定为:TopTick=0xFFFFFFFF/(tickPeriod*tickPeriod),其中,0x表示十六进制,“/”表示浮点运算,即根据十六进制下FFFFFFFF对应的数值与tickPeriod进行浮点计算后的数值再乘以tickPeriod得到的结果作为该第一测试设备的计数器的计数上限值。不同测试设备的tickPeriod可能不同,但是换算成物理时间均与同步设备的输出信号发送周期Period相同,不同测试设备的计数器的起始点均落在该Period的整数倍上。
可选地,在得到上述的第一计数值后,根据该第一计数值确定对应的第一时间戳的方法可以包括:
将第一时间戳记为timeStamp1,可以通过以下公式来计算timeStamp1:
timestamp=(tick%tickPeriod)/tickPeriod*Period    (1)
其中,timestamp表示时间戳,tick表示当前的测试设备的计数器的计数值,tickPeriod为该测试设备的计数周期,Period上述的同步设备的输出信号发送周期,%表示取余运算,/表示浮点运算。将该第一计数值代入公式(1)中的tick,将该第一测试设备的计数周期代入公式(1)中的tickPeriod,即可通过公式(1)计算出该第一时间戳timeStamp1。
同理,第二测试设备可以执行与上述第一测试设备相同的方法来得到第二测量设备的第二计数周期。示例地,第二测试设备可以是在基于接收到同步设备发送的第三输出信号和第四输出信号时该第二测试设备的计数值确定该述第二测试设备的计数周期。
与第一测试设备执行的方法相同,该第二测试设备首先获取在接收到该同步设备发送的第三输出信号时该第三测试设备的计数器的第五计数值,以及获取在接收到该同步设备发送的第四输出信号时该第二测试设备的计数器的第六计数值。然后将该第六计数值与该第五计数值的差值确定为该第二计数周期。再将该第二测试设备的计数器的计数上限值设定为该第二计数周期的预设倍数,该预设倍数为整倍数。具体的计算方法可参照第一测试 设备执行的方法,不再赘述。
可选地,该第二测试设备是按照上述方法,在基于接收到同步设备发送的第三输出信号和第四输出信号时第二测试设备的计数值确定该第二测试设备的计数周期后,对计数器清零并重新开始计时的。
在该第一测试设备的计数器清零并重新开始计时后,该第一测试设备的计数器的重新开始计时的起始时刻设置为接收到该第二输出信号时的时刻,在该第二测试设备的计数器清零并重新开始计时后,该第二测试设备的计数器的重新开始计时的起始时刻设置为接收到该第四输出信号时的时刻。
在得到第二测试设备的计数周期以及第二计数值后,通过上述的公式(1)所示的方法,可以计算得出第二计数值对应的第二时间戳timeStamp2。
需要说明的是,上述的第一测试设备和第二测试设备的计数器的计数值在达到计数器的计数上限值时,重新开始计数,因此通过第一计数值和第二计数值计算得到的第一时间戳timeStamp1和第二时间戳timeStamp2之间的相对时延小于一个Period。
在一种实施方式中,该第一输出信号和该第三输出信号为同一信号,该第二输出信号和该第四输出信号为同一信号。在该情况下,可以理解为同步设备向该第一测试设备和第二测试设备同步发送第一输出信号和第二输出信号。
或者,在另一种实施方式中,该第一输出信号和第三输出信号的时间差为该同步设备的输出信号发送周期的N倍,该第一输出信号和第三输出信号的时间差为该同步设备的输出信号发送周期的N倍,N为正整数。在该情况下,可以理解为同步设备向该第一测试设备和第二测试设备发送的输出信号不是同时发送的,但是第一测试设备接收到的两个输出信号和第二测试设备接收到的两个输出信号是不同的信号,但是由于时间差为同步设备的输出信号发送周期的N倍,因此第一测试设备接收到的两个输出信号和第二测试设备接收到的两个输出信号均与同步设备的输出信号发送周期同步。
由于通过上述的公式(1)计算得到的第一时间戳timeStamp1和第二时间戳timeStamp2之间的相对时延小于一个Period,因此对于获取第一测试设备的第一计数值和获取第二测试设备的第二计数值的时间间隔可以没有限制,也即在该实施方式中,可以实现对第一测试设备和第二测试设备的分时测量。并且通过该分时测量,能够在测量设备较多的情况下,可以分批次将不同的测量设备与同步设备连接进行测量,从而能够解决在测量设备较多时接口不够用的问题。
可选地,上述的步骤S103所述的根据该第一时间戳,以及该第二测试设备发送的第二时间戳确定该第一测试设备和该第二测试设备之间的相对时延,包括:
将该第一时间戳和该第二时间戳发送至目标设备,以供该目标设备根据该第一时间戳和该第二时间戳确定该相对时延,该目标设备为第二测试设备,或者为该第一设备和所述第二测试设备外的其他设备。例如该目标设备可以是上述第二测试设备,也可以是用于计算相对时延的第三方设备。示例性地,相对时延可以通过以下方式确定:
在第一时间戳小于第二时间戳的情况下,该相对时延为第二时间戳减去第一时间戳的差。
在第一时间戳大于第二时间戳的情况下,上述相对时延为第一时间戳与输出信号发送周期之和再减去第一时间戳的差。
示例地,由于第一时间戳和第二时间戳之间的相对时延小于一个同步设备的输出信号发送周期Period,因此可以默认第一时间戳早于该第二时间戳,则相对时延可以表示为:
1)如图4所示,在第一时间戳<第二时间戳的情况下:
相对时延=第二时间戳–第一时间戳
2)如图5所示,第一时间戳>第二时间戳的情况下:
相对时延=第二时间戳+同步周期-第一时间戳,其中同步周期指上述的Period。
通过上述方式,第一测试设备和第二测试设备能够基于同步设备发送的输出信号实现计数周期的计算,在计算出计数周期后进行清零并重新计数,能够实现不同测试设备之间计数周期的同步,从而在计数周期同步的情况下对第一测试设备和第二测试设备的相对时延进行测量,相比相关技术中通过无线网络发布时间同步消息进行相对时延计算的方式而言,能够避免因为设备的物理分布较分散而导致的延时较大的问题,能够使待测量的设备之间的同步精度更高,时延测量更准确。并且通过计数周期相对同步的方式,能够在测量设备较多的情况下不必连接所有测量设备,而是可以分批次将不同的测量设备进行测量,实现分时测量,能够解决在测量设备比较多的情况下接口不够用的问题。
图6是根据一示例性实施例示出的一种时延测量装置的框图。参照图6,该时延测试装置600包括:第一获取模块601,第二获取模块602,确定模块603。
该第一获取模块601,被配置为获取测量开始时刻该第一测试设备的第一计数值;该测量开始时刻为该第一测试设备的计数器清零并重新开始计时,以及第二测试设备的计数器清零并重新开始计时之后的时刻,该第一测试设备的计数器的清零时刻与该第二测试设备的清零时刻相同,或者该第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻的时间差为同步周期的整倍数;.
该第二获取模块602,被配置为根据该第一测试设备的计数周期,获取该第一计数值对应的第一时间戳;
该确定模块603,被配置为根据该第一时间戳,以及该第二测试设备的第二时间戳确定该第一测试设备和该第二测试设备之间的相对时延;其中,该第二时间戳在该时延测量开始时刻获取的该第二测试设备的第二计数值对应的时间戳。
可选地,该时延测量装置还包括:
确定子模块,被配置为基于接收到该同步设备发送的第一输出信号和第二输出信号时该第一测试设备的计数值,确定该第一测试设备的计数周期;其中,该第一输出信号和该第二输出信号是该同步设备输出的任意相邻的两个输出信号,该同步周期为该同步设备的输出信号发送周期;
清零模块,被配置为响应于该第二输出信号,对该第一测试设备的计数器和清零并重新开始计时。
可选地,该确定子模块包括:
第一获取子模块,被配置为获取在接收到该同步设备发送的第一输出信号时该第一测试设备的计数器的第三计数值;
第二获取子模块,被配置为获取在接收到该同步设备发送的第二输出信号时该第一测试设备的计数器的第四计数值;
周期确定子模块,被配置为基于该第三计数值和该第四计数值确定该第一测试设备的第一计数周期。
可选地,该周期确定子模块,被配置为:
将该第四计数值与该第三计数值的差值确定为该第一计数周期;
将该第一测试设备的计数器的计数上限值设定为该第一计数周期的预设倍数,该预设倍数为整倍数。
可选地,该第二确定模块603,可以包括:
时延确定子模块,被配置为将该第一时间戳发送至目标设备,以供该目标设备根据该第一时间戳和该第二测试设备的该第二时间戳确定该相对时延,该目标设备为该第二测试设备,或者为该第一设备和该第二测试设备外的其他设备;
或者,接收该第二测试设备发送的该第二时间戳,并根据该第一时间戳和该第二时间 戳确定该相对时延。
可选地,该第二测试设备是在基于接收到该同步设备发送的第三输出信号和第四输出信号时该第二测试设备的计数值确定该第二测试设备的计数周期后,对计数器清零并重新开始计时的;
在该第一测试设备的计数器清零并重新开始计时后,该第一测试设备的计数器的重新开始计时的起始时刻设置为接收到该第二输出信号时的时刻;
在该第二测试设备的计数器清零并重新开始计时后,该第二测试设备的计数器的重新开始计时的起始时刻设置为接收到该第四输出信号时的时刻;
其中,该第一输出信号和该第三输出信号为同一信号,该第二输出信号和该第四输出信号为同一信号;或者,该第一输出信号和第三输出信号的时间差为该同步设备的输出信号发送周期的N倍,该第一输出信号和第三输出信号的时间差为该同步设备的输出信号发送周期的N倍。
可选地,该第一时间戳和该第二时间戳为换算至同一输出信号发送周期的时间戳;
在该第一时间戳小于该第二时间戳的情况下,该相对时延为该第二时间戳减去该第一时间戳的差;
在该第一时间戳大于该第二时间戳的情况下,该相对时延为该第一时间戳与该输出信号发送周期之和再减去该第一时间戳的差。
通过上述方式,第一测试设备和第二测试设备能够基于同步设备发送的输出信号实现计数周期的计算,在计算出计数周期后进行清零并重新计数,能够实现不同测试设备之间计数周期的同步,从而在计数周期同步的情况下对第一测试设备和第二测试设备的相对时延进行测量,相比相关技术中通过无线网络发布时间同步消息进行相对时延计算的方式而言,能够避免因为设备的物理分布较分散而导致的延时较大的问题,能够使待测量的设备之间的同步精度更高,时延测量更准确。并且通过计数周期相对同步的方式,能够在测量设备较多的情况下不必连接所有测量设备,而是可以分批次将不同的测量设备进行测量,实现分时测量,能够解决在测量设备比较多的情况下接口不够用的问题。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
本公开还提供一种计算机可读存储介质,其上存储有计算机程序指令,该程序指令被处理器执行时实现本公开提供的时延测量方法的步骤。
图7是根据一示例性实施例示出的一种时延测量系统的框图。参照图7,该系统包括:同步设备1、第一测量设备2和第二测量设备3,该同步设备1与第一测量设备与第二测量设备连接;可选地,该时延测量系统中还可以包括更多的测量设备(如图7中同步设备1通过虚线连接的测量设备)。
同步设备1被配置为向该第一测量设备2和该第二测量设备3分别发送两个输出信号;该两个输出信号是该同步设备输出的任意相邻的两个输出信号;
该第一测量设备2被配置为根据接收到两个输出信号时的计数值确定该第一测试设备2的计数周期,并在该第一测试设备2的计数器清零并重新开始计时后,获取测量开始时刻该第一测试设备2的第一计数值,以及根据该第一测试设备2的计数周期,获取该第一计数值对应的第一时间戳;
该第二测量设备3被配置为根据接收到两个输出信号时的计数值确定该第二测试设备3的计数周期,并在该第二测试设备3的计数器清零并重新开始计时后,获取测量开始时刻该第二测试设备3的第二计数值,以及根据该第二测试设备3的计数周期,获取该第二计数值对应的第二时间戳;
该第一测量设备2和该第二测量设备3还被配置为根据该第一时间戳和该第二时间戳 确定该第一测试设备2和该第二测试设备3之间的相对时延。
可选地,如图7所示,该系统还包括:目标设备4;
第一测量设备1,还被配置为将第一时间戳发送至目标设备4,以供目标设备4根据第一时间戳和第二测试设备的第二时间戳确定该相对时延,目标设备4为第二测试设备,或者为第一设备和第二测试设备外的其他设备(图7中以目标设备4是第一设备和第二测试设备外的其他设备为例);或者,第一测量设备1还被配置为接收第二测试设备发送的第二时间戳,并根据第一时间戳和第二时间戳确定相对时延;
第二测量设备2,还被配置为将第二时间戳发送至目标设备4,以供目标设备根据第一时间戳和第二时间戳确定相对时延,目标设备4为第一测试设备1,或者为其他设备;或者,第二测量设备2,还被配置为接收第一测试设备1发送的第一时间戳,并根据第二时间戳和第一时间戳确定相对时延。
可选地,该第一测量设备2接收到的两个输出信号与该第二测量设备3接收到的两个输出信号相同;
或者,该第一测量设备2接收到的两个输出信号与该第二测量设备3接收到的两个输出信号不同,且该第一测量设备2接收到的两个输出信号与该第二测量设备3接收到的两个输出信号的时间差为该同步设备1的输出信号发送周期的N倍。
通过上述方式,第一测试设备和第二测试设备能够基于同步设备发送的输出信号实现计数周期的计算,在计算出计数周期后进行清零并重新计数,能够实现不同测试设备之间计数周期的同步,从而在计数周期同步的情况下对第一测试设备和第二测试设备的相对时延进行测量,相比相关技术中通过无线网络发布时间同步消息进行相对时延计算的方式而言,能够避免因为设备的物理分布较分散而导致的延时较大的问题,能够使待测量的设备之间的同步精度更高,时延测量更准确。并且通过计数周期相对同步的方式,能够在测量设备较多的情况下不必连接所有测量设备,而是可以分批次将不同的测量设备进行测量,实现分时测量,能够解决在测量设备比较多的情况下接口不够用的问题。
图8是根据一示例性实施例示出的一种电子设备800的框图。例如,电子设备800可以是上述的测试设备或同步设备,该电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。
参照图8,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)接口812,传感器组件814,以及通信组件816。
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成时延测量方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在 一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为装置800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行时延测量方法。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器804,上述指令可由电子设备800的处理器820执行以完成时延测量方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
上述装置除了可以是独立的电子设备外,也可是独立电子设备的一部分,例如在一种实施例中,该装置可以是集成电路(Integrated Circuit,IC)或芯片,其中该集成电路可以是一个IC,也可以是多个IC的集合;该芯片可以包括但不限于以下种类:GPU(Graphics Processing Unit,图形处理器)、CPU(Central Processing Unit,中央处理器)、FPGA(Field Programmable Gate Array,可编程逻辑阵列)、DSP(Digital Signal Processor,数字信号处 理器)、ASIC(Application Specific Integrated Circuit,专用集成电路)、SOC(System on Chip,SoC,片上系统或系统级芯片)等。上述的集成电路或芯片中可以用于执行可执行指令(或代码),以实现上述的时延测量方法。其中该可执行指令可以存储在该集成电路或芯片中,也可以从其他的装置或设备获取,例如该集成电路或芯片中包括处理器、存储器,以及用于与其他的装置通信的接口。该可执行指令可以存储于该处理器中,当该可执行指令被处理器执行时实现上述的时延测量方法;或者,该集成电路或芯片可以通过该接口接收可执行指令并传输给该处理器执行,以实现上述的时延测量方法。
在另一示例性实施例中,还提供一种计算机程序产品,该计算机程序产品包含能够由可编程的装置执行的计算机程序,该计算机程序具有当由该可编程的装置执行时用于执行上述的时延测量方法的代码部分。
图9是根据一示例性实施例示出的一种电子设备900的框图。例如,电子设备900可以被提供为一服务器,可以作为上述的同步设备或测量设备。参照图9,电子设备900包括处理组件922,其进一步包括一个或多个处理器,以及由存储器932所代表的存储器资源,用于存储可由处理组件922的执行的指令,例如应用程序。存储器932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件922被配置为执行指令,以执行上述时延测量方法。
电子设备900还可以包括一个电源组件926被配置为执行电子设备900的电源管理,一个有线或无线网络接口950被配置为将电子设备900连接到网络,和一个输入/输出(I/O)接口958。电子设备900可以操作基于存储在存储器932的操作系统,例如Windows Server TM,Mac OS X TM,Unix TM,Linux TM,FreeBSD TM或类似。
本领域技术人员在考虑说明书及实践本公开后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (15)

  1. 一种时延测量方法,其特征在于,应用于第一测试设备,所述方法包括:
    获取测量开始时刻所述第一测试设备的第一计数值;所述测量开始时刻为所述第一测试设备的计数器清零并重新开始计时,以及第二测试设备的计数器清零并重新开始计时之后的时刻,所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻相同,或者所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻的时间差为同步周期的整倍数;
    根据所述第一测试设备的计数周期,获取所述第一计数值对应的第一时间戳;
    根据所述第一时间戳,以及所述第二测试设备的第二时间戳确定所述第一测试设备和所述第二测试设备之间的相对时延;其中,所述第二时间戳在所述时延测量开始时刻获取的所述第二测试设备的第二计数值对应的时间戳。
  2. 根据权利要求1所述的方法,其特征在于,所述第一测试设备和第二测试设备与同步设备连接,在所述第一设备的计数器和所述第二设备的计数器的时钟频率不同的情况下,所述方法还包括:
    基于接收到所述同步设备发送的第一输出信号和第二输出信号时所述第一测试设备的计数值,确定所述第一测试设备的计数周期;其中,所述第一输出信号和所述第二输出信号是所述同步设备输出的任意相邻的两个输出信号,所述同步周期为所述同步设备的输出信号发送周期;
    响应于所述第二输出信号,对所述第一测试设备的计数器和清零并重新开始计时。
  3. 根据权利要求2所述的方法,其特征在于,所述基于接收到所述同步设备发送的第一输出信号和第二输出信号时所述第一测试设备的计数值,确定所述第一测试设备的计数周期,包括:
    获取在接收到所述同步设备发送的第一输出信号时所述第一测试设备的计数器的第三计数值;
    获取在接收到所述同步设备发送的第二输出信号时所述第一测试设备的计数器的第四计数值;
    基于所述第三计数值和所述第四计数值确定所述第一测试设备的第一计数周期。
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述第三计数值和所述第四计数值确定所述第一测试设备的第一计数周期,包括:
    将所述第四计数值与所述第三计数值的差值确定为所述第一计数周期;
    将所述第一测试设备的计数器的计数上限值设定为所述第一计数周期的预设倍数,所述预设倍数为整倍数。
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述第一时间戳,以及所述第二测试设备的第二时间戳确定所述第一测试设备和所述第二测试设备之间的相对时延,包括:
    将所述第一时间戳发送至目标设备,以供所述目标设备根据所述第一时间戳和所述第二测试设备的所述第二时间戳确定所述相对时延,所述目标设备为所述第二测试设备,或者为所述第一设备和所述第二测试设备外的其他设备;
    或者,接收所述第二测试设备发送的所述第二时间戳,并根据所述第一时间戳和所述第二时间戳确定所述相对时延。
  6. 根据权利要求2所述的方法,其特征在于,所述第二测试设备是在基于接收到所述同步设备发送的第三输出信号和第四输出信号时所述第二测试设备的计数值确定所述第二测试设备的计数周期后,对计数器清零并重新开始计时的;
    在所述第一测试设备的计数器清零并重新开始计时后,所述第一测试设备的计数器的重新开始计时的起始时刻设置为接收到所述第二输出信号时的时刻;
    在所述第二测试设备的计数器清零并重新开始计时后,所述第二测试设备的计数器的重新开始计时的起始时刻设置为接收到所述第四输出信号时的时刻;
    其中,所述第一输出信号和所述第三输出信号为同一信号,所述第二输出信号和所述第四输出信号为同一信号;或者,所述第一输出信号和第三输出信号的时间差为所述同步设备的输出信号发送周期的N倍,所述第一输出信号和第三输出信号的时间差为所述同步设备的输出信号发送周期的N倍,N为正整数。
  7. 根据权利要求1所述的方法,其特征在于,所述第一时间戳和所述第二时间戳为换算至同一输出信号发送周期的时间戳;
    在所述第一时间戳小于所述第二时间戳的情况下,所述相对时延为所述第二时间戳减去所述第一时间戳的差;
    在所述第一时间戳大于所述第二时间戳的情况下,所述相对时延为所述第一时间戳与所述输出信号发送周期之和再减去所述第一时间戳的差。
  8. 一种时延测量装置,其特征在于,应用于第一测试设备,所述装置包括:
    第一获取装置,被配置为获取测量开始时刻所述第一测试设备的第一计数值;所述测量开始时刻为所述第一测试设备的计数器清零并重新开始计时,以及第二测试设备的计数器清零并重新开始计时之后的时刻,所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻相同,或者所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻的时间差为同步周期的整倍数;
    第二获取装置,被配置为根据所述第一测试设备的计数周期,获取所述第一计数值对应的第一时间戳;
    确定装置,被配置为根据所述第一时间戳,以及所述第二测试设备的第二时间戳确定所述第一测试设备和所述第二测试设备之间的相对时延;其中,所述第二时间戳在所述时延测量开始时刻获取的所述第二测试设备的第二计数值对应的时间戳。
  9. 一种时延测量系统,其特征在于,所述系统包括:同步设备、第一测量设备和第二测量设备,所述同步设备与第一测量设备与第二测量设备连接;
    所述第一测量设备被配置为获取测量开始时刻所述第一测试设备的第一计数值,以及根据所述第一测试设备的计数周期,获取所述第一计数值对应的第一时间戳;
    所述第二测量设备被配置为获取测量开始时刻所述第二测试设备的第二计数值,以及根据所述第二测试设备的计数周期,获取所述第二计数值对应的第二时间戳;其中,所述测量开始时刻为所述第一测试设备的计数器清零并重新开始计时,以及第二测试设备的计数器清零并重新开始计时之后的时刻,所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻相同,或者所述第一测试设备的计数器的清零时刻与所述第二测试设备的清零时刻的时间差为同步周期的整倍数;
    所述第一测量设备和所述第二测量设备还被配置为根据所述第一时间戳和所述第二时间戳确定所述第一测试设备和所述第二测试设备之间的相对时延。
  10. 根据权利要求9所述的系统,其特征在于,所述第一测试设备和第二测试设备与同步设备连接,在所述第一设备的计数器和所述第二设备的计数器的时钟频率不同的情况下,所述同步设备被配置为,向所述第一测量设备和所述第二测量设备分别发送两个输出信号;所述两个输出信号是所述同步设备输出的任意相邻的两个输出信号,所述同步周期为所述同步设备的输出信号发送周期;
    所述第一测试设备被配置为,根据接收到的两个输出信号时的计数值确定所述第一测试设备的计数周期,并响应于接收到的两个输出信号对所述第一测试设备的计数器清零并重新开始计时;
    所述第二测试设备被配置为,根据接收到的两个输出信号时的计数值确定所述第二测试设备的计数周期,并响应于接收到的两个输出信号对所述第二测试设备的计数器清零并重新开始计时。
  11. 根据权利要求10所述的系统,其特征在于,所述第一测量设备接收到的两个输出信号与所述第二测量设备接收到的两个输出信号相同;
    或者,所述第一测量设备接收到的两个输出信号与所述第二测量设备接收到的两个输出信号不同,且所述第一测量设备到的两个输出信号与所述第二测量设备接收到的两个输出信号的时间差为所述同步设备的输出信号发送周期的N倍。
  12. 根据权利要求9-11任一项所述的系统,其特征在于,
    所述第一测量设备,还被配置为将所述第一时间戳发送至所述目标设备,以供所述目标设备根据所述第一时间戳和所述第二测试设备的所述第二时间戳确定所述相对时延,所述目标设备为所述第二测试设备,或者为所述第一设备和所述第二测试设备外的其他设备;或者,接收所述第二测试设备发送的所述第二时间戳,并根据所述第一时间戳和所述第二时间戳确定所述相对时延;
    所述第二测量设备,还被配置为将所述第二时间戳发送至所述目标设备,以供所述目标设备根据所述第一时间戳和所述第二测试设备的所述第二时间戳确定所述相对时延,所述目标设备为所述第一测试设备,或者为所述其他设备;或者,接收所述第一测试设备发送的所述第一时间戳,并根据所述第二时间戳和所述第一时间戳确定所述相对时延。
  13. 一种电子设备,其特征在于,包括:
    存储器,其上存储有计算机程序;
    处理器,用于执行所述存储器中的所述计算机程序,以实现权利要求1-7中任一项所述方法的步骤。
  14. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述程序指令被处理器执行时实现权利要求1-7中任一项所述方法的步骤。
  15. 一种芯片,其特征在于,包括处理器和接口;所述处理器用于读取指令以执行权利要求1-7中任一项所述的方法。
PCT/CN2022/093402 2022-05-17 2022-05-17 时延测量方法、装置、设备、系统、存储介质及芯片 WO2023220939A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2022/093402 WO2023220939A1 (zh) 2022-05-17 2022-05-17 时延测量方法、装置、设备、系统、存储介质及芯片
CN202280004555.6A CN115669043A (zh) 2022-05-17 2022-05-17 时延测量方法、装置、设备、系统、存储介质及芯片

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/093402 WO2023220939A1 (zh) 2022-05-17 2022-05-17 时延测量方法、装置、设备、系统、存储介质及芯片

Publications (1)

Publication Number Publication Date
WO2023220939A1 true WO2023220939A1 (zh) 2023-11-23

Family

ID=85023405

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/093402 WO2023220939A1 (zh) 2022-05-17 2022-05-17 时延测量方法、装置、设备、系统、存储介质及芯片

Country Status (2)

Country Link
CN (1) CN115669043A (zh)
WO (1) WO2023220939A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130301635A1 (en) * 2012-05-11 2013-11-14 James M. Hollabaugh Methods and Apparatus for Synchronizing Clock Signals in a Wireless System
CN106301656A (zh) * 2016-08-30 2017-01-04 北京飞利信电子技术有限公司 一种提高时间戳测量精度的方法及装置
US20180115478A1 (en) * 2016-10-20 2018-04-26 Gatesair, Inc. Extended time reference generation
CN112162591A (zh) * 2020-10-30 2021-01-01 上海兆芯集成电路有限公司 具有多个处理器的电子装置及其同步方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130301635A1 (en) * 2012-05-11 2013-11-14 James M. Hollabaugh Methods and Apparatus for Synchronizing Clock Signals in a Wireless System
CN106301656A (zh) * 2016-08-30 2017-01-04 北京飞利信电子技术有限公司 一种提高时间戳测量精度的方法及装置
US20180115478A1 (en) * 2016-10-20 2018-04-26 Gatesair, Inc. Extended time reference generation
CN112162591A (zh) * 2020-10-30 2021-01-01 上海兆芯集成电路有限公司 具有多个处理器的电子装置及其同步方法
US20220137661A1 (en) * 2020-10-30 2022-05-05 Shanghai Zhaoxin Semiconductor Co., Ltd. Electronic device with multiple processors and synchronization method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
A YONG-GA, YE LING-YUN: "High accurate time stamping approach for time synchronization within networked instrument bus", JIDIAN GONGCHENG = MECHANICAL & ELECTRICAL ENGINEERING MAGAZINE, CN, vol. 27, no. 11, 30 November 2010 (2010-11-30), CN , pages 60 - 64, XP009550789, ISSN: 1001-4551 *

Also Published As

Publication number Publication date
CN115669043A (zh) 2023-01-31

Similar Documents

Publication Publication Date Title
WO2016201888A1 (zh) 多媒体文件播放方法及装置
RU2649936C2 (ru) Способ и устройство для присоединения внешнего оборудования
RU2646944C2 (ru) Способ и устройство для настройки параметров фотосъемки
WO2016110145A1 (zh) 屏幕亮度设置方法及装置
WO2018120906A1 (zh) 缓存状态报告bsr上报触发方法、装置和用户终端
US10708512B2 (en) Method and device for capturing image and storage medium
WO2015180389A1 (zh) 角度测量方法、装置及终端
KR20170020736A (ko) 이미지에 의한 공간 파라미터 결정 방법, 장치, 단말기기, 프로그램 및 컴퓨터 판독가능한 기록매체
WO2018213984A1 (zh) 一种息屏显示方法及装置
RU2640746C9 (ru) Способ и устройство взаимного изменения положений значков
CN115390014A (zh) 距离确定方法及装置、终端、计算机可读存储介质
CN106253996B (zh) 灵敏度衰减测试方法及装置
CN109565869A (zh) 调度请求发送方法和装置
CN105959594B (zh) 摄影设备的测光方法及装置
WO2023220939A1 (zh) 时延测量方法、装置、设备、系统、存储介质及芯片
JP6149162B2 (ja) 測光方法、測光装置、端末、プログラム及び記録媒体
CN117640050A (zh) Ethercat同步系统、方法、装置、设备及存储介质
WO2019080007A1 (zh) 用于发送和接收同步信号的方法、装置、发射机和接收机
WO2020107476A1 (zh) 传输寻呼信令的方法及装置
US10187498B2 (en) Method and apparatus for setting waiting time duration
CN113687686B (zh) 时钟同步方法、装置、电子设备和存储介质
EP4321894A1 (en) Sending time determination method and device, and indoor goniometric method and device
US11846676B2 (en) Method and apparatus for predicting remaining charging time and storage medium
WO2022155930A1 (zh) 定位测量信息确定方法和装置、同步误差发送方法和装置
WO2023168596A1 (zh) 一种确定唤醒信号周期的方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22941981

Country of ref document: EP

Kind code of ref document: A1