WO2021196923A1 - 地震采集器的网络授时精度控制方法、系统及终端设备 - Google Patents

地震采集器的网络授时精度控制方法、系统及终端设备 Download PDF

Info

Publication number
WO2021196923A1
WO2021196923A1 PCT/CN2021/077592 CN2021077592W WO2021196923A1 WO 2021196923 A1 WO2021196923 A1 WO 2021196923A1 CN 2021077592 W CN2021077592 W CN 2021077592W WO 2021196923 A1 WO2021196923 A1 WO 2021196923A1
Authority
WO
WIPO (PCT)
Prior art keywords
client
value
data packet
delay
network
Prior art date
Application number
PCT/CN2021/077592
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 US17/475,369 priority Critical patent/US11716162B2/en
Publication of WO2021196923A1 publication Critical patent/WO2021196923A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0682Clock or time synchronisation in a network by delay compensation, e.g. by compensation of propagation delay or variations thereof, by ranging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0016Arrangements for synchronising receiver with transmitter correction of synchronization errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/004Synchronisation arrangements compensating for timing error of reception due to propagation delay
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01VGEOPHYSICS; GRAVITATIONAL MEASUREMENTS; DETECTING MASSES OR OBJECTS; TAGS
    • G01V1/00Seismology; Seismic or acoustic prospecting or detecting
    • G01V1/24Recording seismic data
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01VGEOPHYSICS; GRAVITATIONAL MEASUREMENTS; DETECTING MASSES OR OBJECTS; TAGS
    • G01V2200/00Details of seismic or acoustic prospecting or detecting in general
    • G01V2200/10Miscellaneous details
    • G01V2200/12Clock synchronization-related issues

Definitions

  • the invention relates to the field of seismic data acquisition, and in particular to a method, system, terminal equipment and computer-readable storage medium for controlling network timing accuracy of seismic collectors.
  • the embodiments of the present invention provide a method, system, and terminal equipment for controlling network timing accuracy of a seismic collector.
  • the algorithm realizes time service and greatly improves the accuracy of time service.
  • the algorithm can run on the NTPV0 version.
  • the interrupt mode is used to make the data packet be received by the application layer of the client, and the interrupt mode is used to send the data packet from the application layer of the client to the physical layer of the client;
  • the network environment constraint value is preset
  • the physical layer of the server After correcting the transmission error in the network timing process according to the optimal network delay, the physical layer of the server receives the data packet;
  • the data is sent from the physical layer of the server to the application layer of the server for timing the data packet.
  • Pre-set the client's application layer sending data packet mode and the physical layer receiving data packet mode to interrupt mode set the physical layer priority of the client to the highest, and the application layer interrupt priority to the physical layer priority of the client Decrease by 1;
  • the client packs the NTP data packet, and the sending time field is filled with the client's own time CT1 obtained at the packing time plus 1 ms, and the application layer sends the data packet while waiting for an interrupt to occur;
  • the physical layer detects the arrival of the data packet, the reception is interrupted, and the client's own time acquired at the moment is stored, and the data packet is flag bit and waited for processing.
  • the performing constrained convergence judgment on the GAP value and the DELAY value to calculate the optimal network delay includes:
  • DELAY1 is less than DELAY0, and GAP1 is within the range of GAP0 ⁇ (DELAY1-DELAY0)/convergence coefficient, then the DELAY1 and GAP1 are updated to the new GPA0 and DELAY0, this value is marked as available, and the sample is a valid sample;
  • Kalman filtering is performed on the GAP and DELAY values in the effective samples to obtain the DELAYD and GAPD values of the optimal solution;
  • the DELAYD value and GAPD value of the obtained optimal solution are regarded as the optimal network delay.
  • the network timing accuracy control method further includes:
  • DELAY1 is not less than DELAY0, or GAP1 is not within the range of GAP0 ⁇ (DELAY1-DELAY0)/convergence coefficient, the DELAY value and GAP value of this statistics will be discarded.
  • the maximum number of samples in the fitting library is 64.
  • a second aspect of the embodiments of the present invention provides a network timing accuracy control system of a seismic collector, and the network timing accuracy control system includes:
  • the data processing module is used for the data packet received by the client, using the interrupt mode to make the data packet received by the application layer of the client, and using the interrupt mode to send the data packet from the application layer of the client to The physical layer of the client;
  • the optimal network delay calculation module is used to set the network environment constraint value in advance when the client sends the data packet to the server; continuously detect the GAP value and DELAY during the time synchronization process of the network environment constraint value at different times Value, where the GAP value is the clock offset between the client and the server, and the DELAY value is the time delay in the round-trip process between the client and the server; for the GAP Value and DELAY value for constrained convergence judgment, and calculate the optimal network delay;
  • the data processing module is specifically configured to:
  • Pre-set the client's application layer sending data packet mode and the physical layer receiving data packet mode to interrupt mode set the physical layer priority of the client to the highest, and the application layer interrupt priority to the physical layer priority of the client Decrease by 1;
  • the client packs the NTP data packet, and the sending time field is filled with the client's own time CT1 obtained at the packing time plus 1 ms, and the application layer sends the data packet while waiting for an interrupt to occur;
  • the physical layer detects the arrival of the data packet, the reception is interrupted, and the client's own time acquired at this moment is stored, and the data packet is flag bit and waited for processing.
  • the optimal network delay calculation module performs constrained convergence judgment on the GAP value and the DELAY value, and calculates the optimal network delay, it is specifically used for:
  • DELAY1 is less than DELAY0, and GAP1 is within the range of GAP0 ⁇ (DELAY1-DELAY0)/convergence coefficient, then the DELAY1 and GAP1 are updated to the new GPA0 and DELAY0, this value is marked as available, and the sample is a valid sample;
  • Kalman filtering is performed on the GAP and DELAY values in the effective samples to obtain the DELAYD and GAPD values of the optimal solution;
  • the DELAYD value and GAPD value of the obtained optimal solution are regarded as the optimal network delay.
  • a third aspect of the embodiments of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
  • the processor implements the above-mentioned first aspect when the processor executes the computer program. And method.
  • a fourth aspect of the embodiments of the present invention provides a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method mentioned in the first aspect is implemented.
  • the embodiment of the present invention has the beneficial effect that: the present application adopts the interrupt mode to enable the data packet to be transferred between the physical layer and the application layer of the client and between the physical layer and the application layer of the server, thereby realizing the data packet
  • the timestamp is accurately stamped, and because this algorithm adopts a symmetric algorithm mode in both the client and the server, the execution error generated by it can be greatly reduced due to the symmetry.
  • the error caused by the data packet transmission between the client and the server it is adjusted by calculating the optimal network delay, which greatly reduces the timing error and improves the network timing accuracy.
  • FIG. 2 is a schematic diagram of a process of transmitting data packets between a client and a server according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a network timing accuracy control system of a seismic acquisition device provided by an embodiment of the present invention
  • Fig. 1 is a schematic flowchart of a method for controlling network timing accuracy of a seismic collector provided by an embodiment of the present invention. The method may include the following steps:
  • S101 For a data packet received by a client, use an interrupt mode to make the data packet receive the data packet by the client's application layer, and use the interrupt mode to send the data packet from the client's application layer to the client's physical layer .
  • S103 Continuously detect the GAP value and the DELAY value in the network environment constraint value time synchronization process at different times, where the GAP value is the clock offset between the client and the server, and the DELAY value is the data packet The time delay in the round-trip process between the client and the server.
  • S104 Perform constrained convergence judgment on the GAP value and DELAY value, and calculate the optimal network delay.
  • S106 Use the interrupt mode to send the data from the physical layer of the server to the application layer of the server for timing the data packet.
  • FIG. 2 is a schematic diagram of another embodiment of the present invention providing a data packet transmission process between the client and the server.
  • the client-server mode of this protocol is adopted, and the communication method is UDP.
  • the timing source is the server, and the client is the seismic collector (hereinafter referred to as the client), which is the time-served Unit, in the server section, the server has a precise time service by default at this time.
  • the time source can come from GPS or other time service units. This will not be discussed here, but some of the algorithm restrictions in the server’s time service process need to be Application layer software restrictions are specifically mentioned here.
  • T1 the time when the client application layer is packaged in the synchronization phase
  • T2 the time when the client physical layer is packaged and sent in the synchronization phase
  • T3 the synchronization phase
  • T4 the time when the server application layer received the data packet in the synchronization phase
  • T5 the time when the server application layer was packaged and sent during the synchronization phase
  • T6 the time when the server physical layer was packaged and sent during the synchronization phase
  • T7 The time when the client physical layer received the data packet during the synchronization phase
  • T8 the time when the client application layer received the data packet during the synchronization phase.
  • the derived character labels include: D1: the time interval experienced by the client from the application layer to the physical layer in the synchronization phase; D2: the synchronization phase of the data packet from the client The delay of the network link to the server; D3: the time interval for the server in the synchronization phase to receive from the physical layer to the application layer; D4: the time interval for the server application layer to receive the data packet in the synchronization phase to send it out; D5: V In the synchronization phase, the time interval between the server package from the application layer to the physical layer; D6: the network link delay between the server and the client in the synchronization phase; D7: the time the client receives from the physical layer to the application layer in the synchronization phase interval.
  • NTP which is based on UDP and is based on the network application layer
  • its timing error mainly comes from two aspects.
  • One is that for different operating systems, the data packets are physically The data from the layer to the application layer is uncontrollable and cannot be estimated; the other is that during the synchronization process, the network delay from the client to the server and from the server to the client is uncontrollable and changes with different network environments, so
  • This algorithm is optimized for the above-mentioned two major ways of NTP to generate errors, so as to improve the timing accuracy.
  • a hardware interrupt-based delay control algorithm between the application layer and the physical layer is proposed, specifically to the client.
  • the expression is: 1. Set the physical layer data packet transmission to interrupt mode, cancel the round-robin mode, and set the sending priority to the highest, so as to ensure that the task is not interrupted by other tasks at the time of sending; 2.
  • the NTP data packet is sent at T1. Pack and fill in the necessary fields.
  • the sending time field is filled with the client’s own time CT1 obtained at the time of packing plus 1ms, and the internal timer CTIMER1 timer interrupt is started.
  • the priority of the interrupt is set to the physical layer priority minus 1 (that is, the second Send priority at the physical layer), and set the TIMER interrupt time to 1ms; 3. Wait for the CTIMER1 interrupt, when the interrupt occurs, that is, start the physical layer data packet interrupt at T2, the data packet is sent; 4. Set the physical layer Reception is in interrupt mode, and the interrupt priority is the highest. Since the physical layer transmission and reception cannot occur at the same time, there will be no conflict between the two; 5. When the data packet arrives, the physical layer reception interrupt is automatically triggered. The client’s own time acquired at this moment is stored in the memory variable, and the client data packet processing flag is set at the same time, waiting for processing; 6. The application layer polling execution sequence sets the NTP data reception processing flag as the front end to ensure its polling queue Its data packets can be processed in the first time.
  • the client's data packet sending and receiving timestamp stamping is based on interrupts, and the priority is set to the highest, so when the main frequency is set to 10M or more, the time accuracy after execution can be controlled at 1 microsecond Within.
  • the specific execution algorithm is expressed as: 1. Set the physical layer reception to interrupt mode, and its interrupt priority is the highest. After that, the server can automatically trigger after receiving the physical layer data packet; 2. Physical layer reception When the data packet is reached, the server interrupt is triggered. At this time, the time stamp of the server is added, and the time of the receiving time is stored in the memory variable SVAR1; 3. Delay, the delay interval is set to 2ms; 4. The data packet is ready to be sent, At this time, the variable SVAR1 is filled into the data packet to be sent, and the current time is obtained, and the obtained current time is filled into SAVAR2, and the time in SAVR2 is added to 1ms and then re-assigned to SAVR2; 5.
  • Start the internal timer STIMER1 set the interrupt priority of this timer to the highest, and set the time interval to 1ms, and set the physical layer transmission interrupt to the highest priority; 6, wait for the STIMER1 interrupt, when the interrupt is sent, start the physical layer data packet transmission Interrupt, the data packet is sent out.
  • the optimal solution estimation algorithm of this network delay is expressed as follows.
  • the variables involved in the expression process include: 1. GAP: the clock offset between the client and the server; 2. DELAY: from the client to the server and the server The round-trip time delay to the client.
  • the calculation method of the two variables this time can be calculated by extracting the relevant fields from the NTP data packet, and the calculation method is a normal operation, so I will not repeat it here; 3.
  • NETCONSUM the network environment constraint value, this value can be set by the user When the network environment is poor, this value can be increased to achieve quality constraints; 4.
  • STRVAR Convergence coefficient, this coefficient controls the convergence range of timing, and the default setting is 2. The higher the selection of this coefficient, the higher the constraint convergence effect. Controllable exclusion of outliers; 5, LIBSUM: the maximum number of samples in the fitting library, this value controls the maximum number of samples in the convergence library, old samples larger than this number will be discarded, usually set this value to 64; 6, FILSUM, The number of filter samples is the number of samples using the Kalman filter, and the number of samples smoothed and filtered by the Kalman filter, usually 32, which can be selected according to needs.
  • Constrain DELAY1 and GAP1 Convergence determination if DELAY1 is less than DELAY0 and GAP1 is within the range of GAP0 ⁇ (DELAY1-DELAY0)/STRVAR, then this DELAY1 and GAP1 are updated to the new GPA0 and DELAY0, this value can be marked as available, and this value can be used as a subsequent time Correction calculation, and when the effective sample is larger than LIBSUM, the queuing method is used to replace the oldest sample value with the latest sample. If GAP1 is not in this range, the secondary value is discarded; 6.
  • FILCNT Count the number of effective Kalman filter samples FILCNT, If the number of valid samples is greater than FILSUM, the GAP and DELAY values contained in the samples will be Kalman filtered to obtain the optimal DELAYD and GAPD, which can be applied to the final time correction. At this time, clear FILCNT and return State 4 continues to execute, if FILCNT is less than FILSUM, then FILCNT is incremented and then returned to state 4 for execution.
  • the present invention provides a high-precision network timing algorithm based on real-time data transmission seismic collectors.
  • the algorithm can be applied to data collectors with network transmission hardware.
  • the software algorithm can realize time service without changing the hardware conditions. And greatly improve the timing accuracy, and in order to achieve maximum compatibility, the algorithm can run on the NTPV0 version, so the implementation basis of this algorithm does not involve the subsequent high version of the NTP protocol, because the advanced version of NTP is backward compatible. Therefore, the application of this algorithm will not be affected when the user uses the advanced version of the NTP protocol.
  • Fig. 3 is a network timing accuracy control method of a seismic collector provided by another embodiment of the present invention, which is described in detail as follows:
  • the client and server depend on the Cortex-M3 embedded MCU based on the ARM architecture in this example, and the selected model is ST's STM32F2 series.
  • this algorithm does not need to make specific requirements for the MCU model, only that the MCU has a corresponding network physical layer interrupt register, which can be configured and responded to this register interrupt.
  • the operating system used by the client and server there is no mandatory dependency requirement in the secondary algorithm, but the following two conditions are required in this operating system: 1. There is a network physical layer interrupt hook function or interface, which can be interrupted Perform the corresponding operation when it occurs; 2 Specific priority configuration can be made for the corresponding interrupt sequence.
  • the operating system uses only the embedded software system design based on interrupt driver and state machine. Its hardware interrupt can interrupt the execution of the main state machine by its priority, and the main state machine can realize the execution of the execution sequence by setting different state flags. Priority.
  • This client MCU chip uses the STM32F207 chip, which has 10/100Ethernet MAC as the physical layer and provides hardware interrupt vectors.
  • the specific expression is: 1. Set the physical layer data packet transmission to interrupt mode, cancel the polling mode, and Set the sending priority to the highest, so as to ensure that the task is not interrupted by other tasks at the time of sending. In this example, set the physical layer sending interrupt master priority to 0, and the slave priority to 0, that is, the highest priority in this chip. Level; 2.
  • the sending time field is filled with the client’s own time CT1 obtained at the time of packing.
  • the priority of the interrupt is set to the physical layer priority minus 1 (that is, second only to the physical layer transmission priority), and the CTIMER interrupt time is set to 1ms, here because of its transmission
  • the time field has been added 1ms when filling, and the CTIMER interrupt can be used to achieve precise control of the 1ms delay, so the 1ms time delay can be accurately offset at the time of CTIMER1 sending; 3.
  • the physical layer data packet is interrupted and the data packet is sent.
  • the physical layer data transmission is executed in the CTIMER1 interrupt. Because it is of the same priority, the transmission process will not be interrupted; 4.
  • Set the physical layer reception to interrupt mode And the interrupt priority is the highest.
  • set the receiving master priority to 0 and the slave priority to 0. Since the physical layer transmission and reception cannot occur at the same time, there will be no conflict between the two; 5, when the data packet arrives At the moment, the physical layer reception interrupt is automatically triggered. At this time, the client's own time obtained at this moment is stored in the memory variable.
  • the variables mainly include the four time variables in the data packet, and the client data packet processing flag bit is set at the same time , Waiting to be processed; 6.
  • the application layer polling execution sequence sets the NTP data reception processing flag as the front end, which can ensure that its polling queue can process its data packets in the first time.
  • the polling flag is mainly used to set its polling Processing priority level, setting its polling processing level to the highest, can ensure that it will be processed in the first time in the subsequent polling process.
  • the client's data packet sending and receiving timestamp stamping is based on interrupts, and the priority is set to the highest, so when the main frequency is set to 10M or more, the time accuracy after execution can be controlled at 1 microsecond within this example, the client crystal oscillator adopts a 12M crystal oscillator, and its main clock frequency is 48M after passing through the frequency multiplier.
  • STM32F207 is also used as the main chip.
  • the peripheral network hardware is the same as the client. It also has 10/100Ethernet MAC as the physical layer, and provides hardware interrupt vectors, because it requires more concurrent operations.
  • Set the main frequency of the frequency multiplier to 120M, and the specific execution algorithm is expressed as: 1.
  • Set the physical layer to receive the interrupt mode, and the interrupt priority is the highest.
  • set the main interrupt priority to 0 , From the priority to 0, which is the highest priority, the server can automatically trigger after receiving the physical layer data packet; 2.
  • the server interrupt is triggered, and the time stamp of the server at this time is stamped at this time , Store the time of the receiving time in the memory variable SVAR1, this time the timestamp is the server receiving time, which is convenient for subsequent filling in the data packet field returned to the client; 3.
  • the delay interval is set to 2ms, in In this example, it is set to 2ms. Since this delay interval is not an exact requirement, and its accuracy will not affect the accuracy of the entire clock synchronization process, a common delay algorithm is used, which will not be repeated here; 4. Preparation Send the data packet.
  • variable SVAR1 is filled into the data packet to be sent, and the current time is obtained, and the obtained current time is filled into SAVAR2, and the time in SAVR2 is added to 1ms and then re-assigned to SAVR2; 5.
  • Start the internal timer STIMER1 set the timer's interrupt priority to the highest, and set the time interval to 1ms, and set the physical layer to send interrupts to the highest priority, here set the interrupt priority of STIMER1 and the physical layer to send interrupts
  • the primary priority is 0, and the secondary priority is 0; 6, waiting for the STIMER1 interrupt, when the interrupt is sent, the physical layer data packet transmission interrupt is started, and the data packet is sent.
  • the following network delay optimal solution estimation algorithm is adopted to greatly reduce the error caused by the network delay.
  • the network delay optimal solution estimation algorithm is expressed as follows. The variables involved in the expression process have been introduced in the document in the previous section, so I will not repeat it here.
  • the optimal solution estimation algorithm of this network delay is expressed as follows: 1. Set NETCONSUM to a fixed constant. In a general network environment, set this value to 16. If the network environment deteriorates, you can increase this value to increase. In this example, set this value to 16; 2. Count and measure the GAP and DELAY values in the NETCONSUM time synchronization process. In this example, use this variable as a two-dimensional array with a size of NETCONSUM and store it as a statistical variable; 3. In the first cycle, select the minimum value of DELAY in NETCONSUM as DELAY0, and put DELAY0 and its corresponding GAP0 into the sample library, mark this value as available, and use this value for subsequent time correction calculations.
  • the minimum value in the array is stored in DEALY0; 4. Continue to count and measure the GAP and DELAY values in the NETCONSUM time synchronization process. Select the minimum value in NETCONSUM as DELAY1 and GAP1, the time interval for continuous statistics and measurement in this example The interval is 10 seconds. This interval is set by the user and can be set according to the clock frequency. The smaller the set value, the faster the clock frequency; 5.
  • DELAY1 and GAP1 Perform constraint convergence judgment on DELAY1 and GAP1, if DELAY1 is less than DELAY0 and GAP1 is within the range of GAP0 ⁇ (DELAY1-DELAY0)/STRVAR, then update DELAY1 and GAP1 to the new GPA0 and DELAY0, mark this value as available, and use this value for subsequent time correction calculations.
  • the value generated after ⁇ (DELAY1-DELAY0) is the range value, which requires the user's attention, and when the effective sample is larger than LIBSUM, the queue method is used to replace the oldest sample value with the latest value
  • the sample in this example, uses a first-in-last-out circular queue structure, so the oldest variable value can be replaced by the latest value. If GAP1 is not within this range, the second value will be discarded, and this calculation will not be affected; 6. Count the number of effective samples of Kalman filter FILCNT.
  • the DELAYD and GAPD are credible and usable variable values. The user can use this variable to perform clock correction. At this time, clear FILCNT and return to state 4 to continue execution. If FILCNT is less than FILSUM, Then the FILCNT is incremented and then returned to the state 4 for execution. At this time, the new Kalman filter coefficient buffer is not yet satisfied, so no new credible and usable DELAYD and GAPD are generated.
  • FIG. 3 is a schematic structural diagram of the network timing accuracy control system of the seismic collector provided by this application. For ease of description, only the parts related to the embodiment of the present invention are shown.
  • the network timing accuracy control system of the seismic collector includes:
  • the data processing module 31 is configured to use an interrupt mode for the data packet received by the client to make the data packet receive the data packet by the application layer of the client, and use the interrupt mode to send the data packet from the application layer of the client To the physical layer of the client;
  • the optimal network delay calculation module 32 is configured to set the network environment constraint value in advance when the client sends the data packet to the server; continuously detect the GAP value and the GAP value during the time synchronization process of the network environment constraint value at different times DELAY value, where GAP value is the clock offset between the client and the server, and DELAY value is the time delay in the round-trip process between the client and the server; GAP value and DELAY value are used to determine the constrained convergence and calculate the optimal network delay;
  • the timing correction module 33 is configured to correct the transmission error in the network timing process according to the optimal network delay, and then receive the data packet by the physical layer of the server; and transmit the data through the interrupt mode
  • the physical layer of the server sends to the application layer of the server to time the data packets.
  • FIG. 4 is a schematic structural diagram of a terminal device provided in Embodiment 4 of the present invention.
  • the terminal device 4 of this embodiment includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and running on the processor 40.
  • the processor 40 implements the steps in the first embodiment of the above method when the computer program 42 is executed, for example, steps S101 to S106 shown in FIG. 1.
  • the processor 40 executes the computer program 42, the functions of the modules/units in the foregoing device embodiments, such as the functions of the modules 31 to 33 shown in FIG. 3, are realized.
  • the computer program 42 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 41 and executed by the processor 40 to complete this invention.
  • the one or more modules/units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 42 in the terminal device 4.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明提供了一种地震采集器的网络授时精度控制方法、系统及终端设备,包括:采用中断模式使传递数据包;计算最优网络延迟;根据最优网络延迟对网络授时过程中的传递误差进行校正后,由服务器的物理层接收所述数据包,通过中断模式将数据由服务器的物理层发送到服务器的应用层为数据包进行授时。本申请采用中断模式使数据包在物理层和应用层之间传递,实现了数据包时间戳精确加盖,并且由于此算法在客户端和服务器都采用对称算法模式,其产生的执行误差可由于对称性大大减少。针对客户端和服务器之间数据包传递产生的误差通过计算最优网络延时对其进行调整,大大减小授时误差,提高网络授时精度。

Description

地震采集器的网络授时精度控制方法、系统及终端设备 技术领域
本发明涉及地震数据采集领域,尤其涉及一种地震采集器的网络授时精度控制方法、系统、终端设备及计算机可读存储介质。
背景技术
在地球物理领域,特别是地震数据采集领域,其地震采集器的采集的地震数据的时间信息是地震信号非常重要的信息之一,具体到地震数据采集器,其自身的时间服务也是其重要指标之一,现在所有的地震数据采集器其时间授时服务来源主要来自于两个方面,一个是基于GPS的时间服务,具体为从串口,I2C或者SPI等通信接口接收固定格式的报文信息,其信息内包含具体的年月日,时分秒信息,另外配合PPS秒脉冲实现时间的精确授时;另外一种是基于网络的时间授时机制,其具体分为两种,一种是基于通用网络的NTP网络授时协议,其授时机制工作在网络应用层,可以实现在通用的网络硬件下实现时间同步,缺点是授时精度低,其授时精度在ms级;另外一种基于网络的时间同步协议是PTP网络授时协议,其工作在特定的网络链路下,需要特殊的硬件配合才能实现网络授时,其优点是授时精度高,其授时精度可精确到微妙级,缺点是实施成本高,包括必要的硬件成本和软件运行成本,且需要特殊的网络硬件支持,因此在通用的网络硬件条件下不利于实施。
对于地震数据采集领域,常规的地震数据采集在处理地球物理天然地震信号的情况下要求的采样率在500以下,且对于主动源地震采集,其数据采样率要求也在10K以下,因此对于其特殊的应用领域,其地震数据采集器的时钟精度需要控制在微秒到十分之一毫秒之间,且对于基于实时数据传输到地震采集器而言,由于其需要将采集到数据通过网络传输到固定的服务器或者台网中,因此其必然标配正常的网络通信模组,可实现网络应用层上的软件嵌入,同时由于地震数据采集器其部分需要布设到矿井,大楼内部等特殊环境,其环境内不可能接受到GPS信号。
发明内容
鉴于此,本发明实施例提供了一种地震采集器的网络授时精度控制方法、系统及终端设备,该方法可应用于具有网络传输硬件的数据采集器中,可在不改变硬件条件下通过软件算法实现时间授时,并大幅的提高授时精度,且为达到最大兼容性,其算法可在NTPV0版本上运行。
本发明实施例的第一方面提供了一种地震采集器的网络授时精度控制方法,所述网络授时精度控制方法包括:
对客户端接收到的数据包,采用中断模式使所述数据包由客户端的应用层接收所述数据包,并采用中断模式将所述数据包由客户端的应用层发送到客户端的物理层;
所述客户端向服务器发型所述数据包时,预先设置网络环境约束值;
连续检测不同时刻所述网络环境约束值次对时过程中的GAP值和DELAY值,其中,GAP值为所述客户端和所述服务器之间的时钟偏移量,DELAY值为数据包在所述客户端和所述服务器之间往返过程中的时间延迟;
对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟;
根据所述最优网络延迟对网络授时过程中的传递误差进行校正后,由所述服务器的物理层接收所述数据包;
通过所述中断模式将所述数据由服务器的物理层发送到服务器的应用层为数据包进行授时。
可选地,所述采用中断模式使所述数据包由客户端的应用层接收所述数据包,并采用中断模式将所述数据包由客户端的应用层发送到客户端的物理层,包括:
预先设置客户端的应用层的发送数据包的模式及物理层接收数据包的模式为中断模式,设置所述客户端的物理层优先级为最高,应用层中断的优先级为所述客户端的物理层优先级减1;
T1时刻客户端将NTP数据包打包,发送时间字段填充为打包时刻所获取的所述客户端自身时间CT1加1ms,等待中断发生时由应用层将数据包发出;
物理层检测到所述数据包到来时,接收中断,并将此刻获取的所述客户端 的自身时间进行存储,对数据包进行标志位后等待处理。
可选地,所述对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟,包括:
首次循环选取网络环境约束值中的DELAY值最小值作为DELAY0,并将DELAY0以及其对应的GAP0存储到样本库中;
持续统计和测量网络环境约束值中次对时过程中的GAP值和DELAY值,选取所统计的网络环境约束值中的最小值为DELAY1和GAP1;
若DELAY1小于DELAY0,且GAP1在GAP0±(DELAY1-DELAY0)/收敛系数范围内,则所述DELAY1和GAP1更新为新的GPA0和DELAY0,标记此值可用,样本为有效样本;
若有效样本个数大于拟合库样本最大数,则对有效样本中的GAP值和DELAY值进行卡尔曼滤波,以得到最优解的DELAYD值和GAPD值;
将所得到的最优解的DELAYD值和GAPD值作为最优网络延迟。
可选地,所述网络授时精度控制方法还包括:
若DELAY1不小于DELAY0,或GAP1不在GAP0±(DELAY1-DELAY0)/收敛系数范围内,则舍弃此次统计的DELAY值和GAP值。
可选地,所述拟合库样本最大数为64。
本发明实施例的第二方面提供了一种地震采集器的网络授时精度控制系统,所述网络授时精度控制系统包括:
数据处理模块,用于对客户端接收到的数据包,采用中断模式使所述数据包由客户端的应用层接收所述数据包,并采用中断模式将所述数据包由客户端的应用层发送到客户端的物理层;
最优网络延迟计算模块,用于在所述客户端向服务器发型所述数据包时,预先设置网络环境约束值;连续检测不同时刻所述网络环境约束值次对时过程中的GAP值和DELAY值,其中,GAP值为所述客户端和所述服务器之间的时钟偏移量,DELAY值为数据包在所述客户端和所述服务器之间往返过程中的时间延迟;对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟;
校正授时模块,用于根据所述最优网络延迟对网络授时过程中的传递误差进行校正后,由所述服务器的物理层接收所述数据包;并通过所述中断模式将所述数据由服务器的物理层发送到服务器的应用层为数据包进行授时。
可选地,所述数据处理模块具体用于,
预先设置客户端的应用层的发送数据包的模式及物理层接收数据包的模式为中断模式,设置所述客户端的物理层优先级为最高,应用层中断的优先级为所述客户端的物理层优先级减1;
T1时刻客户端将NTP数据包打包,发送时间字段填充为打包时刻所获取的所述客户端自身时间CT1加1ms,等待中断发生时由应用层将数据包发出;
物理层检测到所述数据包到来时,接收中断,并将此刻获取的所述客户端的自身时间进行存储,对数据包进行标志位后等待处理。
可选地,所述最优网络延迟计算模块在对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟时,具体用于:
首次循环选取网络环境约束值中的DELAY值最小值作为DELAY0,并将DELAY0以及其对应的GAP0存储到样本库中;
持续统计和测量网络环境约束值中次对时过程中的GAP值和DELAY值,选取所统计的网络环境约束值中的最小值为DELAY1和GAP1;
若DELAY1小于DELAY0,且GAP1在GAP0±(DELAY1-DELAY0)/收敛系数范围内,则所述DELAY1和GAP1更新为新的GPA0和DELAY0,标记此值可用,样本为有效样本;
若有效样本个数大于拟合库样本最大数,则对有效样本中的GAP值和DELAY值进行卡尔曼滤波,以得到最优解的DELAYD值和GAPD值;
将所得到的最优解的DELAYD值和GAPD值作为最优网络延迟。
本发明实施例的第三方面提供了一种终端设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,上述处理器执行上述计算机程序时实现上述第一方面提及的方法。
本发明实施例的第四方面提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,上述计算机程序被处理器执行时实现上述第一 方面提及的方法。
本发明实施例与现有技术相比存在的有益效果是:本申请采用中断模式使数据包在客户端的物理层和应用层之间以及服务器的物理层和应用层之间传递,实现了数据包时间戳精确加盖,并且由于此算法在客户端和服务器都采用对称算法模式,其产生的执行误差可由于对称性大大减少。针对客户端和服务器之间数据包传递产生的误差通过计算最优网络延时对其进行调整,大大减小授时误差,提高网络授时精度。
附图说明
图1为本发明实施例提供的地震采集器的网络授时精度控制方法的流程示意图;
图2为本发明实施例提供数据包在客户端和服务器传递过程的示意图;
图3为本发明实施例提供的地震采集器的网络授时精度控制系统的结构示意图;
图4为本发明实施例提供的终端设备的结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。
实施例一
图1是本发明实施例提供的地震采集器的网络授时精度控制方法的流程示意图,该方法可以包括以下步骤:
S101:对客户端接收到的数据包,采用中断模式使所述数据包由客户端的应用层接收所述数据包,并采用中断模式将所述数据包由客户端的应用层发送到客户端的物理层。
S102:所述客户端向服务器发型所述数据包时,预先设置网络环境约束值。
S103:连续检测不同时刻所述网络环境约束值次对时过程中的GAP值和DELAY值,其中,GAP值为所述客户端和所述服务器之间的时钟偏移量,DELAY值为数据包在所述客户端和所述服务器之间往返过程中的时间延迟。
S104:对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟。
S105:根据所述最优网络延迟对网络授时过程中的传递误差进行校正后,由所述服务器的物理层接收所述数据包。
S106:通过所述中断模式将所述数据由服务器的物理层发送到服务器的应用层为数据包进行授时。
实施例二
下面结合具体例子对本申请提供的授时精度控制方法进行说明;图2为本发明另一实施例提供数据包在客户端和服务器传递过程的示意图。
在NTPV0协议基础上,采用此协议的客户端服务器模式,通信方式为UDP,在此协议基础上,其授时源为服务器,客户端为地震采集器(一下简称为客户端),其为被授时单元,在服务器段,默认此时服务器已有精确时间授时,其时间来源可来自于GPS或者其他授时单元,在此不做讨论,但对于服务器的授时过程中的算法限制,其有一部分需要有应用层软件限制,在此特别提出。
另外,涉及到NTP协议中的其他常规名称和通用的同步过程,在本发明中不再赘述。
为达到上述发明特点,发明的技术解决方案如下:
如图2所示,其中在图示中,各个字符标号的含义为:T1:同步阶段客户端应用层打包后发出的时间;T2:同步阶段客户端物理层打包发出的时间;T3: 同步阶段服务器物理层收到数据包的时间;T4:同步阶段服务器应用层收到数据包的时间;T5:同步阶段服务器应用层打包发出的时间;T6:同步阶段服务器物理层打包发出的时间;T7:同步阶段客户端物理层收到数据包的时间;T8:同步阶段客户端应用层收到数据包的时间。
进一步的,对于上述的字符标号,便于下面算法阐述,其衍生的字符标号包括:D1:同步阶段客户端从应用层打包到物理层打包所经历的时间间隔;D2:同步阶段数据包从客户端到服务器之间的网络链路延迟;D3:同步阶段服务器从物理层接收到应用层接收的时间间隔;D4:同步阶段服务器应用层从接收到数据包到发出数据包的时间间隔;D5:V同步阶段服务器从应用层打包到物理层经历的时间间隔;D6:同步阶段数据包从服务器到客户端之间的网络链路延迟;D7:同步阶段客户端从物理层接收到应用层接收的时间间隔。
进一步的,由于NTP的工作机制,其建立在UDP的基础上,是建立在网络应用层之上的,其授时误差主要来源于两个方面,一个是对于不同的操作系统,其数据包从物理层到应用层的数据不可控,且无法估计;另外一个是在同步过程中,其从客户端到服务器和从服务器到客户端的网络延时不可控,且随着不同的网络环境而改变,因此本算法是针对此上述NTP产生误差的两大途径进行的优化,从而实现授时精度的提高。
进一步的,对于数据包从物理层到网络层以及数据包从网络层到物理层的授时误差,提出一种基于硬件中断的应用层与物理层之间的延时控制算法,具体到客户端,其表述为:1,将物理层数据包发送设置为中断模式,取消轮训模式,并设置发送优先级为最高,从而保证发送时刻此任务不受其他任务打断;2,T1时刻将NTP数据包打包,并填充必要字段,其发送时间字段填充为打包时刻获取的客户端自身时间CT1加1ms,启动内部定时器CTIMER1定时中断, 中断的优先级设置为物理层优先级减1(即为仅次于物理层发送优先级),并且设置TIMER中断的时间为1ms;3,等待CTIMER1中断,当中断发生时,也即是T2时刻启动物理层数据包发生中断,数据包发出;4,设置物理层接收为中断模式,且中断优先级为最高,由于物理层发送和接收不可能同时发生,因此其两者不会发生冲突;5,当数据包到来时刻,自动触发物理层接收中断,此时将此刻获取的客户端自身时间存储到内存变量中,同时设置客户端数据包处理标志位,等待处理;6,应用层轮训执行序列设置NTP数据接收处理标志位为最前端,可保证其轮询队列可在第一时间处理其数据包。
进一步的,由于将客户端的数据包发送和接收时间戳加盖都是基于中断,且设置为优先级为最高,因此在主频设置为10M以上时,其执行后的时间精度可控制在1微妙以内。
进一步的,对于服务器端,其具体执行算法表述为:1,设置物理层接收为中断模式,其中断优先级为最高,其后服务器接收到物理层数据包后可自动触发;2,物理层接收到数据包后触发服务器中断,此时加盖服务器此时的时间戳,将接收时刻的时间存放在内存变量SVAR1中;3,延时,延时间隔设置为2ms;4,准备发送数据包,此时将变量SVAR1填充到要发送的数据包中,并获取当前时间,将获取的当前时间填充到到SAVAR2中,并将SAVR2中的时间加1ms后重新赋值给SAVR2;5,启动内部定时器STIMER1,将此定时器的中断优先级设置为最高,并将时间间隔设置为1ms,并设置物理层发送中断为最高优先级;6,等待STIMER1中断,当中断发送时,启动物理层数据包发送中断,数据包发出。
进一步的,由于采用上述客户端和服务器发送接收算法,此时可实现,数据包时间戳精确加盖,并且由于此算法在客户端和服务器都采用对称算法模式, 其产生的执行误差可由于对称性大大减少。
进一步的,针对网络延时产生的误差,采用如下的网络延时最优解估计算法,大大减少网络延时引起的误差。先将此网络延时最优解估计算法表述如下,在表述过程中涉及到的变量包括:1,GAP:客户端和服务器之间的时钟偏移;2,DELAY:从客户端到服务器以及服务器到客户端之间的往返的时间延迟。在此次两个变量的计算方式可从NTP数据包中提取相关字段就行计算,且计算方式为常规操作,在此不再赘述;3,NETCONSUM:为网络环境约束值,此值可由用户自行设定,当网络环境较差时可增加此值,来实现质量约束;4,STRVAR:收敛系数,此系数控制授时的收敛范围,默认设置为2,此系数选取越高,约束收敛效应越高,可控制排除异常值;5,LIBSUM:拟合库样本最大数,此值控制收敛库中最大样本数,大于此数的旧的样本将会被舍弃,通常设置此值为64;6,FILSUM,滤波器样本数,采用卡尔曼滤波器的样本个数,采用卡尔曼滤波器对其进行平滑滤波的的样点数,通常选取32,可根据需要选择。
现将此网络延时最优解估计算法表述如下:1,设置NETCONSUM为固定常熟,在一般网络环境下,设置此值为16,如遇到网络环境变差情况,可加此值变高;2,统计和测量NETCONSUM次对时过程中的GAP和DELAY值;3,首次循环选取NETCONSUM中的DELAY最小值作为DELAY0,并将DELAY0以及其对应的GAP0放入到样本库中,标记此值可用,并可用此值用作后续的时间校正计算;4,持续统计和测量NETCONSUM次对时过程中的GAP和DELAY值,选取NETCONSUM中的最小值为DELAY1和GAP1;5,对DELAY1和GAP1进行约束收敛判定,如若DELAY1小于DELAY0且GAP1在GAP0±(DELAY1-DELAY0)/STRVAR范围内,那么将此DELAY1和GAP1 更新为新的GPA0和DELAY0,标记此值可用,并可用此值用作后续的时间校正计算,并且当有效样本大于LIBSUM时采用队列方式将之前最老的样本值替换为最新样本,如若GAP1不在此范围内,则将次值舍弃;6,统计卡尔曼滤波有效样本个数FILCNT,如若有效样本个数大于FILSUM时对其包含样本中的GAP和DELAY值进行卡尔曼滤波,后得到最优解的DELAYD和GAPD,可应用于最后的时间校正,此时将FILCNT清零,后返回状态4继续执行,如若FILCNT小于FILSUM,则将FILCNT递增后返回状态4执行。
本发明的提供一种基于实时数据传输地震采集器的高精度网络授时算法,该算法可应用于具有网络传输硬件的数据采集器中,可在不改变硬件条件下通过该软件算法实现时间授时,并大幅的提高授时精度,且为达到最大兼容性,其算法可在NTPV0版本上运行,因此在此算法的实现基础不涉及后续高版本的NTP协议,由于NTP的高级版本是向下兼容的,因此用户在使用高级版本的NTP协议时并不影响本算法的应用。
实施例三
图3是本发明另一实施例提供的地震采集器的网络授时精度控制方法,详述如下:
对于此基于实时数据传输地震采集器的高精度网络授时算法所依赖的客户端和服务器在此实例中均为基于ARM架构的Cortex-M3嵌入式MCU,其选用型号为意法半导体的STM32F2系列,在此此算法并不需要对MCU型号做出具体要求,仅需要此MCU有相应的网络物理层中断寄存器,可配置和响应此寄存器中断。对于客户端和服务器所采用的操作系统,在次算法中也不做强制依赖要求,但需要此操作系统中具备如下两个条件:1,有网络物理层中断挂接函数或者接口,可以在中断发生时执行相应的操作;2对于中断相应序列 能做具体的优先级配置,在同时发生不同中断时,可根据不同的优先级来响应不同的中断函数,在此实例中没有采用现成的既有操作系统,仅采用基于中断驱动和状态机的嵌入式软件系统设计,其硬件中断可通过其优先级打断主状态机执行,且主状态机可通过设置不同的状态标志位实现执行序列的执行先后顺序。
进一步的,对于数据包从物理层到网络层以及数据包从网络层到物理层的授时误差,提出的一种基于硬件中断的应用层与物理层之间的延时控制算法,具体到客户端,此客户端MCU芯片采用STM32F207芯片,其芯片具备10/100Ethernet MAC为物理层,且提供硬件中断向量,其具体表述为:1,将物理层数据包发送设置为中断模式,取消轮训模式,并设置发送优先级为最高,从而保证发送时刻此任务不受其他任务打断,在此实例中设置物理层发送中断主优先级为0,从优先级为0,也即在此芯片中为最高优先级;2,T1时刻将NTP数据包打包,并填充必要字段,在此NTP数据包打包包括NTP服务器地址填充,UDP必要数据包填充,其发送时间字段填充为打包时刻获取的客户端自身时间CT1加1ms,启动内部定时器CTIMER1定时中断,中断的优先级设置为物理层优先级减1(即为仅次于物理层发送优先级),并且设置CTIMER中断的时间为1ms,在此由于其发送时间字段在填充时已经加1ms,并且采用CTIMER中断可实现1ms延时精确控制,因此在CTIMER1发送时刻可以精确抵消1ms时间延迟;3,等待CTIMER1中断,当中断发生时,也即是T2时刻启动物理层数据包发生中断,数据包发出,在此将物理层数据发送放在CTIMER1中断中执行,由于其为同等优先级,其发送过程不会被打断;4,设置物理层接收为中断模式,且中断优先级为最高,在此设置接收主优先级为0,从优先级为0,由于物理层发送和接收不可能同时发生,因此其两者不会发生冲突;5,当 数据包到来时刻,自动触发物理层接收中断,此时将此刻获取的客户端自身时间存储到内存变量中,在此实例中变量主要包括数据包中的四个时间变量,同时设置客户端数据包处理标志位,等待处理;6,应用层轮训执行序列设置NTP数据接收处理标志位为最前端,可保证其轮询队列可在第一时间处理其数据包,在此实例中主要通过轮训标志位设置其轮训处理优先级别,将其轮询处理级别设置为最高,可保证其在后续轮训过程中得到第一时间处理。
进一步的,由于将客户端的数据包发送和接收时间戳加盖都是基于中断,且设置为优先级为最高,因此在主频设置为10M以上时,其执行后的时间精度可控制在1微妙以内,在此实例中,其客户端晶振采用12M晶振,通过倍频器后其主时钟频率为48M。
进一步的,对于服务器端,在此实例中同样采用STM32F207作为主芯片,外围网络硬件跟客户端相同,同样具备10/100Ethernet MAC为物理层,且提供硬件中断向量,由于其需要更多的并发操作,设置倍频器倍频后的主频为120M,其具体执行算法表述为:1,设置物理层接收为中断模式,其中断优先级为最高,在此实例中设置其中断主优先级为0,从优先级为0,也即最高优先级,其后服务器接收到物理层数据包后可自动触发;2,物理层接收到数据包后触发服务器中断,此时加盖服务器此时的时间戳,将接收时刻的时间存放在内存变量SVAR1中,在此次时间戳为服务器接收时间,便于后续填充到给客户端返回的数据包字段中;3,延时,延时间隔设置为2ms,在此实例中设置为2ms,由于此延时间隔并非精确要求,且其精确度不会影响到整个的对钟流程的精确性,因此采用普通的延时算法,在此不再赘述;4,准备发送数据包,此时将变量SVAR1填充到要发送的数据包中,并获取当前时间,将获取的当前时间填充到到SAVAR2中,并将SAVR2中的时间加1ms后重新赋值给 SAVR2;5,启动内部定时器STIMER1,将此定时器的中断优先级设置为最高,并将时间间隔设置为1ms,并设置物理层发送中断为最高优先级,在此设置STIMER1和物理层发送中断的中断优先级为主优先级为0,从优先级为0;6,等待STIMER1中断,当中断发送时,启动物理层数据包发送中断,数据包发出。
进一步的,由于采用上述客户端和服务器发送接收算法,此时可实现,数据包时间戳精确加盖,并且由于此算法在客户端和服务器都采用对称算法模式,其产生的执行误差可由于对称性大大减少。
进一步的,针对网络延时产生的误差,采用如下的网络延时最优解估计算法,大大减少网络延时引起的误差。先将此网络延时最优解估计算法表述如下,在表述过程中涉及到的变量在上节文档中均已介绍,因此在此不再复述。
现将此网络延时最优解估计算法表述如下:1,设置NETCONSUM为固定常数,在一般网络环境下,设置此值为16,如遇到网络环境变差情况,可加此值变高,在此实例中设置此值为16;2,统计和测量NETCONSUM次对时过程中的GAP和DELAY值,在此实例中将此变量作为大小为NETCONSUM的二维数组作为统计变量存入;3,首次循环选取NETCONSUM中的DELAY最小值作为DELAY0,并将DELAY0以及其对应的GAP0放入到样本库中,标记此值可用,并可用此值用作后续的时间校正计算,在此实例中比较上述数组中的最小值存入到DEALY0;4,持续统计和测量NETCONSUM次对时过程中的GAP和DELAY值,选取NETCONSUM中的最小值为DELAY1和GAP1,在此实例中持续统计和测量的时间间隔为10秒,此间隔为用户自行设定,可根据其对钟频率设定,设定值越小,其对钟频次越快;5,对DELAY1和GAP1进行约束收敛判定,如若DELAY1小于DELAY0 且GAP1在GAP0±(DELAY1-DELAY0)/STRVAR范围内,那么将此DELAY1和GAP1更新为新的GPA0和DELAY0,标记此值可用,并可用此值用作后续的时间校正计算,在此实例中,由于DELAY1和DELAY0相互之间大小关系不确定,因此±(DELAY1-DELAY0)后产生的是范围值,需要用户注意,并且当有效样本大于LIBSUM时采用队列方式将之前最老的样本值替换为最新样本,在此实例中,采用的是先进后出的循环队列结构,因此其可由最新值替换掉最老的变量值,如若GAP1不在此范围内,则将次值舍弃,不影响此次计算;6,统计卡尔曼滤波有效样本个数FILCNT,如若有效样本个数大于FILSUM时对其包含样本中的GAP和DELAY值进行卡尔曼滤波,后得到最优解的DELAYD和GAPD,可应用于最后的时间校正,在此实例中,此DELAYD和GAPD即为可信可用的变量值,用户可应用此变量来进行时钟校正,此时将FILCNT清零,后返回状态4继续执行,如若FILCNT小于FILSUM,则将FILCNT递增后返回状态4执行,此时还不满足新此卡尔曼滤波系数缓冲,因此不产生新的可信可用的DELAYD和GAPD。
实施例四
图3为本申请提供的地震采集器的网络授时精度控制系统的结构示意图,为了便于说明,仅示出了与本发明实施例相关的部分。
所述地震采集器的网络授时精度控制系统,包括:
数据处理模块31,用于对客户端接收到的数据包,采用中断模式使所述数据包由客户端的应用层接收所述数据包,并采用中断模式将所述数据包由客户端的应用层发送到客户端的物理层;
最优网络延迟计算模块32,用于在所述客户端向服务器发型所述数据包时,预先设置网络环境约束值;连续检测不同时刻所述网络环境约束值次对时 过程中的GAP值和DELAY值,其中,GAP值为所述客户端和所述服务器之间的时钟偏移量,DELAY值为数据包在所述客户端和所述服务器之间往返过程中的时间延迟;对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟;
校正授时模块33,用于根据所述最优网络延迟对网络授时过程中的传递误差进行校正后,由所述服务器的物理层接收所述数据包;并通过所述中断模式将所述数据由服务器的物理层发送到服务器的应用层为数据包进行授时。
实施例五
图4是本发明实施例四提供的终端设备的结构示意图。如图4所示,该实施例的终端设备4包括:处理器40、存储器41以及存储在所述存储器41中并可在所述处理器40上运行的计算机程序42。所述处理器40执行所述计算机程序42时实现上述方法实施例一中的步骤,例如图1所示的步骤S101至S106。所述处理器40执行所述计算机程序42时实现上述各装置实施例中各模块/单元的功能,例如图3所示模块31至33的功能。
示例性的,所述计算机程序42可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器41中,并由所述处理器40执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序42在所述终端设备4中的执行过程。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本发明中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在 其它实施例中实现。因此,本发明将不会被限制于本发明所示的这些实施例,而是要符合与本发明所公开的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种地震采集器的网络授时精度控制方法,其特征在于,所述网络授时精度控制方法包括:
    对客户端接收到的数据包,采用中断模式使所述数据包由客户端的应用层接收所述数据包,并采用中断模式将所述数据包由客户端的应用层发送到客户端的物理层;
    所述客户端向服务器发送所述数据包时,预先设置网络环境约束值;
    连续检测不同时刻所述网络环境约束值次对时过程中的GAP值和DELAY值,其中,GAP值为所述客户端和所述服务器之间的时钟偏移量,DELAY值为数据包在所述客户端和所述服务器之间往返过程中的时间延迟;
    对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟;
    根据所述最优网络延迟对网络授时过程中的传递误差进行校正后,由所述服务器的物理层接收所述数据包;
    通过所述中断模式将所述数据由服务器的物理层发送到服务器的应用层为数据包进行授时。
  2. 根据权利要求1所述的网络授时精度控制方法,其特征在于,所述采用中断模式使所述数据包由客户端的应用层接收所述数据包,并采用中断模式将所述数据包由客户端的应用层发送到客户端的物理层,包括:
    预先设置客户端的应用层的发送数据包的模式及物理层接收数据包的模式为中断模式,设置所述客户端的物理层优先级为最高,应用层中断的优先级为所述客户端的物理层优先级减1;
    T1时刻客户端将NTP数据包打包,发送时间字段填充为打包时刻所获取的 所述客户端自身时间CT1加1ms,等待中断发生时由应用层将数据包发出;
    物理层检测到所述数据包到来时,接收中断,并将此刻获取的所述客户端的自身时间进行存储,对数据包进行标志位后等待处理。
  3. 根据权利要求1所述的网络授时精度控制方法,其特征在于,所述对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟,包括:
    首次循环选取网络环境约束值中的DELAY值最小值作为DELAY0,并将DELAY0以及其对应的GAP0存储到样本库中;
    持续统计和测量网络环境约束值次对时过程中的GAP值和DELAY值,选取所统计的网络环境约束值中的最小值为DELAY1和GAP1;
    若DELAY1小于DELAY0,且GAP1在GAP0±(DELAY1-DELAY0)/收敛系数范围内,则所述DELAY1和GAP1更新为新的GPA0和DELAY0,标记此值可用,样本为有效样本;
    若有效样本个数大于拟合库样本最大数,则对有效样本中的GAP值和DELAY值进行卡尔曼滤波,以得到最优解的DELAYD值和GAPD值;
    将所得到的最优解的DELAYD值和GAPD值作为最优网络延迟。
  4. 根据权利要求3所述的网络授时精度控制方法,其特征在于,所述网络授时精度控制方法还包括:
    若DELAY1不小于DELAY0,或GAP1不在GAP0±(DELAY1-DELAY0)/收敛系数范围内,则舍弃此次统计的DELAY值和GAP值。
  5. 根据权利要求4所述的网络授时精度控制方法,其特征在于,所述拟合库样本最大数为64。
  6. 一种地震采集器的网络授时精度控制系统,其特征在于,所述网络授时精度控制系统包括:
    数据处理模块,用于对客户端接收到的数据包,采用中断模式使所述数据包由客户端的应用层接收所述数据包,并采用中断模式将所述数据包由客户端的应用层发送到客户端的物理层;
    最优网络延迟计算模块,用于在所述客户端向服务器发送所述数据包时,预先设置网络环境约束值;连续检测不同时刻所述网络环境约束值次对时过程中的GAP值和DELAY值,其中,GAP值为所述客户端和所述服务器之间的时钟偏移量,DELAY值为数据包在所述客户端和所述服务器之间往返过程中的时间延迟;对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟;
    校正授时模块,用于根据所述最优网络延迟对网络授时过程中的传递误差进行校正后,由所述服务器的物理层接收所述数据包;并通过所述中断模式将所述数据由服务器的物理层发送到服务器的应用层为数据包进行授时。
  7. 根据权利要求6所述的网络授时精度控制系统,其特征在于,所述数据处理模块具体用于,
    预先设置客户端的应用层的发送数据包的模式及物理层接收数据包的模式为中断模式,设置所述客户端的物理层优先级为最高,应用层中断的优先级为所述客户端的物理层优先级减1;
    T1时刻客户端将NTP数据包打包,发送时间字段填充为打包时刻所获取的所述客户端自身时间CT1加1ms,等待中断发生时由应用层将数据包发出;
    物理层检测到所述数据包到来时,接收中断,并将此刻获取的所述客户端的自身时间进行存储,对数据包进行标志位后等待处理。
  8. 根据权利要求6所述的网络授时精度控制系统,其特征在于,所述最优网络延迟计算模块在对所述GAP值和DELAY值进行约束收敛判定,计算最优网络延迟时,具体用于:
    首次循环选取网络环境约束值中的DELAY值最小值作为DELAY0,并将DELAY0以及其对应的GAP0存储到样本库中;
    持续统计和测量网络环境约束值次对时过程中的GAP值和DELAY值,选取所统计的网络环境约束值中的最小值为DELAY1和GAP1;
    若DELAY1小于DELAY0,且GAP1在GAP0±(DELAY1-DELAY0)/收敛系数范围内,则所述DELAY1和GAP1更新为新的GPA0和DELAY0,标记此值可用,样本为有效样本;
    若有效样本个数大于拟合库样本最大数,则对有效样本中的GAP值和DELAY值进行卡尔曼滤波,以得到最优解的DELAYD值和GAPD值;
    将所得到的最优解的DELAYD值和GAPD值作为最优网络延迟。
  9. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至5中任一项所述方法的步骤。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至5中任一项所述方法的步骤。
PCT/CN2021/077592 2020-03-31 2021-02-24 地震采集器的网络授时精度控制方法、系统及终端设备 WO2021196923A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/475,369 US11716162B2 (en) 2020-03-31 2021-09-15 Method and system for controlling network timing precision of a seismic collector, and terminal device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010244198.3 2020-03-31
CN202010244198.3A CN111447030B (zh) 2020-03-31 2020-03-31 地震采集器的网络授时精度控制方法、系统及终端设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/475,369 Continuation US11716162B2 (en) 2020-03-31 2021-09-15 Method and system for controlling network timing precision of a seismic collector, and terminal device

Publications (1)

Publication Number Publication Date
WO2021196923A1 true WO2021196923A1 (zh) 2021-10-07

Family

ID=71650975

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/077592 WO2021196923A1 (zh) 2020-03-31 2021-02-24 地震采集器的网络授时精度控制方法、系统及终端设备

Country Status (3)

Country Link
US (1) US11716162B2 (zh)
CN (1) CN111447030B (zh)
WO (1) WO2021196923A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111447030B (zh) * 2020-03-31 2021-02-19 中国科学院地质与地球物理研究所 地震采集器的网络授时精度控制方法、系统及终端设备
CN113037418B (zh) * 2021-03-17 2023-06-20 广州虎牙科技有限公司 一种网络授时的误差校正方法及相关装置

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1296189A (zh) * 1999-09-27 2001-05-23 法国石油研究所 使用连接地震设备的单元的标准传输网络的传输方法和系统
US7535931B1 (en) * 2003-07-14 2009-05-19 Symmetricom, Inc. Two-way timing protocol
CN102647269A (zh) * 2011-02-22 2012-08-22 中国石油集团长城钻探工程有限公司 井下仪器的时间同步方法
US20140064303A1 (en) * 2012-09-04 2014-03-06 Khalifa University of Science, Technology, and Research Methods and devices for clock synchronization
KR20170069706A (ko) * 2015-12-11 2017-06-21 (주) 소암컨설턴트 미소지진 계측 시스템 및 이의 시간 동기화 방법
CN108897210A (zh) * 2018-07-11 2018-11-27 成都爱为贝思科技有限公司 一种地震勘探数据无线采集和gps时间同步方法
CN109167667A (zh) * 2018-09-18 2019-01-08 武汉海晟科讯科技有限公司 一种基于ptp同步的传感器数据采集传输系统和方法
CN111447030A (zh) * 2020-03-31 2020-07-24 中国科学院地质与地球物理研究所 地震采集器的网络授时精度控制方法、系统及终端设备

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6985499B2 (en) * 2000-04-20 2006-01-10 Symmetricom, Inc. Precise network time transfer
US7363009B2 (en) * 2003-02-03 2008-04-22 Qualcomm Incorporated Method and apparatus for determining propagation delays for use in wide area networks
JP4539691B2 (ja) * 2007-07-31 2010-09-08 日本電気株式会社 災害通知システム、災害通知サーバ、災害速報端末、方法及びプログラム
KR101323128B1 (ko) * 2012-03-13 2013-10-30 주식회사 다산네트웍스 마스터의 발신 메시지 개수 자동 조절을 통한 시간 동기화 장치 및 방법
CN104113517A (zh) * 2013-04-22 2014-10-22 华为技术有限公司 时间戳生成方法、装置及系统
US20160094298A1 (en) * 2014-09-25 2016-03-31 Seabed Geosolutions B.V. Wireless data transfer for an autonomous seismic node
US10005523B2 (en) * 2016-01-19 2018-06-26 Ion Geophysical Corporation Unmanned marine vessel for node deployment and retrieval
MX2018008831A (es) * 2016-01-19 2018-11-09 Ion Geophysical Corp Embarcacion maritima no tripulada para la implementacion y recuperacion de nodos.
US10341083B2 (en) * 2016-09-09 2019-07-02 Huawei Technologies Co., Ltd. System and methods for network synchronization
US10104148B2 (en) * 2017-01-03 2018-10-16 Globalfoundries Inc. Nanosecond accuracy under precision time protocol for ethernet by using high accuracy timestamp assist device
US11050501B2 (en) * 2018-06-14 2021-06-29 Microchip Technology Incorporated Performing PHY-level hardware timestamping and time synchronization in cost-sensitive environments
US11974238B2 (en) * 2018-06-21 2024-04-30 Nokia Technologies Oy Time-synchronized radio bearer for supporting precision timing protocol (PTP) based time sensitive network (TSN) applications
CN108919634B (zh) * 2018-08-13 2020-08-07 中国科学院国家授时中心 一种北斗三频非差非组合观测值时间传递系统及方法

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1296189A (zh) * 1999-09-27 2001-05-23 法国石油研究所 使用连接地震设备的单元的标准传输网络的传输方法和系统
US7535931B1 (en) * 2003-07-14 2009-05-19 Symmetricom, Inc. Two-way timing protocol
CN102647269A (zh) * 2011-02-22 2012-08-22 中国石油集团长城钻探工程有限公司 井下仪器的时间同步方法
US20140064303A1 (en) * 2012-09-04 2014-03-06 Khalifa University of Science, Technology, and Research Methods and devices for clock synchronization
KR20170069706A (ko) * 2015-12-11 2017-06-21 (주) 소암컨설턴트 미소지진 계측 시스템 및 이의 시간 동기화 방법
CN108897210A (zh) * 2018-07-11 2018-11-27 成都爱为贝思科技有限公司 一种地震勘探数据无线采集和gps时间同步方法
CN109167667A (zh) * 2018-09-18 2019-01-08 武汉海晟科讯科技有限公司 一种基于ptp同步的传感器数据采集传输系统和方法
CN111447030A (zh) * 2020-03-31 2020-07-24 中国科学院地质与地球物理研究所 地震采集器的网络授时精度控制方法、系统及终端设备
CN111447030B (zh) * 2020-03-31 2021-02-19 中国科学院地质与地球物理研究所 地震采集器的网络授时精度控制方法、系统及终端设备

Also Published As

Publication number Publication date
US20220006548A1 (en) 2022-01-06
US11716162B2 (en) 2023-08-01
CN111447030A (zh) 2020-07-24
CN111447030B (zh) 2021-02-19

Similar Documents

Publication Publication Date Title
WO2021196923A1 (zh) 地震采集器的网络授时精度控制方法、系统及终端设备
US10158444B1 (en) Event-driven precision time transfer
US8370675B2 (en) Precise clock synchronization
CN110249372A (zh) 传感系统及时间同步方法
CN109818826B (zh) 一种网络路径延迟测量方法及其装置与时间同步系统
US6654356B1 (en) Distributed control system architecture based on synchronized clocks
CN104836630B (zh) Ieee1588时钟同步系统及其实现方法
EP2807785B1 (en) Packet-based timing measurement
US20210288736A1 (en) Method, device, and computer program for improving synchronization of clocks in devices linked according to a daisy-chain topology
JPH0251715A (ja) 分散処理システムにおける正しい時刻を保持する方法
US11336383B2 (en) Packet scheduling system with desired physical transmission time for packets
CN109683567B (zh) 基于rs485网络中系统时钟同步方法
US11979481B2 (en) Time synchronisation
CN110121208B (zh) 基于多基站定位的交叉互验时钟同步方法及系统
CN114629586A (zh) 一种网口ptp授时功能扩展装置及扩展方法
WO2012071977A1 (zh) 一种机架内的时间同步方法及设备
TWI618432B (zh) 頻率校正裝置及方法
US11853116B2 (en) Clock error-bound tracker
US11907754B2 (en) System to trigger time-dependent action
CN108683470B (zh) 一种获取和更新透明时钟的电路及方法
JP5626589B2 (ja) ネットワーク機器、および同機器における時刻同期方法
CN102983959B (zh) 在多个mac中实现ptp一步模式和两步模式的方法及装置
CN111381539B (zh) 一种总线实时同步控制装置
WO2020132834A1 (zh) 一种打戳处理方法及装置
Qi et al. A clock synchronization method for ad hoc networks

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: 21779274

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21779274

Country of ref document: EP

Kind code of ref document: A1