CN111107169A - Time management method based on WEB browser - Google Patents

Time management method based on WEB browser Download PDF

Info

Publication number
CN111107169A
CN111107169A CN202010085159.3A CN202010085159A CN111107169A CN 111107169 A CN111107169 A CN 111107169A CN 202010085159 A CN202010085159 A CN 202010085159A CN 111107169 A CN111107169 A CN 111107169A
Authority
CN
China
Prior art keywords
time
web browser
value
client
web server
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.)
Granted
Application number
CN202010085159.3A
Other languages
Chinese (zh)
Other versions
CN111107169B (en
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.)
No32021 Troops Of Pla
Original Assignee
No32021 Troops Of Pla
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 No32021 Troops Of Pla filed Critical No32021 Troops Of Pla
Priority to CN202010085159.3A priority Critical patent/CN111107169B/en
Publication of CN111107169A publication Critical patent/CN111107169A/en
Application granted granted Critical
Publication of CN111107169B publication Critical patent/CN111107169B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention belongs to the technical field of network time management, and particularly relates to a time management method based on a WEB browser. The invention realizes the time management functions of millisecond-level precision time synchronization, time deviation monitoring, event time mark recording, query and the like for terminals deployed in a wide area network in a distributed manner based on common WEB browsers of IE, chome, firefox and the like, ensures that the time displayed on the WEB browser by each terminal has high precision, high availability and maintenance-free property, can automatically identify and automatically correct the time of local time synchronization to a WEB server when the system time of each terminal operating system changes, and ensures the command precision in military operation and the coordination degree of multi-department linkage.

Description

Time management method based on WEB browser
Technical Field
The invention belongs to the technical field of network time management, and particularly relates to a time management method based on a WEB browser.
Background
At present, network time management, especially network time synchronization technologies, mainly include the following commonly used technologies: firstly, the manual synchronization technology, that is, the manual comparison with the clock face of the system according to the terminal device, and the time synchronization of the whole network is realized by using the time of the manual adjustment device. According to the method, additional software and hardware development is not needed, but manual participation is needed, the synchronization precision is low, and the time error of each device is large. The other is a synchronization technology based on NTP network time protocol, that is, a broadcast mode is adopted in a network to transmit a standard time data packet, terminal equipment needing time synchronization utilizes an operating system to carry out corresponding setting, so that the time of the terminal equipment is automatically synchronized with an NTP time server, and the whole network time synchronization is realized.
The time synchronization, the time-consuming guarantee, the event time scale investigation and other tasks in the military command mechanism have higher requirements on the time precision, the time service precision of the current time synchronization technology based on the wide area network can only reach the second level, and because the network paths of terminal equipment in the command network are different, the propagation delay between a WEB browser and a server can be in the second level, so that a larger local time error exists between different terminals, even the time difference between adjacent terminals reaches several seconds, and the military action command precision and the multi-department linkage coordination are influenced.
In addition, the command center in a specific military operation needs to unify the time of each department to the time of the command center with the customized second step length and fixed deviation, and no similar application exists at present.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a time management method based on a WEB browser, aiming at overcoming the defects involved in the background art, so as to solve the technical problems that the existing WEB browser based on a wide area network is not high in time service precision, large in time deviation of each terminal device, low in time keeping capability, and incapable of monitoring the time deviation of each terminal device.
In order to solve the technical problems, the invention adopts the following technical scheme:
according to an aspect of the present invention, there is provided a WEB browser-based time management method, which performs the following steps on a client side:
respectively executing a time synchronization process at a plurality of moments after the WEB browser is started; the WEB browser judges whether a time synchronization triggering condition is reached or not by taking the first time as a period, and if the time synchronization triggering condition is reached, the time synchronization process is executed; if the time synchronization triggering condition is not met, the WEB browser circularly updates and displays the synchronized time by taking the first time as a period; and the WEB browser executes the time synchronization process by taking the second time as a period.
Further, at a plurality of moments after the WEB browser is started, the method specifically includes: 0 second, 5 seconds, 10 seconds, and 30 seconds after the WEB browser is started.
Further, the time synchronization process specifically includes the following steps:
and step S31, the WEB browser reads the value of the time difference variable recorded in the local COOKIE, if the time difference variable does not exist in the local COOKIE, the time difference variable is newly built in the local COOKIE, and the time difference variable is assigned with an initial value of zero.
Step S32, the WEB browser reads the value T of the local system time at the current moment0
Step S33, the WEB browser records the time difference variable value recorded in the local COOKIE and the value T of the local system time at the current moment in the step S320And sending the AJAX request to the WEB server as a parameter.
Step S34, the WEB browser receives the response data sent by the WEB server, reads the value T of the local system time at the current moment1And the response data comprises time information of the WEB server at the moment when the WEB server sends the response data.
Step S35, the WEB browser analyzes the time value T of the WEB server end at the moment when the WEB server end sends the response data according to the response dataS
Step S36, the WEB browser calculates TS-(T1+T0) A value of/2 and the value of the time difference variable updated into the local COOKIE.
Further, the time synchronization triggering condition specifically includes: and the absolute value of the difference value of the local system time read by the WEB browser at the interval of the first time is larger than the third time.
Further, the WEB browser cyclically updates and displays the synchronized time with the first time as a period, specifically including the WEB browser cyclically executing the following steps with the first time as a period:
and step S51, the WEB browser reads the value of the time difference variable recorded in the local COOKIE, if the time difference variable does not exist in the local COOKIE, the time difference variable is newly built in the local COOKIE, and the time difference variable is assigned with an initial value of zero.
In step S52, the WEB browser reads the value of the local system time at the local current time.
In step S53, the WEB browser calculates the sum of the value of the local system time in step S52 and the value of the time difference variable in step S51, and displays the calculation result as the synchronized time in the form of a control.
Further, the first time is 10 milliseconds, the third time is 10 seconds, and the second time is 10 minutes.
According to another aspect of the present invention, there is also provided a time management method based on a WEB browser, where the following steps are performed on a WEB server side:
step S71, receiving an AJAX request sent by a WEB browser of a client, wherein the AJAX request comprises a time difference variable value of the client and a local system time value of the client when the client sends the AJAX request.
And step S72, analyzing and storing the time difference variable value of the client and the local system time value of the client when the client sends the AJAX request.
Step S73, sending response data to the WEB browser at the client, where the response data includes a time value of a time when the WEB server sends the response data.
Further, the value of the time when the WEB server sends the response data specifically includes: and the WEB server sends the value of the self-defined time at the moment of responding the data, or the WEB server sends the value of the local system time of the WEB server at the moment of responding the data.
Further, the step executed on the WEB server side by the time management method based on the WEB browser further includes: and acquiring standard time from the Beidou NTP server according to the NTP protocol by taking the fourth time as a period.
Further, the fourth time is 10 minutes.
The invention has the following beneficial effects: the invention provides a time management method based on a WEB browser, which realizes time management functions of millisecond-level precision time synchronization, time deviation monitoring, event time mark recording, query and the like on terminals deployed in a wide area network in a distributed manner based on general WEB browsers such as IE, chome, firefox and the like, ensures that the time displayed on the WEB browser by each terminal has high precision, high availability and maintenance-free property, can automatically identify and automatically correct the time of synchronizing local time to a WEB server when the system time of each terminal operating system changes, and ensures the precision of command in military operation and the coordination degree of multi-department linkage.
Drawings
FIG. 1 is a flowchart illustrating a first embodiment of a WEB browser-based time management method performed on a client side according to the present invention;
FIG. 2 is a flow chart illustrating a time synchronization process of a WEB browser-based time management method according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating a WEB browser display synchronized time of the WEB browser-based time management method according to the third embodiment of the present invention;
FIG. 4 is a flowchart illustrating a WEB server side execution of a WEB browser-based time management method according to a fourth embodiment of the present invention;
fig. 5 is a schematic diagram of a connection between a WEB server and a beidou NTP server in a fifth embodiment of the time management method based on a WEB browser according to the present invention.
Detailed Description
The present invention will be described in further detail below with reference to the drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
Example one
The invention discloses a time management method based on a WEB browser, which realizes time management functions of millisecond-level precision time synchronization, time deviation monitoring, event time mark recording, query and the like for a distributed deployment terminal based on common WEB browsers such as IE, chome, firefox and the like.
The embodiment discloses a time management method based on a WEB browser, which executes the following steps on a client side, as shown in fig. 1:
and respectively executing a time synchronization process at a plurality of moments after the WEB browser is started.
In this embodiment, the client starts a general WEB browser such as IE, chome, firefox, and the like, and a time synchronization process is performed at a plurality of times after the WEB browser is started. In this embodiment, 0 second, 5 seconds, 10 seconds, and 30 seconds after the WEB browser is started are respectively subjected to a time synchronization process with the WEB server, and specific steps of the time synchronization process are described in detail below.
The WEB browser judges whether a time synchronization triggering condition is reached or not by taking the first time as a period, and if the time synchronization triggering condition is reached, the time synchronization process is executed; and if the time synchronization triggering condition is not met, the WEB browser circularly updates and displays the synchronized time by taking the first time as a period.
In this embodiment, the WEB browser determines whether a preset time synchronization trigger condition is reached or not with a period of 10 milliseconds, if the preset time synchronization trigger condition is reached, the WEB browser and the WEB server perform a time synchronization process, and if the preset time synchronization trigger condition is not reached, the WEB browser of the client cyclically updates and displays the synchronized time with the period of 10 milliseconds.
Specifically, the time synchronization triggering condition specifically means that an absolute value of a difference value of local system times read by the WEB browser at the first time interval is greater than the third time.
In this embodiment, the WEB browser continuously reads the local system time with a period of 10 milliseconds, and if the absolute value of the difference between the local system times read by the WEB browser and spaced by 10 milliseconds is greater than 10 seconds, at this time, the WEB browser can automatically recognize the time jump, and can determine that the local system time of the client is modified by a manual or other modification time program, that is, a preset time synchronization trigger condition is reached, the WEB browser immediately and automatically performs time synchronization with the WEB server, so as to ensure that the local time displayed by the WEB browser of the client is synchronized with the time of the WEB server.
In this embodiment, the WEB browser continuously reads the local system time with a period of 10 milliseconds, if the absolute value of the difference between the local system times read by the WEB browser and spaced by 10 milliseconds is not greater than 10 seconds, that is, the preset time synchronization triggering condition is not triggered, the WEB browser of the client circularly updates and displays the synchronized time with a period of 10 milliseconds, and the specific steps of circularly updating and displaying the synchronized time by the WEB browser of the client are explained in detail below.
And the WEB browser executes the time synchronization process by taking the second time as a period.
In this embodiment, in order to ensure that the local time displayed by the WEB browser of the client is accurately synchronized with the time of the WEB server, the WEB browser of the client executes a time synchronization process with the WEB server in a cycle of 10 minutes, and after the WEB browser of the client completes the time synchronization process with the WEB server, the accuracy and stability of the local crystal oscillator of the client are used to ensure that the local time is accurately synchronized with the time of the WEB server within 10 minutes, and active time synchronization and autonomous time maintenance are repeatedly executed. In the embodiment, the time synchronization with the WEB server is actively performed in a smaller periodic time interval through the WEB browser, so that the accuracy of the autonomous maintenance of the local time of the client is improved.
In this embodiment, the client executes the time synchronization process respectively by using 0 second, 5 seconds, 10 seconds, and 30 seconds after the WEB browser is started; meanwhile, the WEB browser judges the continuity of the local time of the client by taking 10 milliseconds as a period, if the local time is modified, the time synchronization is actively performed immediately, and the WEB browser circularly updates and displays the synchronized time by the period of 10 milliseconds; in addition, the WEB browser repeatedly executes active time synchronization and autonomous time keeping in a cycle of 10 minutes, and high-precision time synchronization of the distributed terminal is realized on the basis of common WEB browsers such as IE, chome, firefox and the like.
Example two
The embodiment further discloses specific steps of the time synchronization process performed by the WEB browser on the client side on the basis of the first embodiment, and as shown in fig. 2, the specific steps specifically include the following steps:
and step S31, the WEB browser reads the value of the time difference variable recorded in the local COOKIE, if the time difference variable does not exist in the local COOKIE, the time difference variable is newly built in the local COOKIE, and the time difference variable is assigned with an initial value of zero.
In this embodiment, the client stores the difference between the time of the local system and the time of the WEB server, that is, the value of the so-called time difference variable, in the local COOKIE, and the WEB browser can conveniently read the value of the time difference variable recorded in the local COOKIE through the JavaScript script.
And if the current local COOKIE does not have the time difference variable, newly building the time difference variable in the local COOKIE and assigning an initial value as zero. The unit of the time difference variable in COOKIE is milliseconds, for example, if the value of the time difference variable stored in COOKIE is 3502, it indicates that the difference between the time of the local system and the time of the WEB server is 3502 milliseconds.
Step S32, the WEB browser reads the value T of the local system time at the current moment0
In this embodiment, the WEB browser reads the value of the local system time at the current time of the client, that is, the value of the local system time at the time when the WEB browser sends the AJAX request to the WEB server, and to ensure the accuracy, the value of the local system time at the time is accurate to milliseconds, for example, when the current time read by the WEB browser at the client is 1 minute, 1 second, zero 230 milliseconds at 8 days 1 month, 20 days 8 of 2020, 20 months, and T is zero 230 milliseconds at the current time of the local system time, then T is zero0=2020/1/2008:01:01.230。
Step S33, the WEB browser records the time difference variable value recorded in the local COOKIE and the value T of the local system time at the current moment in the step S320And sending the AJAX request to the WEB server as a parameter.
In this embodiment, a WEB browser at a client transmits and receives data in a form of transmitting an AJAX request to a WEB server. The WEB browser performs a small amount of data exchange with a server at the background, and rapidly updates part of the WEB page without reloading the whole WEB page. The AJAX technology is a conventional existing WEB technology, and is not described herein in detail.
In this embodiment, when the WEB browser of the client sends the AJAX request to the WEB server, the time difference variable value recorded in the local COOKIE and the local system time value T at the current time are set0And sending the parameters to a WEB server for the WEB server to record and store the time difference variable value of the client and the client local system time information of the AJAX request sending time of the client.
Step S34, the WEB browser receives the response data sent by the WEB server, reads the value T of the local system time at the current moment1And the response data comprises time information of the WEB server at the moment when the WEB server sends the response data.
In this embodiment, after receiving an AJAX request sent by a WEB browser at a client, a WEB server sends response data to the WEB browser at the client, where the response data includes time information of the WEB server at a time when the WEB server sends the response data. After the WEB browser of the client receives the response data sent by the WEB server, the value of the local system time at the current moment of the client, that is, the value of the local system time at the moment when the WEB browser of the client receives the response data sent by the WEB server, is recorded as T1
Step S35, the WEB browser analyzes the time value T of the WEB server end at the moment when the WEB server end sends the response data according to the response dataS
In this embodiment, the response data sent by the WEB server to the WEB browser of the client includes the time information of the WEB server end at the time when the WEB server sends the response data, so that the WEB browser of the client can obtain the value of the time of the WEB server end at the time when the WEB server end sends the response data by analyzing the received response data, which is denoted as TS
In this embodiment, the time of the WEB server side at the time when the WEB server side sends the response data may be a value of a time defined by the time when the WEB server sends the response data, or a value of a local system time of the WEB server at the time when the WEB server sends the response data, and the time may be flexibly set at the WEB server side, so that the time of each department is unified to the standard time of the command center or the time defined by the command center.
Step S36, the WEB browser calculates TS-(T1+T0) A value of/2 and the value of the time difference variable updated into the local COOKIE.
In this embodiment, the client WEB browser calculates the value of the time difference variable between the local and WEB servers, and the value T of the client local system time at the time when the WEB browser sends the AJAX request to the WEB server0The value T of the local system time at the moment when the client WEB browser receives the response data sent by the WEB server1The network delay between the client and the WEB server can be obtained as (T)1-T0) And 2, according to the time value T of the WEB server side at the moment when the WEB server side sends the response dataSThe local system time at the moment when the client WEB browser receives the response data sent by the WEB server can be obtained as T relative to the time of the WEB serverS+(T1-T0) And/2, determining the value of the time difference variable of the client as the value of the local system time relative to the time of the WEB server at the moment when the WEB browser of the client receives the response data sent by the WEB server and T1I.e. the value of the equation of time variable TS+(T1-T0)/2-T1=TS-(T1+T0)/2. And the WEB browser updates the value of the time difference variable into the time difference variable in the local COOKIE for subsequent use.
Such as client WEB browser at client local time T0Sending AJAX request to WEB server at 2020/1/2008:01:01.230, and the WEB server transmits time T at WEB server endS2020/1/2008:02:02.450 sends response data to the client WEB browser at client local time T1When response data sent by the WEB server is received in the time difference of 2020/1/2008:01:02.350, the time difference variable of the client is TS-(T1+T0) 2020/1/2008:02:02.450- (2020/1/2008:01:02.350+2020/1/2008:01: 01.230)/2: 60660 milliseconds, and the local synchronization time of the client is TS+(T1-T0)/2=2020/1/2008:02:03.010。
The time management method based on the WEB browser comprises the steps of executing time synchronization processes of 0 second, 5 seconds, 10 seconds and 30 seconds after the WEB browser of a client is started, judging a time synchronization trigger condition by taking 10 milliseconds as a period cycle, executing the time synchronization processes when the time synchronization trigger condition is reached, executing the time synchronization processes by taking the 10 minutes as the period cycle, wherein the time precision is in the millisecond level, and simultaneously sending the value of a time difference variable at the local part of the client and the local time to the WEB server, so that the WEB server can record and maintain the time information of the client, and the influence of network delay is considered in the time synchronization processes, so that the time synchronization between the client and the WEB server can reach the precision requirement of the millisecond level.
EXAMPLE III
According to the time management method based on the WEB browser, the client WEB browser synchronizes the time of the client to the time of the WEB server with high precision, and meanwhile, the time after the client synchronization can be displayed in the WEB browser of the client in real time.
This embodiment further discloses specific steps of the client WEB browser circularly updating and displaying the synchronized time with the first time as a period, as shown in fig. 3.
In this embodiment, the client WEB browser loops through the following steps at a 10 millisecond period:
and step S51, the WEB browser reads the value of the time difference variable recorded in the local COOKIE, if the time difference variable does not exist in the local COOKIE, the time difference variable is newly built in the local COOKIE, and the time difference variable is assigned with an initial value of zero.
After the time synchronization process is executed by the client WEB browser, the value of the time difference variable is stored in the local COOKIE, so that the time after the local synchronization is acquired by adding the value of the time difference variable to the current time of the local system.
In this embodiment, the WEB browser reads the value of the time difference variable recorded in the local COOKIE through the JaveScript, and if the time difference variable is not present in the local COOKIE, it indicates that a time synchronization process has not been performed currently, and newly establishes the time difference variable in the local COOKIE, and assigns an initial value to zero to the time difference variable.
In step S52, the WEB browser reads the value of the local system time at the local current time.
In step S53, the WEB browser calculates the sum of the value of the local system time in step S52 and the value of the time difference variable in step S51, and displays the calculation result as the synchronized time in the form of a control.
In this embodiment, the WEB browser adds the value of the time of the local system and the value of the time difference variable to obtain the time after local synchronization, and the time after local synchronization of the client can be displayed in real time on the WEB browser by using a time control or a control in other forms.
In this embodiment, the WEB browser updates the synchronized time in a cycle of 10 milliseconds and displays the time on the control on the WEB browser, so that the synchronized time can be displayed in real time.
Example four
The embodiment discloses a time management method based on a WEB browser, which executes the following steps on a WEB server side, as shown in fig. 4:
step S71, receiving an AJAX request sent by a WEB browser of a client, wherein the AJAX request comprises a time difference variable value of the client and a local system time value of the client when the client sends the AJAX request.
The WEB server receives an AJAX request sent by a WEB browser at a client, and the AJAX technology is a common technology in the field and is not described herein again.
In the AJAX request sent by the client WEB browser, the value of the time difference variable recorded in the local COOKIE and the value T of the local system time at the current moment are recorded0And sending the parameters to a WEB server.
And step S72, analyzing and storing the time difference variable value of the client and the local system time value of the client when the client sends the AJAX request.
In this embodiment, the WEB server receives an AJAX request sent by a WEB browser at a client, records and stores a value of a time difference variable of the client and client local system time information at a time when the client sends the AJAX request, for example, if the client local system time at the time when a WEB browser at a client sends the AJAX request is 2020, 1, 20, 8, 1, min, 1 s, zero 230 ms, and the value of the time difference variable of the client is 3502 ms, the WEB server stores the data of the client.
Step S73, sending response data to the WEB browser at the client, where the response data includes a time value of a time when the WEB server sends the response data.
In this embodiment, after receiving an AJAX request sent by a WEB browser at a client, a WEB server sends response data to the WEB browser at the client, where the response data includes time information of a time when the WEB server sends the response data, so that after receiving the response data sent by the WEB server, the WEB browser at the client analyzes the time information of the WEB server at the time when the WEB server sends the response data.
In this embodiment, the value of the time at which the WEB server sends the response data specifically includes: and the WEB server sends the value of the self-defined time at the moment of responding the data, or the WEB server sends the value of the local system time of the WEB server at the moment of responding the data. And if the WEB server needs time delay self-defining time, sending the self-defining time to a WEB browser of the client so as to synchronize the time of the client to the time self-defining of the WEB server. Or the WEB server can also send the standard time of the local system of the WEB server to the WEB browser of the client so as to synchronize the time of the client to the time of the local system of the WEB server.
EXAMPLE five
In this embodiment, the time management method based on a WEB browser, executed on the WEB server side, further includes: and acquiring standard time from the Beidou NTP server according to the NTP protocol by taking the fourth time as a period, wherein the WEB server is connected with the Beidou NTP server as shown in the figure 5.
In this embodiment, the WEB server provides user-defined time or standard time to each terminal, and user-defined time can be according to actual need custom setting, and standard time's the accessible NTP protocol of acquireing obtains standard time to the big dipper NTP server according to certain time as the cycle to make WEB server's local system time and big dipper standard time synchronous, in this embodiment, the WEB server uses 10 minutes to obtain standard time to the big dipper NTP server according to the NTP protocol as the cycle.
In summary, according to the time management method based on the WEB browser provided by the present invention, the time management functions such as millisecond-level precision time synchronization, time deviation monitoring, event time scale recording and query are implemented for the terminals deployed in a wide area network in a distributed manner based on the general WEB browsers such as IE, chome, firefox, etc., so that the time displayed on the WEB browser by each terminal has high precision, high availability and maintenance-free property, and the time synchronized to the WEB server by the local time can be automatically identified and corrected when the system time of each terminal operating system changes, thereby ensuring the precision of command in military operations and the coordination degree of multi-department linkage.
Although the preferred embodiments of the present invention have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, and the scope of the invention should not be limited to the embodiments described above. It will be apparent to those skilled in the art that various modifications can be made without departing from the principles of the invention and these modifications are to be considered within the scope of the invention.

Claims (10)

1. A time management method based on a WEB browser is characterized in that the following steps are executed on a client side:
respectively executing a time synchronization process at a plurality of moments after the WEB browser is started;
the WEB browser judges whether a time synchronization triggering condition is reached or not by taking the first time as a period, and if the time synchronization triggering condition is reached, the time synchronization process is executed; if the time synchronization triggering condition is not met, the WEB browser circularly updates and displays the synchronized time by taking the first time as a period;
and the WEB browser executes the time synchronization process by taking the second time as a period.
2. The WEB browser-based time management method according to claim 1,
the method specifically comprises the following steps that at a plurality of moments after the WEB browser is started: 0 second, 5 seconds, 10 seconds, and 30 seconds after the WEB browser is started.
3. The WEB browser-based time management method according to claim 1, wherein the time synchronization process specifically includes the steps of:
step S31, the WEB browser reads the value of the time difference variable recorded in the local COOKIE, if the time difference variable does not exist in the local COOKIE, the time difference variable is newly built in the local COOKIE, and the time difference variable is assigned with an initial value as zero;
step S32, the WEB browser reads the value T of the local system time at the current moment0
Step S33, the WEB browser records the time difference variable value recorded in the local COOKIE and the value T of the local system time at the current moment in the step S320Sending an AJAX request to a WEB server as a parameter;
step S34, the WEB browser receives the response data sent by the WEB server, reads the value T of the local system time at the current moment1The response data comprises time information of the WEB server at the moment when the WEB server sends the response data;
step S35, the WEB browser analyzes the time value T of the WEB server end at the moment when the WEB server end sends the response data according to the response dataS
Step S36, the WEB browser calculates TS-(T1+T0) A value of/2 and the value of the time difference variable updated into the local COOKIE.
4. The WEB browser-based time management method according to any one of claims 1 to 3,
the time synchronization triggering condition specifically includes: and the absolute value of the difference value of the local system time read by the WEB browser at the interval of the first time is larger than the third time.
5. The method for time management based on a WEB browser according to claim 4, wherein the WEB browser cyclically updates and displays the synchronized time with the first time as a period, and specifically comprises the WEB browser cyclically executing the following steps with the first time as a period:
step S51, the WEB browser reads the value of the time difference variable recorded in the local COOKIE, if the time difference variable does not exist in the local COOKIE, the time difference variable is newly built in the local COOKIE, and the time difference variable is assigned with an initial value as zero;
step S52, the WEB browser reads the value of the local system time at the local current moment;
in step S53, the WEB browser calculates the sum of the value of the local system time in step S52 and the value of the time difference variable in step S51, and displays the calculation result as the synchronized time in the form of a control.
6. The WEB browser-based time management method according to claim 5,
the first time is 10 milliseconds, and the third time is 10 seconds;
the second time period was 10 minutes.
7. A time management method based on a WEB browser is characterized in that the following steps are executed on a WEB server side:
step S71, receiving an AJAX request sent by a WEB browser of a client, wherein the AJAX request comprises a time difference variable value of the client and a local system time value of the client when the client sends the AJAX request;
step S72, analyzing and storing the time difference variable value of the client and the local system time value of the client when the client sends the AJAX request;
step S73, sending response data to the WEB browser at the client, where the response data includes a time value of a time when the WEB server sends the response data.
8. The WEB browser-based time management method according to claim 7,
the time value of the time when the WEB server sends the response data specifically includes: and the WEB server sends the value of the self-defined time at the moment of responding the data, or the WEB server sends the value of the local system time of the WEB server at the moment of responding the data.
9. The WEB browser-based time management method according to claim 7 or 8,
the method is executed on the WEB server side, and further comprises the following steps: and acquiring standard time from the Beidou NTP server according to the NTP protocol by taking the fourth time as a period.
10. The WEB browser-based time management method according to claim 9,
the fourth time was 10 minutes.
CN202010085159.3A 2020-02-10 2020-02-10 Time management method based on WEB browser Active CN111107169B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010085159.3A CN111107169B (en) 2020-02-10 2020-02-10 Time management method based on WEB browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010085159.3A CN111107169B (en) 2020-02-10 2020-02-10 Time management method based on WEB browser

Publications (2)

Publication Number Publication Date
CN111107169A true CN111107169A (en) 2020-05-05
CN111107169B CN111107169B (en) 2020-10-02

Family

ID=70427904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010085159.3A Active CN111107169B (en) 2020-02-10 2020-02-10 Time management method based on WEB browser

Country Status (1)

Country Link
CN (1) CN111107169B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070186252A1 (en) * 2006-02-07 2007-08-09 Maggio Frank S Method and system for home shopping using video-on-demand services
CN101299631A (en) * 2008-06-24 2008-11-05 芯通科技(成都)有限公司 Method and system for implementing stabilization synchronism of TD-SCDMA directly-discharging station
CN102739626A (en) * 2011-04-12 2012-10-17 索尼公司 Method and device for time synchronization, time stamping device and trusted time server
CN104135358A (en) * 2014-06-11 2014-11-05 国家电网公司 A method for executing an SNTP clock calibration on a power distribution terminal based on an asymmetric digital signature
CN107547160A (en) * 2017-06-28 2018-01-05 新华三技术有限公司 A kind of method for synchronizing time and device
CN109699068A (en) * 2017-10-20 2019-04-30 阿里巴巴集团控股有限公司 A kind of base station synchronization method and device
CN110266420A (en) * 2019-04-29 2019-09-20 北京达佳互联信息技术有限公司 Clock synchronizing method, clock synchronization apparatus and computer readable storage medium
CN110752890A (en) * 2019-10-29 2020-02-04 浙江吉利汽车研究院有限公司 Time synchronization method, time synchronization system and vehicle

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070186252A1 (en) * 2006-02-07 2007-08-09 Maggio Frank S Method and system for home shopping using video-on-demand services
CN101299631A (en) * 2008-06-24 2008-11-05 芯通科技(成都)有限公司 Method and system for implementing stabilization synchronism of TD-SCDMA directly-discharging station
CN102739626A (en) * 2011-04-12 2012-10-17 索尼公司 Method and device for time synchronization, time stamping device and trusted time server
CN104135358A (en) * 2014-06-11 2014-11-05 国家电网公司 A method for executing an SNTP clock calibration on a power distribution terminal based on an asymmetric digital signature
CN107547160A (en) * 2017-06-28 2018-01-05 新华三技术有限公司 A kind of method for synchronizing time and device
CN109699068A (en) * 2017-10-20 2019-04-30 阿里巴巴集团控股有限公司 A kind of base station synchronization method and device
CN110266420A (en) * 2019-04-29 2019-09-20 北京达佳互联信息技术有限公司 Clock synchronizing method, clock synchronization apparatus and computer readable storage medium
CN110752890A (en) * 2019-10-29 2020-02-04 浙江吉利汽车研究院有限公司 Time synchronization method, time synchronization system and vehicle

Also Published As

Publication number Publication date
CN111107169B (en) 2020-10-02

Similar Documents

Publication Publication Date Title
CN100583730C (en) System and method for calibrating a TOD clock
US8873589B2 (en) Methods and devices for clock synchronization
KR101109980B1 (en) Facilitating synchronization of servers in a coordinated timing network
US11252065B1 (en) Clock synchronization in a heterogeneous system
US9813226B2 (en) Modeling a clock
KR101484871B1 (en) Master device and slave device and time synchronization method
US7630383B2 (en) Synchronization of time stamps of peer devices in a communication node
CN102684808A (en) Self-adaptive clock synchronous system
CN110492967A (en) A kind of method for synchronizing time, trunking and device
CN108599888A (en) A kind of distributed network clock synchronizing system
US11502913B1 (en) Simulating time synchronization
CN110266420A (en) Clock synchronizing method, clock synchronization apparatus and computer readable storage medium
WO2014037684A1 (en) Methods and devices for clock synchronization
CN115765909A (en) Clock synchronization method, device and storage medium
CN112417255A (en) Method and device for receiving online state, storage medium and electronic device
CN111107169B (en) Time management method based on WEB browser
CN110752890A (en) Time synchronization method, time synchronization system and vehicle
CN103441832B (en) Clock synchronizing method based on PTP, system and equipment
CN107547160A (en) A kind of method for synchronizing time and device
CN112769517A (en) T-BOX time synchronization method and device
CN111102689A (en) Method and device for adjusting clock synchronization
US10334539B2 (en) Metered interface
CN107359954A (en) A kind of method and system that time calibration is carried out based on reference synchronization mechanism
CN113783649B (en) Terminal timing method, system, electronic equipment and storage medium
CN114035740A (en) Clock crystal oscillator synchronization method, device and system

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