CN111585685B - Counter system time calibration method based on UDP increment quotation - Google Patents
Counter system time calibration method based on UDP increment quotation Download PDFInfo
- Publication number
- CN111585685B CN111585685B CN202010412083.0A CN202010412083A CN111585685B CN 111585685 B CN111585685 B CN 111585685B CN 202010412083 A CN202010412083 A CN 202010412083A CN 111585685 B CN111585685 B CN 111585685B
- Authority
- CN
- China
- Prior art keywords
- time
- udp
- quotation
- increment
- line information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/164—Adaptation or special uses of UDP protocol
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Marketing (AREA)
- Economics (AREA)
- Development Economics (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides a counter system time calibration method based on UDP increment quotation, which comprises the following steps: the first step: the counter system time is recorded as T1, a multicast group is added in a period of time before the disc is opened, and the receiving of UDP increment line information is started; and a second step of: the counter system analyzes the received UDP increment line information, obtains the line system time from the information, and marks the line system time as T2, and the third step: comparing T2 with T1, and if T1 is not equal to T2, entering a fourth step; if T1 = T2, then T1 is market time, enter fifth step; fourth step: calculating the time difference between T1 and T2, wherein T2-T1=T3, and the quotation system time is T2=T1+T3, and the fifth step: and (3) circularly acquiring T1, immediately acquiring corresponding quotation system time T2, and when the quotation system time T2 is equal to the time for opening, starting the time for opening to arrive, and starting the newspaper by the client. The method of the invention uses UDP increment line information sent by the quotation system before the transaction system opens the quotation to realize the time synchronization between the counter system and the quotation system.
Description
A counter system time calibration method based on UDP increment quotation.
Technical Field
The invention belongs to trading systems of futures, options, certificates, stocks and the like, and relates to a counter system time calibration method based on UDP increment quotation.
Background
In a high frequency quantized transaction system, a large number of newspapers are generated at the moment of opening the transaction system. How to get to the first order or the first orders after the system is opened has important roles for customers. In this case, obtaining accurate transaction system open time is an important indicator of the performance of a counter system.
Existing counter systems typically achieve time synchronization with the transaction system through a network time protocol NTP (Network Time Protocol). Since the NTP server of the transaction system does not provide service for 24 hours, and the link of NTP data transmission is not the link of the over-the-counter system to the ticketing system or the transaction system, a certain time deviation exists between the over-the-counter system and the transaction system. If the counter system time is earlier than the transaction system, the customer fails to report the bill at the time of opening the disc under the counter system time; if the counter system is later than the transaction system, the customer can successfully report the bill at the time of the opening of the counter system, but the bill effect is greatly reduced because the bill time is later than the time of the opening of the exchange.
Disclosure of Invention
1. The technical problems to be solved are as follows:
in a transaction system, a certain time deviation exists between the counter system and the transaction system, so that the newspaper is unsuccessful or the newspaper effect is greatly reduced.
2. The technical scheme is as follows:
in order to solve the above problems, the present invention provides a counter system time calibration method based on UDP (User Datagram Protocol user datagram protocol) incremental quotation, comprising the steps of: the first step: the counter system time, namely the local time, is recorded as T1, the counter system joins the multicast group in a period of time before the disc is opened, and begins to receive UDP increment line information; and a second step of: the counter system analyzes the received UDP increment quotation (MIRP, market data Incremental Refresh Protocol) message, acquires quotation system time from the message, wherein the quotation system time is recorded as T2, and the following steps are as follows: comparing T2 with T1, and if T1 is not equal to T2, entering a fourth step; if T1 = T2, then T1 is market time, enter fifth step; fourth step: calculating the time difference between T1 and T2, wherein T2-T1=T3, and the quotation system time is T2=T1+T3, and the fifth step: and (3) circularly acquiring T1, immediately acquiring corresponding quotation system time T2, and when the quotation system time T2 is equal to the time for opening, starting the time for opening to arrive, and starting the newspaper by the client.
When the incremental line information is transmitted, a certain time is needed, and if the transmission time of the incremental line information is T4, the quotation system time is T2, and the time of the incremental line information is advanced by T4.
The method for obtaining T4 comprises the following steps: when a plurality of UDP increment line messages exist in one time slice, the counter system calculates local receiving time differences of the plurality of UDP increment line messages, and calculates an average value of the deviation, wherein the average value is T4.
The method for judging the end of the UDP increment line information when a plurality of UDP increment line information exist in one time slice comprises the following steps: the counter system analyzes the Flag field of the head of the UDP increment line information, if the Flag field is 0x11, the current time slice has the subsequent UDP increment line information, and if the Flag field is 0x01, the Flag field indicates that the UDP increment line information in the local time slice is ended.
The counter system counts the local receiving time difference of the UDP increment line information and calculates the maximum value and the minimum value of the deviation.
The maximum and minimum values are provided to the customer as additional information.
3. The beneficial effects are that:
the invention provides a counter system time calibration method based on UDP increment quotation, which realizes time synchronization between a counter system and a quotation system by using UDP increment quotation information sent by a quotation system before a transaction system opens a dish.
Detailed Description
The present invention will be described in detail with reference to examples.
The invention provides a counter system time calibration method based on UDP increment quotation, which aims to make the system time, namely the local time T1, consistent with the quotation system time T2, and adopts the method that the counter system joins a multicast group in a period before starting to start to receive UDP increment quotation information, the counter system analyzes the received UDP increment quotation information and acquires the quotation system time from the information, wherein the quotation system time is recorded as T2, the T2 is the quotation system time at the time, namely the time for starting a transaction system, if T1 = T2, the local time and the quotation system time are the same, the T1 is circularly acquired, and when T1 reaches the starting time, the starting is realized.
In most cases, however, T1 is not equal to T2, where the time difference T3 is calculated, t3=t2—t1, t2=t1+t3, T2 can be calculated by T1 and T3, T2 is calculated by a formula while T1 is circularly acquired, so that an accurate open time can be obtained,
the invention also realizes the synchronization of the local time and the quotation system time through the UDP quotation message.
For more accurate synchronization time, a certain time is needed for transmitting the increment line information on the line, and for the client to send the information sheet at the time of opening, the time of the information sheet reaching the transaction system is just the time of opening. And recording the transmission time of the incremental line information as T4, and advancing the time of T4 by the quotation system time T2.
The acquisition method of T4 comprises the following steps: when a plurality of UDP increment line messages exist in one time slice, the counter system calculates local receiving time differences of the plurality of UDP increment line messages, and calculates an average value of the deviation, wherein the average value is T4.
The counter time and the ticker system time synchronization is made more accurate taking into account T4.
Example 1
Assuming that the current date is 2020-04-23, the time of opening 09:00:00 of the exchange system of the Shanghai futures exchange, that is, the market system time T2 is 9:00:00.
The counter system joins the multicast group before 08:59:00, namely the local time T1 is 08:59:00, starts to receive UDP increment row information, analyzes the MIRP message, extracts the value of the SnapTime field from the head of the MIRP message, the value of the SnapTime field is the quotation system time T2, if T2 is 8:59:00, the local time T1 and the quotation system time are the same, and the local time T1 is started when the local time T1 reaches 9:00:00.
If the time T2 is 8:59:00:500, 500 ms, then the time difference T3 between T2 and T1 is 500 ms, so the ticker system T2 is T1+500 ms, so T1 goes for 59 seconds 500 ms, and reaches 8:59:59:500 to the start time.
Example 2
Based on embodiment 1, considering that a certain time is required for transmitting the incremental line information on the line, in order to enable the client's information sheet to be sent before 09:00:00, so that the time when the information sheet arrives at the transaction system is just 09:00:00.000, the time of the quotation system T2 should be slightly advanced, and the transmission time of the incremental line information is recorded as T4, that is, the time when T2 is advanced by T4, the adjustment process is as follows: the counter system receives a plurality of MIRP incremental line messages pushed by the quotation system at the time of 08:59:00.500; the counter system analyzes the Flag field of the head of the MIRP message, if the Flag field is 0x11, the current time slice has the subsequent MIRP message, and if the Flag field is 0x01, the Flag field indicates that the MIRP message in the local time slice is ended.
The counter system counts the local time differences of receipt of these MIRP messages and calculates the average, minimum and maximum values of the deviations.
The counter system subtracts the average value T4 of the deviation from the quotation system time T2 to obtain an adjusted quotation system time T2. The minimum and maximum values of the deviation are provided to the customer as additional information.
While the invention has been described with reference to the preferred embodiments, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention, and it is intended that the scope of the invention shall be limited only by the claims appended hereto.
Claims (4)
1. A counter system time calibration method based on UDP increment quotation comprises the following steps: the first step: the counter system time, namely the local time, is recorded as T1, the counter system joins the multicast group in a period of time before the disc is opened, and begins to receive UDP increment line information; and a second step of: the counter system analyzes the received UDP increment line information, obtains the line system time from the information, the line system time is recorded as T2, and the third step: comparing T2 with T1, and if T1 is not equal to T2, entering a fourth step; if T1 = T2, then T1 is market time, enter fifth step; fourth step: calculating the time difference between T1 and T2, wherein T2-T1=T3, and the quotation system time is T2=T1+T3, and the fifth step: the method comprises the steps of circularly obtaining T1, immediately obtaining corresponding quotation system time T2, when the quotation system time T2 is equal to the opening time, enabling a customer to start to report a bill when the opening time comes, wherein a certain time is needed when an increment line information is transmitted, recording the transmission time of the increment line information as T4, and the quotation system time is the time that T2 needs to be advanced by T4, wherein the obtaining method of T4 is as follows: when a plurality of UDP increment line messages exist in one time slice, the counter system calculates local receiving time differences of the plurality of UDP increment line messages, and calculates an average value of the deviation, wherein the average value is T4.
2. The UDP delta market based counter system time calibration method of claim 1, wherein: the method for judging the end of the UDP increment line information when a plurality of UDP increment line information exist in one time slice comprises the following steps: the counter system analyzes the Flag field of the head of the UDP increment line information, if the Flag field is 0x11, the current time slice has the subsequent UDP increment line information, and if the Flag field is 0x01, the Flag field indicates that the UDP increment line information in the local time slice is ended.
3. The UDP delta market based counter system time calibration method of claim 1, wherein: the counter system counts the local receiving time difference of the UDP increment line information and calculates the maximum value and the minimum value of the deviation.
4. The UDP delta market based counter system time calibration method of claim 3, wherein: the maximum and minimum values are provided to the customer as additional information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010412083.0A CN111585685B (en) | 2020-05-15 | 2020-05-15 | Counter system time calibration method based on UDP increment quotation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010412083.0A CN111585685B (en) | 2020-05-15 | 2020-05-15 | Counter system time calibration method based on UDP increment quotation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111585685A CN111585685A (en) | 2020-08-25 |
CN111585685B true CN111585685B (en) | 2023-04-21 |
Family
ID=72125123
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010412083.0A Active CN111585685B (en) | 2020-05-15 | 2020-05-15 | Counter system time calibration method based on UDP increment quotation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111585685B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106788836A (en) * | 2016-04-06 | 2017-05-31 | 新华三技术有限公司 | The synchronous method and device of a kind of system time |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103209069A (en) * | 2013-05-07 | 2013-07-17 | 浙江赛思电子科技有限公司 | Time synchronization device and method based on precise time protocol |
JP2018098711A (en) * | 2016-12-15 | 2018-06-21 | 日本電信電話株式会社 | Time synchronization system, client terminal device, time synchronization method, and time synchronization program |
CN108322281A (en) * | 2018-05-14 | 2018-07-24 | 上海市计量测试技术研究院 | Time calibration in network service based on NTP and assessment system and method |
-
2020
- 2020-05-15 CN CN202010412083.0A patent/CN111585685B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106788836A (en) * | 2016-04-06 | 2017-05-31 | 新华三技术有限公司 | The synchronous method and device of a kind of system time |
Also Published As
Publication number | Publication date |
---|---|
CN111585685A (en) | 2020-08-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10158444B1 (en) | Event-driven precision time transfer | |
CN101425891B (en) | Time synchronization method, system and customer terminal | |
US7865760B2 (en) | Use of T4 timestamps to calculate clock offset and skew | |
US9628209B2 (en) | Time synchronization in distributed network testing equipment | |
US20090063315A1 (en) | Charging for long duration sessions in communication networks | |
US20030043744A1 (en) | Systems and methods for packet flow control | |
US20090172455A1 (en) | Using Travel-Time as Means for Improving the Accuracy of Simple Network Time Protocol | |
US7630383B2 (en) | Synchronization of time stamps of peer devices in a communication node | |
US20120179739A1 (en) | Method, apparatus, and system for processing time | |
EP2493126B1 (en) | Method and system for clock recovery in packet switched network | |
CN111585685B (en) | Counter system time calibration method based on UDP increment quotation | |
CN106874267A (en) | A kind of method that asynchronous implement invoice is uploaded in real time | |
WO2023098683A1 (en) | Real-time clock synchronization method and system for power distribution terminal, and power distribution terminal | |
CN103021152A (en) | Beidou data transmission method based on confirmation mode | |
US20060285509A1 (en) | Methods for measuring latency in a multicast environment | |
CN101631015A (en) | Method for calibrating time tag of network time service | |
CN109379160A (en) | A kind of clock alignment server and method | |
CN110620939A (en) | Network state determination method and device, electronic equipment and storage medium | |
CN111092687B (en) | Calendar clock synchronization system of FC switching network system | |
CN109800213B (en) | Production quality data statistical system and method based on rabbitmq | |
CN101184062B (en) | Method, device and system of regulating information server load | |
CN101282189A (en) | Method, system and terminal for clock synchronization | |
EP4016970A3 (en) | Terminal identification based on terminal information in the header of an ip data packet. | |
JP2002324014A (en) | Monitor and control system | |
WO2012100627A1 (en) | Method for updating clock offset, method and apparatus for announcing clock offset message |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |