CN111399367A - Time correction method based on pigeon clock equipment, server and storage medium - Google Patents

Time correction method based on pigeon clock equipment, server and storage medium Download PDF

Info

Publication number
CN111399367A
CN111399367A CN202010203580.XA CN202010203580A CN111399367A CN 111399367 A CN111399367 A CN 111399367A CN 202010203580 A CN202010203580 A CN 202010203580A CN 111399367 A CN111399367 A CN 111399367A
Authority
CN
China
Prior art keywords
time
ntp
pigeon clock
current
cloud platform
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.)
Pending
Application number
CN202010203580.XA
Other languages
Chinese (zh)
Inventor
文彦峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LongQian (Ningbo) Digital Technology Co.,Ltd.
Original Assignee
Shenzhen Shuai Ge Meiyu Technology Co ltd
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 Shenzhen Shuai Ge Meiyu Technology Co ltd filed Critical Shenzhen Shuai Ge Meiyu Technology Co ltd
Priority to CN202010203580.XA priority Critical patent/CN111399367A/en
Publication of CN111399367A publication Critical patent/CN111399367A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G04HOROLOGY
    • G04RRADIO-CONTROLLED TIME-PIECES
    • G04R20/00Setting the time according to the time information carried or implied by the radio signal
    • G04R20/26Setting the time according to the time information carried or implied by the radio signal the radio signal being a near-field communication signal
    • 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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Electric Clocks (AREA)

Abstract

The invention discloses a time correction method based on pigeon clock equipment, which is applied to a cloud platform and comprises the steps of initiating a time correction request to an edge computing box, receiving and recording the current local time of the pigeon clock equipment fed back by the edge computing box, meanwhile, an NTP protocol packet is constructed and sent to the NTP server, the network time fed back by the NTP server is received and recorded, calculating a time difference value between the edge computing box and the cloud platform according to the current local time and the network time, comparing the time difference value with a preset threshold value, if the time difference value is greater than or equal to the preset threshold value, and after the network time is corrected according to an error correction algorithm to obtain correct time, calculating by using the correct time and the current local time to obtain an error value, and sending the error value to the edge calculation box so that the edge calculation box corrects the current time of the pigeon clock equipment according to the error value. The invention can prevent the pigeon clock equipment from being maliciously tampered to destroy the fairness of the competition.

Description

Time correction method based on pigeon clock equipment, server and storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to a time correction method based on pigeon clock equipment, a cloud platform and a storage medium.
Background
In the racing competition of racing pigeons, time is an important factor influencing the competition result. Only when the accuracy of the time of the pigeon clock equipment is ensured, the accuracy and the fairness of the competition result can be ensured.
In the existing pigeon clock equipment, the competition statistics performance is mainly carried out by depending on a time chip in the pigeon clock equipment and the time of a locally deployed server system, and due to the existence of a plurality of artificial operation spaces, cheating is easily carried out by persons who do not obey the competition rules by cracking the time chip and maliciously tampering the time of the local server, so that the fairness of the competition is damaged, and the benefits of numerous competition pigeon friends are damaged. Therefore, how to prevent the pigeon clock equipment from being tampered maliciously to destroy the fairness of the competition becomes a technical problem which needs to be solved urgently.
Disclosure of Invention
The invention mainly aims to provide a time correction method based on pigeon clock equipment, a cloud platform and a storage medium, and aims to solve the problem that the game fairness is damaged due to malicious tampering of the pigeon clock equipment.
In order to achieve the above object, the invention provides a time correction method based on a pigeon clock device, which is applied to a cloud platform, wherein the pigeon clock device realizes data interaction with the cloud platform through an edge computing box, and the method comprises the following steps:
an acquisition step: initiating a time correction request to the edge computing box in real time or at regular time, receiving and recording the current local time of the pigeon clock equipment fed back by the edge computing box, constructing an NTP protocol packet and sending the NTP protocol packet to an NTP server, and receiving and recording the network time fed back by the NTP server;
a calculation step: calculating to obtain a time difference value between the edge computing box and the cloud platform based on a predetermined time difference algorithm according to the current local time and the network time; and
a correction step: comparing the time difference value with a preset threshold value, if the time difference value is greater than or equal to the preset threshold value, correcting the network time according to a predetermined error correction algorithm to obtain correct time, calculating by using the correct time and the current local time to obtain an error value, and sending the error value to an edge calculation box so that the edge calculation box corrects the current time of the pigeon clock equipment according to the error value.
Preferably, when there are a plurality of pigeon clock devices connected in a distributed manner at the same time, the program further performs the following steps: and allocating a unique preset identifier for each pigeon clock device in advance, and when the edge computing box receives a time correction request initiated by a cloud platform, the edge computing box acquires the current local time of all pigeon clock devices and feeds the current local time back to the cloud platform, wherein each current local time carries the corresponding preset identifier.
Preferably, the correcting step further comprises the steps of: and when the time difference value is greater than or equal to a preset threshold value, generating early warning information and sending the early warning information to a preset client.
Preferably, the time difference algorithm comprises:
Figure BDA0002420186760000021
=(t3-t0)-(t2-t1)
wherein d is a time difference value between the edge computing box and the cloud platform, t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time, i.e. network time, t, when NTP data packet is fed back for NTP server3And receiving the current time of the pigeon clock equipment by the cloud platform according to the NTP data packet.
Preferably, the error correction algorithm comprises:
t=t2
Figure BDA0002420186760000022
wherein t is correct time, theta is time difference of the cloud platform relative to the NTP server, and t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time for NTP server feedback NTP data packetTime, i.e. network time, t3And receiving the current time of the pigeon clock equipment by the cloud platform according to the NTP data packet.
To achieve the above object, the present invention further provides a server, which includes a memory and a processor, wherein the memory stores a time correction program based on a pigeon clock device, and the time correction program based on the pigeon clock device realizes the following steps when being executed by the processor:
an acquisition step: initiating a time correction request to the edge computing box in real time or at regular time, receiving and recording the current local time of the pigeon clock equipment fed back by the edge computing box, constructing an NTP protocol packet and sending the NTP protocol packet to an NTP server, and receiving and recording the network time fed back by the NTP server;
a calculation step: calculating to obtain a time difference value between the edge computing box and the cloud platform based on a predetermined time difference algorithm according to the current local time and the network time; and
a correction step: comparing the time difference value with a preset threshold value, if the time difference value is greater than or equal to the preset threshold value, correcting the network time according to a predetermined error correction algorithm to obtain correct time, calculating by using the correct time and the current local time to obtain an error value, and sending the error value to an edge calculation box so that the edge calculation box corrects the current time of the pigeon clock equipment according to the error value.
Preferably, when there are a plurality of distributed connected pigeon clock devices simultaneously, the method further comprises the steps of: and allocating a unique preset identifier for each pigeon clock device in advance, and when the edge computing box receives a time correction request initiated by a cloud platform, the edge computing box acquires the current local time of all pigeon clock devices and feeds the current local time back to the cloud platform, wherein each current local time carries the corresponding preset identifier.
Preferably, the correcting step further comprises the steps of: and when the time difference value is greater than or equal to a preset threshold value, generating early warning information and sending the early warning information to a preset client.
Preferably, the time difference algorithm comprises:
Figure BDA0002420186760000041
=(t3-t0)-(t2-t1)
wherein d is a time difference value between the edge computing box and the cloud platform, t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time, i.e. network time, t, when NTP data packet is fed back for NTP server3And receiving the current time of the pigeon clock equipment by the cloud platform according to the NTP data packet.
To achieve the above object, the present invention further provides a computer readable storage medium having stored thereon a pigeon clock equipment based time correction program, which is executable by one or more processors to implement the steps of the pigeon clock equipment based time correction method as described above.
The invention provides a time correction method, a server and a storage medium based on pigeon clock equipment, which initiate a time correction request to an edge calculation box, receive and record the current local time of the pigeon clock equipment fed back by the edge calculation box, meanwhile, an NTP protocol packet is constructed and sent to the NTP server, the network time fed back by the NTP server is received and recorded, calculating a time difference value between the edge computing box and the cloud platform according to the current local time and the network time, comparing the time difference value with a preset threshold value, if the time difference value is greater than or equal to the preset threshold value, and after the network time is corrected according to an error correction algorithm to obtain correct time, calculating by using the correct time and the current local time to obtain an error value, and sending the error value to the edge calculation box so that the edge calculation box corrects the current time of the pigeon clock equipment according to the error value. The invention can prevent the pigeon clock equipment from being maliciously tampered to destroy the fairness of the competition.
Drawings
FIG. 1 is a diagram of an application environment of a server according to a preferred embodiment of the present invention;
FIG. 2 is a schematic diagram of a program module of a preferred embodiment of the pigeon clock device-based time calibration procedure of FIG. 1;
fig. 3 is a schematic flow chart of a time calibration method based on a pigeon clock device according to a preferred embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical embodiments and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, the technical embodiments of the present invention may be combined with each other, but it must be based on the realization of those skilled in the art, and when the combination of the technical embodiments contradicts each other or cannot be realized, such combination of the technical embodiments should be considered to be absent and not within the protection scope of the present invention.
The invention provides a cloud platform 1.
The cloud platform 1 includes, but is not limited to, a memory 11, a processor 12, and a network interface 13.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the cloud platform 1, for example a hard disk of the cloud platform 1. The memory 11 may also be an external storage device of the cloud platform 1 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the cloud platform 1.
Further, the memory 11 may also include both an internal storage unit and an external storage device of the cloud platform 1. The memory 11 may be used not only to store application software installed in the cloud platform 1 and various kinds of data, such as a code of the pigeon clock device-based time correction program 10, etc., but also to temporarily store data that has been output or will be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip for running program code stored in the memory 11 or Processing data, such as executing the time correction program 10 based on a pigeon clock device.
The network interface 13 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and is typically used to establish a communication link between the cloud platform 1 and other electronic devices.
The client can be a desktop computer, a notebook, a tablet computer, a mobile phone, and the like.
Examples of such wired and wireless communication protocols may include, but are not limited to, at least one of transmission control protocol and internet protocol (TCP/IP), User Datagram Protocol (UDP), hypertext transfer protocol (HTTP), File Transfer Protocol (FTP), ZigBee, EDGE, IEEE 802.11, optical fidelity (L i-Fi), 802.16, IEEE 802.11s, IEEE 802.11g, multi-hop communications, wireless Access Points (APs), device-to-device communications, cellular communication protocols, and/or Bluetooth (ToBlueth) communication protocols, or combinations thereof.
Optionally, the cloud platform 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and an optional user interface may also comprise a standard wired interface, a wireless interface, optionally, in some embodiments, the Display may be an L ED Display, a liquid crystal Display, a touch-sensitive liquid crystal Display, an O L ED (Organic light-Emitting Diode) touch screen, and the like.
While fig. 1 only shows the cloud platform 1 with components 11-13 and the pigeon-equipment based time correction program 10, it will be understood by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the cloud platform 1, and may include fewer or more components than shown, or combine certain components, or a different arrangement of components.
In this embodiment, the pigeon clock device based time correction program 10 of fig. 1, when executed by the processor 12, implements the following steps:
an acquisition step: initiating a time correction request to the edge computing box in real time or at regular time, receiving and recording the current local time of the pigeon clock equipment fed back by the edge computing box, constructing an NTP protocol packet and sending the NTP protocol packet to an NTP server, and receiving and recording the network time fed back by the NTP server;
a calculation step: calculating to obtain a time difference value between the edge computing box and the cloud platform 1 based on a predetermined time difference algorithm according to the current local time and the network time; and
a correction step: comparing the time difference value with a preset threshold value, if the time difference value is greater than or equal to the preset threshold value, correcting the network time according to a predetermined error correction algorithm to obtain correct time, calculating by using the correct time and the current local time to obtain an error value, and sending the error value to an edge calculation box so that the edge calculation box corrects the current time of the pigeon clock equipment according to the error value.
In another embodiment, when there are multiple pigeon clock devices in a distributed connection at the same time, the program further performs the following steps:
and allocating a unique preset identifier for each pigeon clock device in advance, and when the edge computing box receives a time correction request initiated by the cloud platform 1, the edge computing box acquires the current local time of all pigeon clock devices and feeds the current local time back to the cloud platform 1, wherein each current local time carries the corresponding preset identifier.
In another embodiment, the program performs the steps of:
and when the time difference value is greater than or equal to a preset threshold value, generating early warning information and sending the early warning information to a preset client.
For the detailed description of the above steps, please refer to the following description of fig. 2 regarding a schematic program module diagram of an embodiment of the time correction program 10 based on the pigeon clock facility and fig. 3 regarding a schematic method flow diagram of an embodiment of the time correction method based on the pigeon clock facility.
Referring to fig. 2, a schematic diagram of program modules of an embodiment of the pigeon clock equipment-based time correction program 10 in fig. 1 is shown. The time correction program 10 based on the pigeon clock equipment is divided into a plurality of modules, which are stored in the memory 11 and executed by the processor 12, to complete the present invention. The modules referred to herein are referred to as a series of computer program instruction segments capable of performing specified functions.
In the present embodiment, the time calibration program 10 based on the pigeon clock equipment comprises an obtaining module 110, a calculating module 120 and a calibrating module 130.
The obtaining module 110 is configured to initiate a time correction request to the edge computing box in real time or at regular time, receive and record the current local time of the pigeon clock device fed back by the edge computing box, construct an N TP protocol packet, send the N TP protocol packet to an NTP server, and receive and record the network time fed back by the NTP server.
In the racing competition of racing pigeons, time is an important factor influencing the competition result. Only when the accuracy of the time of the pigeon clock equipment is ensured, the accuracy and the fairness of the competition result can be ensured.
In the existing pigeon clock equipment, the competition result statistics is mainly carried out by depending on a time chip in the pigeon clock equipment and the time of a locally deployed server system, and a lot of artificial operation spaces exist. People who do not obey the competition rules can cheat by cracking the time chip and maliciously tampering the time of the local server, so that the fairness of the competition is damaged, and the benefits of the majority of the pigeon players are damaged.
Therefore, in order to avoid the above situation, in this embodiment, the cloud platform 1 initiates a time correction request to the edge computing box in real time or at regular time, where the time correction request is communicated with the pigeon clock device, receives and records the current local time of the pigeon clock device fed back by the edge computing box, constructs an NTP protocol packet and sends the NTP protocol packet to the NTP server, and receives and records the network time fed back by the NTP server.
The NTP server (Network Time Protocol) is a Protocol for synchronizing computer Time, it can make computer synchronize its server or clock source (quartz clock, GPS, etc.), it can provide high-precision Time correction (L AN has standard deviation less than 1 millisecond, WAN has several tens milliseconds), and it can prevent malicious Protocol attack by means of encryption confirmation.
Therefore, whether the time of the pigeon clock equipment is accurate or not is detected in real time or at regular time by a reverse NTP mode (the cloud platform 1 sends a time correction request to the edge computing box).
And the identification module 120 is configured to calculate a time difference value between the edge computing box and the cloud platform 1 based on a predetermined time difference algorithm according to the current local time and the network time.
Data errors exist due to the fact that network delay and the like may exist in the process that the cloud platform 1 performs data interaction with the edge computing box and the NTP server. Therefore, to avoid errors causing time correction errors. In this embodiment, according to the current local time of the pigeon clock device uploaded by the edge computing box and the network time fed back by the N TP server, a time difference value between the edge computing box and the cloud platform 1 is obtained through computing based on a predetermined time difference algorithm. If the time difference value is greater than or equal to the preset threshold value, it is indicated that a large error exists between the edge computing box and the cloud platform 1, and the time correction request needs to be issued again to the edge computing box until the time difference value is smaller than the preset threshold value.
Wherein the time difference algorithm comprises:
Figure BDA0002420186760000091
=(t3-t0)-(t2-t1)
wherein d is a time difference value between the edge computing box and the cloud platform 1, t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time, i.e. network time, t, when NTP data packet is fed back for NTP server3The current time of the pigeon clock device is when the cloud platform 1 receives the NTP data packet.
The issuing module 130 is configured to compare the time difference value with a preset threshold, correct the network time according to a predetermined error correction algorithm to obtain correct time if the time difference value is greater than or equal to the preset threshold, calculate an error value by using the correct time and the current local time, and send the error value to the edge calculation box, so that the edge calculation box corrects the current time of the pigeon clock device according to the error value.
In this embodiment, by comparing the time difference value with a preset threshold, if the time difference value is greater than or equal to the preset threshold, the network time is corrected according to an error correction algorithm to obtain correct time, an error value is calculated by using the correct time and the current local time, and the error value is sent to the edge calculation box, so that the edge calculation box corrects the current time of the pigeon clock device according to the error value.
Wherein the error correction algorithm comprises:
t=t2
Figure BDA0002420186760000101
wherein t is correct time, theta is time difference of the cloud platform 1 relative to the NTP server, and t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time, i.e. network time, t, when NTP data packet is fed back for NTP server3The current time of the pigeon clock device is when the cloud platform 1 receives the NTP data packet.
In another embodiment, the program further performs the steps of:
when the time difference value is larger than or equal to the preset threshold value, generating early warning information to be sent to a preset client, for example, a mobile phone or a computer of a technician at a game sponsor, and reminding the technician that the time of the pigeon clock equipment is abnormal and needs to be adjusted.
In another embodiment, when there are multiple pigeon clock devices at the game site, the program further performs the steps of:
the method comprises the steps that a unique preset identification (such as id) is allocated to each pigeon clock device in advance, when an edge computing box receives a time correction request initiated by a cloud platform 1, the edge computing box obtains the current local time of all pigeon clock devices and feeds the current local time back to the cloud platform 1, wherein each current local time carries the corresponding preset identification. When a certain pigeon clock device is abnormal, the early warning information carrying the preset identification corresponding to the abnormal pigeon clock device can be generated and sent to the client, and technicians of game sponsors can know which pigeon clock device is abnormal.
In addition, the invention also provides a time correction method based on the pigeon clock equipment. Fig. 3 is a schematic method flow diagram of an embodiment of the time correction method based on the pigeon clock device according to the present invention. The processor 12 of the cloud platform 1, when executing the time correction program 10 based on the pigeon clock facility stored in the memory 11, implements the following steps of the time correction method based on the pigeon clock facility:
and S110, initiating a time correction request to the edge computing box in real time or at regular time, receiving and recording the current local time of the pigeon clock equipment fed back by the edge computing box, constructing an NTP protocol packet and sending the NTP protocol packet to an NTP server, and receiving and recording the network time fed back by the NTP server.
In the racing competition of racing pigeons, time is an important factor influencing the competition result. Only when the accuracy of the time of the pigeon clock equipment is ensured, the accuracy and the fairness of the competition result can be ensured.
In the existing pigeon clock equipment, the competition result statistics is mainly carried out by depending on a time chip in the pigeon clock equipment and the time of a locally deployed server system, and a lot of artificial operation spaces exist. People who do not obey the competition rules can cheat by cracking the time chip and maliciously tampering the time of the local server, so that the fairness of the competition is damaged, and the benefits of the majority of the pigeon players are damaged.
Therefore, in order to avoid the above situation, in this embodiment, the cloud platform 1 initiates a time correction request to the edge computing box in real time or at regular time, where the time correction request is communicated with the pigeon clock device, receives and records the current local time of the pigeon clock device fed back by the edge computing box, constructs an NTP protocol packet and sends the NTP protocol packet to the NTP server, and receives and records the network time fed back by the NTP server.
The NTP server (Network Time Protocol) is a Protocol for synchronizing computer Time, it can make computer synchronize its server or clock source (quartz clock, GPS, etc.), it can provide high-precision Time correction (L AN has standard deviation less than 1 millisecond, WAN has several tens milliseconds), and it can prevent malicious Protocol attack by means of encryption confirmation.
Therefore, whether the time of the pigeon clock equipment is accurate or not is detected in real time or at regular time by a reverse NTP mode (the cloud platform 1 sends a time correction request to the edge computing box).
And S120, calculating to obtain a time difference value between the edge computing box and the cloud platform 1 based on a predetermined time difference algorithm according to the current local time and the network time.
Data errors exist due to the fact that network delay and the like may exist in the process that the cloud platform 1 performs data interaction with the edge computing box and the NTP server. Therefore, to avoid errors causing time correction errors. In this embodiment, according to the current local time of the pigeon clock device uploaded by the edge computing box and the network time fed back by the NTP server, a time difference value between the edge computing box and the cloud platform 1 is obtained through computation based on a predetermined time difference algorithm. If the time difference value is greater than or equal to the preset threshold value, it is indicated that a large error exists between the edge computing box and the cloud platform 1, and the time correction request needs to be issued again to the edge computing box until the time difference value is smaller than the preset threshold value.
Wherein the time difference algorithm comprises:
Figure BDA0002420186760000121
=(t3-t0)-(t2-t1)
wherein d is a time difference value between the edge computing box and the cloud platform 1, t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time, i.e. network time, t, when NTP data packet is fed back for NTP server3The current time of the pigeon clock device is when the cloud platform 1 receives the NTP data packet.
And S130, comparing the time difference value with a preset threshold value, if the time difference value is greater than or equal to the preset threshold value, correcting the network time according to a predetermined error correction algorithm to obtain correct time, calculating by using the correct time and the current local time to obtain an error value, and sending the error value to an edge calculation box so that the edge calculation box corrects the current time of the pigeon clock equipment according to the error value.
In this embodiment, by comparing the time difference value with a preset threshold, if the time difference value is greater than or equal to the preset threshold, the network time is corrected according to an error correction algorithm to obtain correct time, an error value is calculated by using the correct time and the current local time, and the error value is sent to the edge calculation box, so that the edge calculation box corrects the current time of the pigeon clock device according to the error value.
Wherein the error correction algorithm comprises:
t=t2
Figure BDA0002420186760000122
wherein t is correct time, theta is time difference of the cloud platform 1 relative to the NTP server, and t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time, i.e. network time, t, when NTP data packet is fed back for NTP server3The current time of the pigeon clock device is when the cloud platform 1 receives the NTP data packet.
In another embodiment, the method further comprises the steps of:
when the time difference value is larger than or equal to the preset threshold value, generating early warning information to be sent to a preset client, for example, a mobile phone or a computer of a technician at a game sponsor, and reminding the technician that the time of the pigeon clock equipment is abnormal and needs to be adjusted.
In another embodiment, when there are a plurality of pigeon clock devices at the game site, the method further comprises the steps of:
the method comprises the steps that a unique preset identification (such as id) is allocated to each pigeon clock device in advance, when an edge computing box receives a time correction request initiated by a cloud platform 1, the edge computing box obtains the current local time of all pigeon clock devices and feeds the current local time back to the cloud platform 1, wherein each current local time carries the corresponding preset identification. When a certain pigeon clock device is abnormal, the early warning information carrying the preset identification corresponding to the abnormal pigeon clock device can be generated and sent to the client, and technicians of game sponsors can know which pigeon clock device is abnormal.
In addition, the embodiment of the present invention further provides a computer-readable storage medium, which may be any one of or any combination of a hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), a USB memory, and the like. The computer-readable storage medium includes a time calibration program 10 based on a pigeon clock device, and the specific implementation of the computer-readable storage medium of the present invention is substantially the same as the above-mentioned time calibration method based on a pigeon clock device and the specific implementation of the cloud platform 1, and will not be described herein again.
It should be noted that the sequence of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description of the embodiments of the present invention is for illustrative purposes only and does not represent the merits of the embodiments. Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical embodiments of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A time correction method based on a pigeon clock device is applied to a cloud platform, the pigeon clock device realizes data interaction with the cloud platform through an edge computing box, and the method is characterized by comprising the following steps:
an acquisition step: initiating a time correction request to the edge computing box in real time or at regular time, receiving and recording the current local time of the pigeon clock equipment fed back by the edge computing box, constructing an NTP protocol packet and sending the NTP protocol packet to an NTP server, and receiving and recording the network time fed back by the NTP server;
a calculation step: calculating to obtain a time difference value between the edge computing box and the cloud platform based on a predetermined time difference algorithm according to the current local time and the network time; and
a correction step: comparing the time difference value with a preset threshold value, if the time difference value is greater than or equal to the preset threshold value, correcting the network time according to a predetermined error correction algorithm to obtain correct time, calculating by using the correct time and the current local time to obtain an error value, and sending the error value to an edge calculation box so that the edge calculation box corrects the current time of the pigeon clock equipment according to the error value.
2. The pigeon clock equipment-based time correction method according to claim 1, wherein when there are a plurality of pigeon clock equipment in distributed connection at the same time, the program further performs the following steps:
and allocating a unique preset identifier for each pigeon clock device in advance, and when the edge computing box receives a time correction request initiated by a cloud platform, the edge computing box acquires the current local time of all pigeon clock devices and feeds the current local time back to the cloud platform, wherein each current local time carries the corresponding preset identifier.
3. The pigeon clock apparatus based time correction method of claim 1, wherein said correction step further comprises the steps of: and when the time difference value is greater than or equal to a preset threshold value, generating early warning information and sending the early warning information to a preset client.
4. The pigeon clock apparatus based time correction method of claim 1, wherein said time difference algorithm comprises:
Figure FDA0002420186750000021
=(t3-t0)-(t2-t1)
wherein d is a time difference value between the edge computing box and the cloud platform, t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time, i.e. network time, t, when NTP data packet is fed back for NTP server3And receiving the current time of the pigeon clock equipment by the cloud platform according to the NTP data packet.
5. The pigeon clock apparatus based time correction method of claim 1, wherein said error correction algorithm comprises:
t=t2
Figure FDA0002420186750000022
wherein t is correct time, theta is time difference of the cloud platform relative to the NTP server, and t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time, i.e. network time, t, when NTP data packet is fed back for NTP server3And receiving the current time of the pigeon clock equipment by the cloud platform according to the NTP data packet.
6. A server, comprising a memory and a processor, the memory having stored thereon a pigeon clock equipment based time correction program, which when executed by the processor performs the steps of:
an acquisition step: initiating a time correction request to the edge computing box in real time or at regular time, receiving and recording the current local time of the pigeon clock equipment fed back by the edge computing box, constructing an NTP protocol packet and sending the NTP protocol packet to an NTP server, and receiving and recording the network time fed back by the NTP server;
a calculation step: calculating to obtain a time difference value between the edge computing box and the cloud platform based on a predetermined time difference algorithm according to the current local time and the network time; and
a correction step: comparing the time difference value with a preset threshold value, if the time difference value is greater than or equal to the preset threshold value, correcting the network time according to a predetermined error correction algorithm to obtain correct time, calculating by using the correct time and the current local time to obtain an error value, and sending the error value to an edge calculation box so that the edge calculation box corrects the current time of the pigeon clock equipment according to the error value.
7. The server according to claim 6, wherein when there are a plurality of pigeon clock devices in a distributed connection simultaneously, the method further comprises the steps of:
and allocating a unique preset identifier for each pigeon clock device in advance, and when the edge computing box receives a time correction request initiated by a cloud platform, the edge computing box acquires the current local time of all pigeon clock devices and feeds the current local time back to the cloud platform, wherein each current local time carries the corresponding preset identifier.
8. The server of claim 6, wherein the correcting step further comprises the steps of: and when the time difference value is greater than or equal to a preset threshold value, generating early warning information and sending the early warning information to a preset client.
9. The server of claim 6, wherein the time difference algorithm comprises:
Figure FDA0002420186750000031
=(t3-t0)-(t2-t1)
wherein d is a time difference value between the edge computing box and the cloud platform, t0Pigeon clock equipment current time, i.e. current local time, t, when transmitting NTP data packets for the pigeon clock equipment1For the current time, t, of the NTP server when the NTP server receives the NTP data packet2NTP server current time, i.e. network time, t, when NTP data packet is fed back for NTP server3And receiving the current time of the pigeon clock equipment by the cloud platform according to the NTP data packet.
10. A computer readable storage medium having stored thereon a pigeon clock device based time correction program executable by one or more processors for carrying out the steps of the pigeon clock device based time correction method according to any one of claims 1-5.
CN202010203580.XA 2020-03-20 2020-03-20 Time correction method based on pigeon clock equipment, server and storage medium Pending CN111399367A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010203580.XA CN111399367A (en) 2020-03-20 2020-03-20 Time correction method based on pigeon clock equipment, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010203580.XA CN111399367A (en) 2020-03-20 2020-03-20 Time correction method based on pigeon clock equipment, server and storage medium

Publications (1)

Publication Number Publication Date
CN111399367A true CN111399367A (en) 2020-07-10

Family

ID=71431052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010203580.XA Pending CN111399367A (en) 2020-03-20 2020-03-20 Time correction method based on pigeon clock equipment, server and storage medium

Country Status (1)

Country Link
CN (1) CN111399367A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113628392A (en) * 2021-08-19 2021-11-09 上海擎朗智能科技有限公司 Time management method, device and storage medium
CN114006674A (en) * 2021-12-31 2022-02-01 深圳市海清视讯科技有限公司 Time correction method, device, equipment and storage medium for attendance equipment
US20230281301A1 (en) * 2022-03-03 2023-09-07 Dell Products, L.P. System and method for detecting and reporting system clock attacks within an indicators of attack platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1202138A2 (en) * 2000-10-31 2002-05-02 Sony Corporation Distributing clock information
WO2007069041A2 (en) * 2005-12-15 2007-06-21 Abb Technology Ltd. Using travel-time as means for improving the accuracy of simple network time protocol
CN104981742A (en) * 2013-06-12 2015-10-14 富士电机株式会社 Distribution device, distribution system, and distribution method
CN106375375A (en) * 2016-08-25 2017-02-01 烟台中恒时钟科技有限公司 Clock of things system and clock of things realization method
JP2019186886A (en) * 2018-04-17 2019-10-24 株式会社東芝 Signal transmission device, signal transmission system, and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1202138A2 (en) * 2000-10-31 2002-05-02 Sony Corporation Distributing clock information
WO2007069041A2 (en) * 2005-12-15 2007-06-21 Abb Technology Ltd. Using travel-time as means for improving the accuracy of simple network time protocol
CN101331736A (en) * 2005-12-15 2008-12-24 Abb技术有限公司 Using travel-time as means for improving the accuracy of simple network time protocol
CN104981742A (en) * 2013-06-12 2015-10-14 富士电机株式会社 Distribution device, distribution system, and distribution method
CN106375375A (en) * 2016-08-25 2017-02-01 烟台中恒时钟科技有限公司 Clock of things system and clock of things realization method
JP2019186886A (en) * 2018-04-17 2019-10-24 株式会社東芝 Signal transmission device, signal transmission system, and method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113628392A (en) * 2021-08-19 2021-11-09 上海擎朗智能科技有限公司 Time management method, device and storage medium
CN113628392B (en) * 2021-08-19 2023-08-25 上海擎朗智能科技有限公司 Time management method, device and storage medium
CN114006674A (en) * 2021-12-31 2022-02-01 深圳市海清视讯科技有限公司 Time correction method, device, equipment and storage medium for attendance equipment
CN114006674B (en) * 2021-12-31 2022-04-01 深圳市海清视讯科技有限公司 Time correction method, device, equipment and storage medium for attendance equipment
US20230281301A1 (en) * 2022-03-03 2023-09-07 Dell Products, L.P. System and method for detecting and reporting system clock attacks within an indicators of attack platform

Similar Documents

Publication Publication Date Title
JP6874224B2 (en) Cross blockchain authentication method and equipment
JP6975332B2 (en) Blockchain-based smart contract calling methods and devices, and electronic devices
CN111399367A (en) Time correction method based on pigeon clock equipment, server and storage medium
KR102221328B1 (en) Cross-blockchain authentication method, apparatus, and electronic device
US8516239B2 (en) Virtual authentication proxy server and terminal authentication server
US10819813B2 (en) Message pushing method and apparatus thereof
US20190098058A1 (en) Control apparatus and control method for enforcing security policies
US11475982B2 (en) Medical record storage with electronic signature
CN110224854A (en) Dispositions method, device and the storage medium of block chain node
CN112468540B (en) Cloud platform-based data distribution method, equipment and medium
EP3035640A1 (en) Method for authenticating a device
CN111338608A (en) Distributed application development method and device, node equipment and readable storage medium
WO2021091495A1 (en) Method for inquiring weather data, and electronic device and storage medium thereof
US20150358307A1 (en) Information management apparatus, information management system, information management method, and storage medium
CN110599180A (en) Block chain-based vaccine circulation management method and device
CN111400310A (en) Data monitoring method based on approval chain configuration, server and storage medium
CN108255675A (en) A kind of port diagnostic extracting method, device and computing device
CN112187548A (en) Method, device and equipment for synchronously updating configuration data and storage medium
US10949645B2 (en) Method, apparatus, and storage medium for data verification
CN109102581B (en) Card punching method, device, system and storage medium
CN111429643A (en) Method and device for shaking numbers and storage medium
CN112492513B (en) Credible information positioning method and device
CN111047229A (en) Order distribution information processing method and system
CN104935623B (en) Application management method and update release server
CN114090689A (en) Intelligent contract data processing method based on alliance chain and related equipment thereof

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210709

Address after: Room 1-68, building 1-3 to building 1-6, qianyangzhixing Plaza, 996 Changxing Road, Jiangbei District, Ningbo City, Zhejiang Province, 315033

Applicant after: LongQian (Ningbo) Digital Technology Co.,Ltd.

Address before: 518000 b812, building 7, Shenzhen Bay science and technology ecological park, 1819 Shahe West Road, high tech Zone community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen Shuai Ge Meiyu Technology Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200710