CN1968077A - Method and system for time synchronization between client and server-end - Google Patents

Method and system for time synchronization between client and server-end Download PDF

Info

Publication number
CN1968077A
CN1968077A CN 200610138843 CN200610138843A CN1968077A CN 1968077 A CN1968077 A CN 1968077A CN 200610138843 CN200610138843 CN 200610138843 CN 200610138843 A CN200610138843 A CN 200610138843A CN 1968077 A CN1968077 A CN 1968077A
Authority
CN
China
Prior art keywords
time
client
server end
pairing
point
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
CN 200610138843
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.)
Via Technologies Inc
Original Assignee
Via Technologies Inc
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 Via Technologies Inc filed Critical Via Technologies Inc
Priority to CN 200610138843 priority Critical patent/CN1968077A/en
Publication of CN1968077A publication Critical patent/CN1968077A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Electric Clocks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to a method for timing the client and server, and relative system, wherein at first time point, the client sends time correct request to the server, to obtain the server time at first time point; recording the time difference between server time and client time, as the reference time difference; at the second time point, adding client time and reference time difference, calculating out the server time relative to the second time point.

Description

The setting means of client and server end and system thereof
Technical field
The invention relates to a kind of setting means and system, especially in regard to the setting means and the system of a kind of client and server end.
Background technology
Along with the arriving of information and multimedia era, the network trading behavior is also more frequent, and therefore the ecommerce of carrying out the business transaction activity by network also becomes a new industry.Such as behaviors such as banking, stock market's transaction, the buying and selling of commodities all can be undertaken by network.Not only reduced the advertising cost of product via the mode of doing business of ecommerce, more expanded the market path of product, thereby ecommerce becomes an important ring of the buying and selling of commodities and marketing service in the life gradually.
In the e-commerce transaction active procedure, the computer that is mainly client carries out the activity of business transaction by the main frame of network and server end, and the content of business transaction with product quantity, product category, and exchange hour particularly important.If the computer time of client and server end is inconsistent, then can make exchange hour error to some extent.
Known setting means is that client utilizes network to continue the time data that the reception server end is transmitted, to carry out synchronously proof time in real time.Yet this kind method has taken a large amount of Internet resources, and has increased the load of client usefulness resource, thereby increases network congestion and reduced the utilization rate of client usefulness resource, so replaced gradually.
Utilize at present network by server end and client to the time agreement have a variety of, NetworkTime Protocol (NTP) mode for example, be part server by network to time server (Time Server) query time, to proofread and correct the time of above-mentioned part server.And time of above-mentioned part server and above-mentioned time server synchronously after, more above-mentioned part server is opened, make client host can carry out to the time proofread and correct.Keep to a certain degree accurate time by the clock of client itself afterwards, and when initiatively sending the school to the server of a last stratum, suitable fixed cycle time asks, so NTP mainly with the framework of hierarchy type reach client host and server end to the time, and carry out the correction of time by fixed time period, to reduce the network congestion problem that known method was produced, purpose when reaching the computer school of on network, realizing high accurancy and precision.
Please refer to shown in Figure 1, use the mode of NTP make client and server end to the time method, comprise step S01-S07.Request (step S01) during at first, from user end to server end proposition school.Then, send the present standard time to client (step S02) from server end.Client receives from the standard time that server-side transmits, with the initial time (step S03) as client then.Then, for fear of network congestion, client request when server end proposes the school constantly, the substitute is, constantly count to obtain count value in client inside, wherein count value is used for calculating the time of server end, and count value is promptly be initialised after client is received the standard time that server end sends (step S04).Then, initialized count value promptly add up constantly (step S05).At last, the initial time and the initialized count value that client are received from server end are carried out addition (step S06), to obtain the lock in time identical with server end.Client is every just to re-execute request (step S07) when proposing the school through fixed cycle time, reading the standard time of server end, and carry out above-mentioned flow process with guarantee client and server end to the time.
Yet, above-mentioned network setting means still has shortcoming, be that client needs to receive initial time in fixed cycle time to server end, and continue when receiving initial time, to the count value initialization of having counted, and simultaneously the initial time of initialized count value and gained is added up, to obtain the common time.Thereby when the client data treating capacity is excessive, will cause initial time receive with count value initialization and computing that both add up on delay, make common time of client gained and server end produce difference, thus can't reach client and server end to the time purpose.
Please refer to shown in Figure 2ly, the browser of client is the webpage of browser server end, and the server end time that is received is shown in after computing in the pairing webpage of client " 10:00 ".Owing to be subjected to the excessive influence of client data treating capacity, so after after a while, can cause client after computing and the common time " 10:00 " that is shown in pairing webpage produce difference with the server end time " 10:15 ", thereby can't reach synchronously to the time operation.Therefore, do not taking a large amount of Internet resources and can be under the prerequisite of keeping the normal operation of client process mass data, how to make client and server end to the time real be present one big problem.
Summary of the invention
The invention provides a kind of setting means and system, when the client process ample resources, still can calculate the time of server end exactly.
The present invention is the setting means that discloses a kind of client and server end, and client has client time, and server end has the server end time.At first, when the very first time put, request when the user end to server end proposes the school was put the pairing server end time to obtain the very first time.The difference that pairing server end time and client time subtract each other put the very first time in record, with as difference fiducial time.When second time point, client time that foundation is above-mentioned and above-mentioned difference fiducial time are extrapolated the pairing server end time of second time point.
The present invention be disclose a kind of client and server end to the time system, this system comprises server end and at least one client, wherein server end has server time, reaches client and has client time.Client is request when server end proposes the school when the very first time puts, and puts the pairing server end time to obtain the very first time.The very first time put the poor of pairing server end time and client time in record, with as difference fiducial time.When second time point, client time that foundation is above-mentioned and above-mentioned difference fiducial time are extrapolated the pairing server end time of second time point.
From the above, setting means and system thereof in a kind of client of the present invention and server end, client be utilize client time and fiducial time difference extrapolate second time point, the 3rd time point, or even the pairing server end time of N time point, therefore the server end time can be extrapolated exactly by client, and client need not continue by network connection service device end, also is not subjected to the usefulness of its central processing unit and influences the accuracy of reckoning time.
Description of drawings
Fig. 1 is the flow chart of the setting means of known client and server end;
Fig. 2 is applied to the schematic diagram of webpage for the setting means of known client and server end;
Fig. 3 be according to a kind of client of the embodiment of the invention and server end to the time system schematic diagram; And
Fig. 4 is the flow chart according to the setting means of a kind of client of the embodiment of the invention and server end.
The element numbers explanation:
1: client and server-side to the time system
11: server end
111: the server end clock
112: webpage
113: the server end time
12: client
121: the client clock
122: browser
123: client time
13: network
Embodiment
Hereinafter with reference to correlative type, illustrate that wherein components identical is with labeled according to the client of the embodiment of the invention and the setting means and the system thereof of server end.
Please refer to shown in Figure 3, the embodiment of the invention be disclose a kind of client and server end to the time system 1, it comprises server end 11 and at least one client 12.Server end 11 has server end clock 111, in order to record and timing server end time 113.And each client 12 has client clock 121, in order to record and timing client time 123.In this, server end 11 can be mutually online with client 12 by network 13.In the present embodiment, server end 11 has webpage 112, browses for the user.A part of zone in webpage 112 is to be designed to the display server end time 113.When the user in client 12 operating browsers 122, and the content and the 113 o'clock server end time of coming browsing page 112 by network 13, the webpage 112 of server end 11 will be shown in the browser 122 of client 12.At this moment, also can be shown on the browser 122 of client 12 in client 12 pairing server end time 123 after calculating.
In this, client 12 can be internet (Internet), Wide Area Network (wide area network with the network on-line mode of server end 11, WAN), LAN (local area network, LAN) or MAN (metropolitan area network, mode such as MAN), and with HTTP (hypertext transfer protocol, http) come online.Client 12 also can be done communication by other special-purpose communications protocol with server end 11, for example the specialized protocol of network data base etc.In addition, client 12 can be the electronic installation that personal computer, notebook computer, PDA(Personal Digital Assistant), multimedia player (PMP) or family expenses game on line machine etc. can possess the network on-line function.
Please cooperate again with reference to shown in Figure 4, the embodiment of the invention be disclose a kind of above-mentioned client and server end to the time system 1 in the built-in client of client 12 and the setting means of server end, its method comprises step S11~S16.After client 12 was downloaded the source code file of webpage 112, it was prior to very first time during point, request (step S11) when server end 11 proposes schools.When server end 11 receives the school of client 12 after the request, it is that server time 113 is sent to client 12 via network 13, client 12 just can obtain the pairing server end time 113 of this moment, and can show that soon the pairing server end time 113 is in the browser 122 of client (step S12) after very first time point.Simultaneously, client 12 obtains pairing client time 123 from client clock 121.Then, client 12 just can calculate the very first time and put the poor of pairing server end time 113 and client time 123, and difference is recorded as difference fiducial time (step S13).When a period of time process, when second time point, client 12 utilize the said reference time difference and client times 123 sum carry out computing, to extrapolate the pairing server time 113 of second time point (step S14).Then the server time of extrapolating 113 is shown in the browser 122 of client 12 (step S15).Afterwards, count a period of time (step S16) in client 12 inside after, repeated execution of steps S14-S16 again.
After a period of time of counting process, when the 3rd time point or even N time point, client 12 is directly to extrapolate the 3rd time point from 12 own client times 123 of the difference of the fiducial time that client 12 is write down and client, or even the pairing server end time 113 during the N time point, therefore constantly request when server end 11 proposes schools of client 12, the effect in the time of can reaching 11 pairs of client 12 and server ends.
In the middle of above processing procedure, in when point very first time, client 12 is differences that pairing server end time 113 this moment and client time 123 are subtracted each other, with as difference fiducial time.Therefore after second and third or even N time point the time, client 12 is with client time 123 and difference addition fiducial time, just can utilize client time 123 with fiducial time the difference sum extrapolate follow-up time and put the pairing server end time 113.
In this, client time 123 and server end time 113 all can have fields such as year, month, day, second, with the operating system accessing file that supplies client 12 and server end 11 respectively or supervisory control system etc.
In this, the source code of webpage 112 can be write and carry out in client 12 with JAVA or JAVA script supervisor language.Even be subjected to the excessive influence of client 12 data processing amounts, client 12 still can correctly be extrapolated the server end time 113 with the processing mode of abovementioned steps.
In addition, in the present embodiment, client 12 is for asking accuracy, can be after continuing for some time, and the step of request when server end 11 proposes schools periodically is to proofread and correct the lock in time of client 12.
Moreover the above-mentioned client and the setting means of server end also can be applicable to the foundation of network trading or database, or the course record of digital Online Learning.For example, client utilize browser via network when the webpage of server end places an order, place an order time and exchange hour also can utilize the setting means of client of the present invention and server end reach to the time, thereby need not worry the time that places an order of client and the asynchronism(-nization) of exchange hour and server end webpage, can not cause the mistake of the time of placing an order and exchange hour because of the excessive influence of client data amount yet.
By above-mentioned design, utilize the setting means and the system thereof of client of the present invention and server end, only need utilize client that difference fiducial time of original client time and computing gained is done computing can make client and server end time reach synchronous, need not add up as count initialized value in the known method and to this count value, and will be initially and the count value that adds up and initial time carry out addition, thus, the client of this method not only can be simplified the computing flow process and need not constantly when server end proposes the school outside the request, also can reach the application that reduces the inner usefulness resource of client and reduce taking of network bandwidth, thereby when the client central processing unit is carried out a large amount of computing, can not produce because of client resource uses the excessive situation of client and server end time error that causes.
In sum, setting means and system thereof in a kind of client of the present invention and server end, be utilize client time and fiducial time difference extrapolate second time point, the 3rd time point, or even the pairing server end time of N time point, therefore, the server end time can be extrapolated exactly by client, and client need not continue by network connection service device end, also is not subjected to the usefulness of its central processing unit and influences the accuracy of reckoning time.
The above only is an illustrative, but not is restricted person.Anyly do not break away from spirit of the present invention and category, and, all should be contained in the appended claim scope its equivalent modifications of carrying out or change.

Claims (10)

1, the setting means of a kind of client and server end, this client has client time, and this server end has the server end time, and this method comprises:
When the very first time put, request was to obtain this very first time pairing this server end time of point when this server end proposes school;
Write down the poor of this pairing this server end time of point and this client time, with as the difference fiducial time very first time; And
When second time point, according to this client time and this fiducial time difference extrapolate pairing this server end time of this second time point.
2, the setting means of client according to claim 1 and server end, wherein this recording step comprises:
Obtaining that this point pairing very first time should client time; And
Pairing this server end time should be put and this client time is carried out computing the very first time, to obtain this of difference fiducial time.
3, the setting means of client according to claim 1 and server end, wherein this reckoning step is when this second time point, should client time and this fiducial time the difference sum, to extrapolate pairing this server end time of this second time point.
4, client according to claim 3 and server end to the time method, also comprise:
Demonstration pairing this server end time of this second time point through calculating is in the browser of this client.
5, the setting means of client according to claim 1 and server end, wherein this request step is request when this server end proposes this school periodically.
6, a kind of client and server end to the time system, comprise:
Server end has the server end time; And
At least one client, has client time, wherein this client be in when point very first time when this server end proposes school request to obtain this very first time pairing this server end time of point, and the difference that writes down this pairing this server end time of point and this client time with as the difference fiducial time very first time, and when second time point, according to this client time and this fiducial time the difference sum, extrapolate pairing this server end time of this second time point.
7, client according to claim 6 and server end to the time system, wherein this client obtain that this point pairing very first time should client time, and should put pairing this server end time the very first time and this client time is carried out computing, to obtain this of difference fiducial time.
8, client according to claim 6 and server end to the time system, wherein this client comprises browser, in order to browsing the webpage of this server end, and shows that pairing this server end time of this second time point through calculating is in this webpage.
9, client according to claim 6 and server end to the time system, wherein this client is request when this server end proposes this school periodically.
10, client according to claim 6 and server end to the time system, wherein this client comprises the client clock, this client clock is in order to timing and write down this client time; And this Server Side Include server end clock, this server end clock is in order to timing and write down this server end time.
CN 200610138843 2006-09-19 2006-09-19 Method and system for time synchronization between client and server-end Pending CN1968077A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200610138843 CN1968077A (en) 2006-09-19 2006-09-19 Method and system for time synchronization between client and server-end

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200610138843 CN1968077A (en) 2006-09-19 2006-09-19 Method and system for time synchronization between client and server-end

Publications (1)

Publication Number Publication Date
CN1968077A true CN1968077A (en) 2007-05-23

Family

ID=38076653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200610138843 Pending CN1968077A (en) 2006-09-19 2006-09-19 Method and system for time synchronization between client and server-end

Country Status (1)

Country Link
CN (1) CN1968077A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102821108A (en) * 2012-08-24 2012-12-12 北龙中网(北京)科技有限责任公司 Method for precisely synchronizing time of client and time of server
CN102955981A (en) * 2011-08-16 2013-03-06 高德软件有限公司 Position-based assessment system, position-based assessment terminal and position-based assessment method
CN104933079A (en) * 2014-03-21 2015-09-23 阿里巴巴集团控股有限公司 Browser timing method and system
WO2016065617A1 (en) * 2014-10-31 2016-05-06 Splunk Inc. Automatically adjusting timestamps from remote systems based on time zone differences
CN106331770A (en) * 2016-09-06 2017-01-11 青岛海信电器股份有限公司 Time synchronization method and client
CN106959604A (en) * 2017-04-01 2017-07-18 深圳天珑无线科技有限公司 The control method and device of terminal
CN107132999A (en) * 2016-02-29 2017-09-05 佳能株式会社 Management system, replacement management equipment, management method and storage medium
CN107341377A (en) * 2017-06-16 2017-11-10 武汉斗鱼网络科技有限公司 Time synchronization control method in one kind authentication

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102955981A (en) * 2011-08-16 2013-03-06 高德软件有限公司 Position-based assessment system, position-based assessment terminal and position-based assessment method
CN102821108A (en) * 2012-08-24 2012-12-12 北龙中网(北京)科技有限责任公司 Method for precisely synchronizing time of client and time of server
CN104933079A (en) * 2014-03-21 2015-09-23 阿里巴巴集团控股有限公司 Browser timing method and system
CN104933079B (en) * 2014-03-21 2018-07-20 阿里巴巴集团控股有限公司 A kind of browser clocking method and system
WO2016065617A1 (en) * 2014-10-31 2016-05-06 Splunk Inc. Automatically adjusting timestamps from remote systems based on time zone differences
US10567557B2 (en) 2014-10-31 2020-02-18 Splunk Inc. Automatically adjusting timestamps from remote systems based on time zone differences
CN107132999A (en) * 2016-02-29 2017-09-05 佳能株式会社 Management system, replacement management equipment, management method and storage medium
CN106331770A (en) * 2016-09-06 2017-01-11 青岛海信电器股份有限公司 Time synchronization method and client
CN106959604A (en) * 2017-04-01 2017-07-18 深圳天珑无线科技有限公司 The control method and device of terminal
CN106959604B (en) * 2017-04-01 2019-06-25 江西美晨通讯有限公司 The control method and device of terminal
CN107341377A (en) * 2017-06-16 2017-11-10 武汉斗鱼网络科技有限公司 Time synchronization control method in one kind authentication

Similar Documents

Publication Publication Date Title
CN1968077A (en) Method and system for time synchronization between client and server-end
US10103931B2 (en) Session-based matching of mutable browser identifiers
US8335848B2 (en) Method and apparatus for monitoring and synchronizing user interface events with network data
CN101131747B (en) Method, device and system for catching and/or analyzing Web page events at client terminal
US7610276B2 (en) Internet site access monitoring
US9165308B2 (en) System and method for loading of web page assets
US20170046739A1 (en) Systems and methods for generating lead intelligence
TW200820058A (en) Enabling web analytics for interactive web applications
CN103329162A (en) Methods and apparatus to determine media impressions using distributed demographic information
TWI279689B (en) Non-invasive technique for enabling distributed computing applications to exploit distributed fragment caching and assembly
CN107948329A (en) A kind of cross-domain processing method and system
CN106372130B (en) A kind of static resource management method
CN107451049A (en) Client bottleneck analysis is carried out using real user Monitoring Data
CN104731869A (en) Page display method and device
US20040111394A1 (en) Hidden fields for containing debug information
CN113408254A (en) Page form information filling method, device, equipment and readable medium
US20110093589A1 (en) Determining usage of computing devices that store state information on host computer systems
CN114637508A (en) VUE-based label parameter transfer method, device, equipment and storage medium
CN110851746B (en) Crawler seed generation method and device
US20240054030A1 (en) Local and Remote Event Handling
RU2775561C1 (en) Method and system for identification of electronic devices of real clients of organizations
US11526418B2 (en) System and method for optimizing technology stack architecture
US10452738B1 (en) Coordinating in-frame content with page content in applications
Luthra et al. Highly flexible server agnostic complex event processing operators
US20200125607A1 (en) System and method for analysis of web analytics tags

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20070523