CN107666500B - Timing method, device and system - Google Patents

Timing method, device and system Download PDF

Info

Publication number
CN107666500B
CN107666500B CN201610605145.3A CN201610605145A CN107666500B CN 107666500 B CN107666500 B CN 107666500B CN 201610605145 A CN201610605145 A CN 201610605145A CN 107666500 B CN107666500 B CN 107666500B
Authority
CN
China
Prior art keywords
timing
terminal
server
unit
duration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610605145.3A
Other languages
Chinese (zh)
Other versions
CN107666500A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610605145.3A priority Critical patent/CN107666500B/en
Publication of CN107666500A publication Critical patent/CN107666500A/en
Application granted granted Critical
Publication of CN107666500B publication Critical patent/CN107666500B/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]
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09BEDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS
    • G09B7/00Electrically-operated teaching apparatus or devices working with questions and answers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/535Tracking the activity of the user

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • Educational Administration (AREA)
  • Educational Technology (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a timing method, a timing device and a timing system, wherein the timing method comprises the following steps: when detecting that a first terminal logs in a user account and opens a job page, a server acquires a first historical timing duration corresponding to the user account recorded before, and starts timing by taking the first historical timing duration as a starting point; the server receives a first heartbeat packet sent by the first terminal by taking a preset time length as a receiving period, and if the first heartbeat packet sent by the first terminal can be received in the receiving period, the server continues timing. The embodiment of the invention can improve the continuity and the flexibility of timing.

Description

Timing method, device and system
Technical Field
The invention relates to the technical field of internet, in particular to a timing method, a timing device and a timing system.
Background
With the rapid development and popularization of the internet, an online education system is gradually perfected, people can enjoy convenient and efficient online education by accessing the internet, the function of performing on-line questions making and testing through a browser is loved by students, and the answering time is generally timed when answering on line. Currently, the browser generally times the answer time in the following two ways: one is that the front page starts timing when the user opens the browser page, the timing is stopped when the page is closed, the timing result is cleared, and the timing is required to be restarted from zero when the page is opened again next time; and the other method is that the timing is stopped when the page is closed, the timing duration is stored in the local by the front-end page of the browser, the last timing duration is obtained from the local by the front-end page when the page is opened again next time, and the timing is started by taking the last timing duration as a starting point.
In practice, it is found that according to the existing timing mode, after the page is closed, if the page is opened again on other terminals or other browsers, the page can only be re-timed from zero, so that the continuity of timing is poor and the timing is not flexible enough.
Disclosure of Invention
The embodiment of the invention provides a timing method, a timing device and a timing system, which can improve the continuity and the flexibility of timing.
A first aspect of an embodiment of the present invention provides a timing method, including:
the method comprises the steps that when a server detects that a first terminal logs in a user account and opens a job page, a first historical timing duration corresponding to the user account recorded by the server is obtained;
the server starts timing by taking the first historical timing duration as a starting point;
the server receives a first heartbeat packet sent by the first terminal by taking a preset time length as a receiving period;
and if the server receives the first heartbeat packet sent by the first terminal in the receiving period, continuing timing.
Optionally, when the server detects that a user account is logged in through a first terminal and a job page is opened, after acquiring a first historical timing duration corresponding to the user account recorded by the server, before the server starts timing with the first historical timing duration as a starting point, the method further includes:
and the server sends the first historical timing duration to the first terminal, so that the first terminal starts timing by taking the first historical timing duration as a starting point, and displays the real-time timing duration after the timing is started on the job page.
Optionally, the method further includes:
and if the server does not receive the first heartbeat packet sent by the first terminal in the receiving period, stopping timing and recording the current timing duration.
Optionally, the method further includes:
and if the server receives a notification message sent by the first terminal when the first terminal detects the submission operation or the closing operation input aiming at the job page, stopping timing and recording the current timing duration.
Optionally, the method further includes:
when the server detects that a second terminal logs in the user account and opens the job page, judging whether the server stops timing;
and if the server stops timing, the server acquires a second historical timing duration obtained when the timing is stopped, and restarts timing by taking the second historical timing duration as a starting point.
Optionally, the method further includes:
if the server does not stop timing, the server continues timing when receiving the first heartbeat packet sent by the first terminal and/or the second heartbeat packet sent by the second terminal in the receiving period.
A second aspect of the embodiments of the present invention provides a timing method, including:
when a terminal logs in a user account and opens a job page, a server is informed to acquire recorded historical timing duration corresponding to the user account, and timing is started by taking the historical timing duration as a starting point;
the terminal receives the historical timing duration sent by the server, starts timing by taking the historical timing duration as a starting point, and displays the real-time timing duration after timing is started on the operation page;
the terminal sends a heartbeat packet to the server according to a preset heartbeat cycle, so that when the server receives the heartbeat packet by taking a preset duration as a receiving cycle, if the heartbeat packet is received in the receiving cycle, timing is continued; and if the heartbeat packet is not received in the receiving period, stopping timing and recording the current timing duration.
Optionally, the method further includes:
and when the terminal detects the submission operation or the closing operation input aiming at the job page, the terminal stops timing, informs the server to stop timing and records the current timing duration.
A third aspect of an embodiment of the present invention provides a timing device, including:
the state detection unit is used for detecting whether the first terminal logs in the user account or not and opening a job page;
a duration obtaining unit, configured to obtain a recorded first historical timing duration corresponding to the user account when the detecting unit detects that the first terminal logs in the user account and opens the job page;
the timing unit is used for starting timing by taking the first historical timing duration as a starting point;
the heartbeat packet receiving unit is used for receiving a first heartbeat packet sent by the first terminal by taking a preset time length as a receiving period;
the timing unit is further configured to continue timing when the heartbeat packet receiving unit receives the first heartbeat packet sent by the first terminal in the receiving period.
Optionally, the apparatus further comprises:
and the time length sending unit is used for sending the first historical timing time length to the first terminal so that the first terminal starts timing by taking the first historical timing time length as a starting point, and displaying the real-time timing time length after the timing is started on the job page.
Optionally, the timing unit is further configured to stop timing and record a current timing duration when the heartbeat packet receiving unit does not receive the first heartbeat packet sent by the first terminal in the receiving period.
Optionally, the apparatus further comprises:
a message receiving unit, configured to receive a notification message sent by the first terminal;
the timing unit is further configured to stop timing and record a current timing duration when the message receiving unit receives the notification message sent by the first terminal when the first terminal detects a commit operation or a close operation input for the job page.
Optionally, the state detecting unit is further configured to detect whether a second terminal logs in the user account and opens the job page;
wherein the apparatus further comprises:
the judging unit is used for judging whether the timing unit stops timing or not when the state detecting unit detects that the second terminal logs in the user account and opens the job page;
the time length obtaining unit is further configured to obtain a second historical timing time length obtained when the timing unit stops timing when the judging unit judges that the timing unit stops timing;
the timing unit is further configured to restart timing with the second historical timing duration as a starting point.
Optionally, the timing unit is further configured to, when the determining unit determines that the timing unit does not stop timing, continue timing when the heartbeat packet receiving unit receives, in the receiving period, the first heartbeat packet sent by the first terminal and/or the second heartbeat packet sent by the second terminal.
A fourth aspect of the embodiments of the present invention provides a timer device, including:
the page starting unit is used for logging in a user account and opening a job page;
a notification unit, configured to notify a server to obtain a recorded historical timing duration corresponding to the user account when the page starting unit logs in the user account and opens the job page, and start timing with the historical timing duration as a starting point;
the time length receiving unit is used for receiving the historical timing time length sent by the server;
the timing unit is used for starting timing by taking the historical timing duration as a starting point;
the time length display unit is used for displaying real-time timing time length after the timing is started on the operation page;
a heartbeat packet sending unit, configured to send a heartbeat packet to the server according to a preset heartbeat cycle, so that when the server receives the heartbeat packet with a preset duration as a receiving cycle, if the heartbeat packet is received in the receiving cycle, timing continues; and if the heartbeat packet is not received in the receiving period, stopping timing and recording the current timing duration.
Optionally, the apparatus further comprises:
an operation detection unit configured to detect a commit operation or a close operation input for the job page;
the timing unit is further configured to stop timing when the operation detection unit detects the commit operation or the close operation;
the notifying unit is further configured to notify the server to stop timing and record a current timing duration when the operation detecting unit detects the commit operation or the close operation.
A fifth aspect of the embodiments of the present invention provides a time counting system, including a server and at least one terminal, where the server includes the time counting apparatus according to the third aspect, and the terminal includes the time counting apparatus according to the fourth aspect.
In the embodiment of the invention, when a server detects that a first terminal logs in a user account and opens a job page, acquiring a first historical timing duration corresponding to the user account recorded before, and starting timing by taking the first historical timing duration as a starting point; the server receives a first heartbeat packet sent by the first terminal by taking a preset time length as a receiving period, if the first heartbeat packet sent by the first terminal can be received in the receiving period, the server continues timing, timing is finished by the server end in combination with a heartbeat mechanism, and a timing result is recorded, so that the timing continuity and flexibility can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a timing system according to an embodiment of the present invention;
fig. 2 is a flowchart of a timing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a job page according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of another job page provided by an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a timing device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of another timing device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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.
The embodiment of the invention provides a timing system which can be an internet application system such as an online education system. Referring to fig. 1, the architecture of the timing system at least includes: the system comprises a server and at least one terminal accessing the server.
The terminal can be a notebook computer, a desktop computer, a mobile phone, a tablet computer, a vehicle-mounted terminal, an intelligent wearable device and the like. At least one type of internet application may be run in the terminal, including but not limited to: browser applications, online education applications, and the like. The user can use internet applications through the terminal, such as: the user can browse the webpage through the terminal browser and log in an online education website to do exercises, examinations and the like. The server can be an independent service device in the internet or a cluster service device formed by a plurality of independent service devices in the internet; the server can be used for providing various learning resources such as question banks and the like.
Fig. 2 is a schematic flow chart of a timing method according to an embodiment of the present invention. The timing method described in this embodiment includes the following steps:
s101, the first terminal logs in a user account and opens a job page.
The job page is a user interface for the user to answer questions online, and the specific expression form may be a PC-side job page as shown in fig. 3, or a mobile phone-side job page as shown in fig. 4. After logging in the user account, a homepage can be opened on browser applications of a plurality of terminals or different browser applications of the same terminal at the same time for online answering.
S102, when detecting that the first terminal logs in the user account and opens the job page, the server acquires a recorded first historical timing duration corresponding to the user account, and starts timing by taking the first historical timing duration as a starting point.
Specifically, the server may record the answer duration for each user account, store the answer duration at the server, and when detecting that the first terminal logs in a user account and opens a job page, the server obtains a first historical timing duration corresponding to the user account, that is, the timing duration when the first terminal last exits the job page under the user account, if the first historical timing duration is 0, it indicates that the job page under the user account is opened for the first time, or a zero clearing operation is performed in the period, and the server starts timing with the first historical timing duration as a starting point.
S103, the server sends the first historical timing duration to the first terminal.
S104, the first terminal starts timing by taking the first historical timing duration as a starting point, and displays real-time timing duration after timing is started on the operation page.
Specifically, in order to enable the user to intuitively grasp the current question making duration, the server may send the first historical timing duration to the first terminal, and the first terminal starts timing by using the first historical timing duration as a starting point and displays a real-time timing result on the job page.
And S105, the first terminal sends a first heartbeat packet to the server according to a preset first heartbeat cycle.
If the operation page is accidentally stuck, the browser crashes, the first terminal crashes and the like, and the server cannot know the situation, the server can think that the operation page is always in a connected state, so that the timing duration is likely to greatly exceed the actual question making duration on the operation page, and the accuracy of the timing duration is seriously influenced.
Specifically, to prevent the occurrence of the above situation, the server may conveniently know whether the job page on the first terminal is in the connection state through the heartbeat mechanism, that is, when the job page is not closed or the user does not submit the job, the first terminal may send the first heartbeat packet to the server in a preset first heartbeat period (for example, 3 seconds) to notify the server that the job page on the first terminal is in the connection state, which is beneficial to improving the accuracy of timing.
S106, the server receives the first heartbeat packet sent by the first terminal with a preset time length as a receiving period, and if the first heartbeat packet sent by the first terminal is received in the receiving period, timing is continued.
Similarly, the server may also set a receiving period, for example, 6 seconds, and the server determines whether the first heartbeat packet sent by the first terminal is received in each receiving period, and if so, it indicates that the job page on the first terminal is in a connected state, and the server continues to count time.
S107, if the server does not receive the first heartbeat packet sent by the first terminal in the receiving period, stopping timing and recording the current timing duration.
Specifically, if the job page is closed or submitted, the server does not receive the first heartbeat packet sent by the first terminal in the receiving period, and at this time, the server considers that the job page is disconnected, stops timing, and records and stores the current timing duration.
And S108, when the first terminal detects the submission operation or the closing operation input aiming at the job page, the first terminal sends a notification message to the server.
And S109, the server stops timing and records the current timing duration.
Further, after answering, the user can submit the job page, or when the user needs to leave the job page temporarily, the user can close the job page, and the first terminal can immediately send a notification message to the server when detecting that the user inputs a submitting operation or a closing operation for the job page, so that the server directly stops timing and records and stores the current timing duration, and the timing duration does not need to be stopped until the first heartbeat packet sent by the first terminal is not received in a receiving period, so that the timing duration can be more accurate.
And S110, the second terminal logs in the user account and opens the job page.
S111, when the server detects that a second terminal logs in the user account and opens the job page, if the server stops timing, the server obtains a second historical timing duration obtained when the timing is stopped, and the timing is restarted by taking the second historical timing duration as a starting point.
Specifically, when the user account logs in at multiple terminals, taking the user account logging in at two terminals as an example, assuming that the user account also logs in at the second terminal and opens the job page, if the server detects that the second terminal logs in the user account and opens the job page, and the timing is stopped, a process similar to steps S102 to S104 may be executed, that is, the server obtains a second historical timing duration obtained when the timing is stopped last time, and restarts the timing with the second historical timing duration as a starting point. Similarly, in order to facilitate the second terminal to intuitively grasp the current question making duration, the server may send the second historical timing duration to the second terminal, and the second terminal starts timing by taking the second historical timing duration as a starting point synchronously and displays a real-time timing result on an operation page thereof, thereby realizing seamless docking of the timing durations between the two terminals.
And S112, the second terminal sends a second heartbeat packet to the server according to a preset second heartbeat cycle.
The preset second heartbeat cycle and the preset first heartbeat cycle may be the same, for example, 3 seconds, and may also be set to be different.
The second terminal may send a second heartbeat packet to the server at a preset second heartbeat cycle to notify the server that the job page on the second terminal is in a connected state.
S113, if the server does not stop timing, the server continues timing when receiving the first heartbeat packet sent by the first terminal and/or the second heartbeat packet sent by the second terminal in the receiving period.
Specifically, when the server detects that the second terminal logs in the user account and opens the job page, if timing is not stopped, it indicates that the job page on the first terminal is still in a connected state, and the server can confirm that the job page is in the connected state as long as it can receive the heartbeat packet sent by any one or both of the first terminal and the second terminal in a receiving period, and continues timing until the server cannot receive the heartbeat packet in the receiving period, at which time timing is stopped, and current timing duration is recorded and stored.
It should be noted that, when the job pages on the first terminal and the second terminal are both in a connected state, if a job page on one terminal is submitted or closed, the server should not immediately stop timing when receiving a notification message sent by the terminal that the job page is submitted or closed, but determine whether a heartbeat packet sent by the other terminal can be received in the next receiving period, if so, the server continues timing, and if not, the server may determine that the job page on the other terminal is disconnected, stop timing, and record and store the current timing duration.
In the embodiment of the invention, when a server detects that a first terminal logs in a user account and opens an operation page, the server acquires a recorded first historical timing duration corresponding to the user account from the local, starts timing by taking the first historical timing duration as a starting point, and pushes the first historical timing duration to the first terminal at the same time, the first terminal can synchronously time and display a real-time timing result, the server confirms the connection state of the operation page on the first terminal by using a heartbeat mechanism, if a heartbeat packet sent by the first terminal can be received in a receiving period, the operation page on the first terminal is confirmed to be in a connection state and continues timing, otherwise, the server confirms that the operation page on the first terminal is disconnected, stops timing and records the current timing duration. When the first terminal detects the submission operation or the closing operation aiming at the operation page, the first terminal reports the submission operation or the closing operation to the server, and the server stops timing and records the current timing duration. When the server detects that the second terminal also logs in the user account and opens the operation page, if the server does not stop timing, the server can confirm that the operation page is in a connection state as long as the server can receive the heartbeat packet sent by any one of the first terminal and the second terminal in the receiving period, and continues timing until the server cannot receive the heartbeat packet in the receiving period, at the moment, timing is stopped, the current timing duration is recorded and stored, and the timing duration is stored in the server end, so that the timing continuity and flexibility can be improved, and the seamless connection of the timing durations among multiple terminals is realized.
Based on the timing system and the timing method shown in the above embodiments, an embodiment of the present invention further provides a server, which may be the server shown in fig. 1 and may be configured to execute corresponding steps of the method flow shown in fig. 2. Referring to fig. 5, the internal structure of the server may include, but is not limited to: a processor, a network interface, and a memory. The processor, the network interface and the memory in the server may be connected by a bus or other means, and fig. 5 shows an example of the connection by a bus in the embodiment of the present invention.
The processor (or CPU) is a computing core and a control core of the server. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI, mobile communication interface, etc.). The Memory (Memory) is a Memory device in the server for storing programs and data. It is understood that the memory herein may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory; optionally, at least one memory device located remotely from the processor. The memory provides storage space that stores the operating system of the server, which may include, but is not limited to: windows system (an operating system), Luix system, etc., which are not limited in this regard. The memory space of the memory also stores a timing device.
In the embodiment of the present invention, the server executes the corresponding steps of the method flow shown in fig. 2 by running the timing device in the memory. Referring also to fig. 6, during the timing process, the apparatus operates as follows:
the state detection unit 101 is configured to detect whether the first terminal logs in the user account and opens a job page.
A duration obtaining unit 102, configured to obtain a recorded first historical timing duration corresponding to the user account when the detecting unit detects that the first terminal logs in the user account and opens the job page.
A timing unit 103, configured to start timing with the first historical timing duration as a starting point.
And the heartbeat packet receiving unit 104 is configured to receive a first heartbeat packet sent by the first terminal with a preset duration as a receiving period.
The timing unit 103 is further configured to continue timing when the heartbeat packet receiving unit receives the first heartbeat packet sent by the first terminal in the receiving period.
In a specific implementation, the device further operates the following units:
a duration sending unit 105, configured to send the first historical timing duration to the first terminal, so that the first terminal starts timing with the first historical timing duration as a starting point, and displays, on the job page, a real-time timing duration after the timing is started.
In a specific implementation, the timing unit 103 is further configured to stop timing and record a current timing duration when the heartbeat packet receiving unit does not receive the first heartbeat packet sent by the first terminal in the receiving period.
In a specific implementation, the device further operates the following units:
a message receiving unit 106, configured to receive the notification message sent by the first terminal.
The timing unit 103 is further configured to stop timing and record a current timing duration when the message receiving unit receives the notification message sent by the first terminal when the first terminal detects a commit operation or a close operation input for the job page.
In a specific implementation, the state detection unit 101 is further configured to detect whether a second terminal logs in the user account and opens the job page.
Wherein the device also operates the following units:
a determining unit 107, configured to determine whether the timing unit has stopped timing when the state detecting unit detects that the second terminal logs in the user account and opens the job page.
The duration obtaining unit 102 is further configured to obtain a second historical timing duration obtained when the timing unit stops timing when the determining unit determines that the timing unit stops timing.
The timing unit 103 is further configured to restart timing with the second historical timing duration as a starting point.
In a specific implementation, the timing unit 103 is further configured to continue timing when the determining unit determines that the timing unit does not stop timing, and the heartbeat packet receiving unit receives, in the receiving period, the first heartbeat packet sent by the first terminal and/or the second heartbeat packet sent by the second terminal.
In the embodiment of the present invention, when the state detection unit 101 detects that a first terminal logs in a user account and opens a job page, the duration acquisition unit 102 acquires a first historical timing duration corresponding to the user account recorded before, and the timing unit 103 starts timing with the first historical timing duration as a starting point; the heartbeat packet receiving unit 104 receives a first heartbeat packet sent by the first terminal with a preset duration as a receiving period, and if the first heartbeat packet sent by the first terminal can be received in the receiving period, the timing unit 103 continues to time, and the server end completes timing and records a timing result in combination with a heartbeat mechanism, so that the continuity and flexibility of timing can be improved.
Based on the timing system and the timing method shown in the foregoing embodiments, an embodiment of the present invention further provides a terminal, which may be any one of the terminals shown in fig. 1 and may be configured to execute corresponding steps of the method flow shown in fig. 2. Referring to fig. 7, the internal structure of the terminal may include, but is not limited to: a processor, a user interface, a network interface, and a memory. The processor, the user interface, the network interface and the memory in the terminal may be connected by a bus or other means, and fig. 7 shows an example of the connection by a bus according to the embodiment of the present invention.
The user interface is a medium for implementing interaction and information exchange between a user and a terminal, and may specifically include a Display screen (Display) for output and a Keyboard (Keyboard) for input, and the like. The processor (or CPU) is a computing core and a control core of the terminal, and can analyze various instructions in the terminal and process various data of the terminal, such as: the CPU can be used for analyzing a power-on and power-off instruction sent to the terminal by a user and controlling the terminal to carry out power-on and power-off operation; the following steps are repeated: the CPU may transmit various types of interactive data between the internal structures of the terminal, and so on. A Memory (Memory) is a Memory device in a terminal for storing programs and data. It is to be understood that the memory herein can include both the built-in memory of the terminal and, of course, the expansion memory supported by the terminal. The memory provides storage space that stores the operating system of the terminal, which may include, but is not limited to: a Windows system (an operating system), an Android system (an Android, a mobile operating system), an IOS system (a mobile operating system), and the like, which are not limited thereto. The memory space of the memory stores the timing device. The device may be an application in the terminal, such as: the device may be a browser application or the like within the terminal.
In the embodiment of the present invention, the terminal executes the corresponding steps of the method flow shown in fig. 2 by operating the timing device in the memory. Referring to fig. 8, during the timing process, the apparatus operates as follows:
a page starting unit 201, configured to log in a user account and open a job page.
A notifying unit 202, configured to notify the server to obtain a recorded historical timing duration corresponding to the user account when the page starting unit logs in the user account and opens the job page, and start timing with the historical timing duration as a starting point.
A duration receiving unit 203, configured to receive the historical timing duration sent by the server.
The timing unit 204 is configured to start timing by using the historical timing duration as a starting point.
A duration display unit 205, configured to display a real-time timed duration after starting timing on the job page.
A heartbeat packet sending unit 206, configured to send a heartbeat packet to the server according to a preset heartbeat cycle, so that when the server receives the heartbeat packet with a preset duration as a receiving cycle, if the heartbeat packet is received in the receiving cycle, timing continues; and if the heartbeat packet is not received in the receiving period, stopping timing and recording the current timing duration.
In a specific implementation, the device further operates the following units:
an operation detection unit 207 for detecting a commit operation or a close operation input for the job page.
The timing unit 204 is further configured to stop timing when the operation detection unit detects the commit operation or the close operation.
The notifying unit 202 is further configured to notify the server to stop timing and record a current timing duration when the operation detecting unit detects the commit operation or the close operation.
In the embodiment of the present invention, when the page starting unit 201 logs in a user account and opens a job page, the notification unit 202 notifies the server to obtain a recorded historical timing duration corresponding to the user account, and starts timing with the historical timing duration as a starting point; the time length receiving unit 203 receives the historical timing time length sent by the server, the timing unit 204 starts timing by taking the historical timing time length as a starting point, and the time length display unit 205 displays the real-time timing time length after the timing is started on the job page; the heartbeat packet sending unit 206 sends a heartbeat packet to the server according to a preset heartbeat cycle, so that when the server receives the heartbeat packet with a preset duration as a receiving cycle, if the heartbeat packet is received in the receiving cycle, timing is continued; if the heartbeat packet is not received in the receiving period, timing is stopped, the current timing duration is recorded, timing is completed by the server end in combination with the heartbeat mechanism, the timing result is recorded, the current timing duration can be synchronously displayed by the terminal, and the continuity and the flexibility of timing can be improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The timing method, the timing device and the timing system provided by the embodiment of the invention are described in detail, a specific example is applied in the description to explain the principle and the implementation of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (16)

1. A method of timing, comprising:
the method comprises the steps that when a server detects that a first terminal logs in a user account and opens a job page, a first historical timing duration corresponding to the user account recorded by the server is obtained;
the server sends the first historical timing duration to the first terminal, so that the first terminal starts timing by taking the first historical timing duration as a starting point, and real-time timing duration after timing starting is displayed on the job page;
the server starts timing by taking the first historical timing duration as a starting point;
the server receives a first heartbeat packet sent by the first terminal by taking a preset time length as a receiving period, wherein the first heartbeat packet is used for indicating that the operation page on the first terminal is in a connection state;
and if the server receives the first heartbeat packet sent by the first terminal in the receiving period, continuing timing.
2. The method of claim 1, further comprising:
and if the server does not receive the first heartbeat packet sent by the first terminal in the receiving period, stopping timing and recording the current timing duration.
3. The method of claim 1, further comprising:
and if the server receives a notification message sent by the first terminal when the first terminal detects the submission operation or the closing operation input aiming at the job page, stopping timing and recording the current timing duration.
4. The method according to any one of claims 1 to 3, further comprising:
when the server detects that a second terminal logs in the user account and opens the job page, judging whether the server stops timing;
and if the server stops timing, the server acquires a second historical timing duration obtained when the timing is stopped, and restarts timing by taking the second historical timing duration as a starting point.
5. The method of claim 4, further comprising:
if the server does not stop timing, the server continues timing when receiving the first heartbeat packet sent by the first terminal and/or the second heartbeat packet sent by the second terminal in the receiving period.
6. A method of timing, comprising:
when a terminal logs in a user account and opens a job page, a server is informed to acquire recorded historical timing duration corresponding to the user account, and timing is started by taking the historical timing duration as a starting point;
the terminal receives the historical timing duration sent by the server, starts timing by taking the historical timing duration as a starting point, and displays the real-time timing duration after timing is started on the operation page;
the terminal sends a heartbeat packet to the server according to a preset heartbeat cycle, so that when the server receives the heartbeat packet by taking a preset duration as a receiving cycle, if the heartbeat packet is received in the receiving cycle, timing is continued; if the heartbeat packet is not received in the receiving period, stopping timing and recording the current timing duration; the heartbeat packet is used for indicating that the operation page on the terminal is in a connection state.
7. The method of claim 6, further comprising:
and when the terminal detects the submission operation or the closing operation input aiming at the job page, the terminal stops timing, informs the server to stop timing and records the current timing duration.
8. A time keeping device, comprising:
the state detection unit is used for detecting whether the first terminal logs in the user account or not and opening a job page;
a duration obtaining unit, configured to obtain a recorded first historical timing duration corresponding to the user account when the detecting unit detects that the first terminal logs in the user account and opens the job page;
a sending unit, configured to send the first historical timing duration to the first terminal, so that the first terminal starts timing with the first historical timing duration as a starting point, and displays, on the job page, a real-time timing duration after the timing is started;
the timing unit is used for starting timing by taking the first historical timing duration as a starting point;
a heartbeat packet receiving unit, configured to receive a first heartbeat packet sent by the first terminal with a preset duration as a receiving period, where the first heartbeat packet is used to indicate that the job page on the first terminal is in a connection state;
the timing unit is further configured to continue timing when the heartbeat packet receiving unit receives the first heartbeat packet sent by the first terminal in the receiving period.
9. The apparatus of claim 8,
the timing unit is further configured to stop timing and record a current timing duration when the heartbeat packet receiving unit does not receive the first heartbeat packet sent by the first terminal in the receiving period.
10. The apparatus of claim 8, further comprising:
a message receiving unit, configured to receive a notification message sent by the first terminal;
the timing unit is further configured to stop timing and record a current timing duration when the message receiving unit receives the notification message sent by the first terminal when the first terminal detects a commit operation or a close operation input for the job page.
11. The apparatus according to any one of claims 8 to 10,
the state detection unit is also used for detecting whether a second terminal logs in the user account and opens the operation page;
wherein the apparatus further comprises:
the judging unit is used for judging whether the timing unit stops timing or not when the state detecting unit detects that the second terminal logs in the user account and opens the job page;
the time length obtaining unit is further configured to obtain a second historical timing time length obtained when the timing unit stops timing when the judging unit judges that the timing unit stops timing;
the timing unit is further configured to restart timing with the second historical timing duration as a starting point.
12. The apparatus of claim 11,
the timing unit is further configured to continue timing when the determining unit determines that the timing unit does not stop timing, and the heartbeat packet receiving unit receives the first heartbeat packet sent by the first terminal and/or the second heartbeat packet sent by the second terminal in the receiving period.
13. A time keeping device, comprising:
the page starting unit is used for logging in a user account and opening a job page;
a notification unit, configured to notify a server to obtain a recorded historical timing duration corresponding to the user account when the page starting unit logs in the user account and opens the job page, and start timing with the historical timing duration as a starting point;
the time length receiving unit is used for receiving the historical timing time length sent by the server;
the timing unit is used for starting timing by taking the historical timing duration as a starting point;
the time length display unit is used for displaying real-time timing time length after the timing is started on the operation page;
a heartbeat packet sending unit, configured to send a heartbeat packet to the server according to a preset heartbeat cycle, so that when the server receives the heartbeat packet with a preset duration as a receiving cycle, if the heartbeat packet is received in the receiving cycle, timing continues; if the heartbeat packet is not received in the receiving period, stopping timing and recording the current timing duration; the heartbeat packet is used for indicating that the operation page on the terminal is in a connection state.
14. The apparatus of claim 13, further comprising:
an operation detection unit configured to detect a commit operation or a close operation input for the job page;
the timing unit is further configured to stop timing when the operation detection unit detects the commit operation or the close operation;
the notifying unit is further configured to notify the server to stop timing and record a current timing duration when the operation detecting unit detects the commit operation or the close operation.
15. A timekeeping system comprising a server and at least one terminal, wherein the server comprises a timekeeping apparatus according to any of claims 8 to 12 and the terminal comprises a timekeeping apparatus according to claim 13 or 14.
16. A computer-readable storage medium, in which a computer program is stored, which, when executed, comprises a timing method according to any one of claims 1 to 5; alternatively, the computer program, when executed, comprises a timing method as claimed in any one of claims 6 or 7.
CN201610605145.3A 2016-07-28 2016-07-28 Timing method, device and system Active CN107666500B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610605145.3A CN107666500B (en) 2016-07-28 2016-07-28 Timing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610605145.3A CN107666500B (en) 2016-07-28 2016-07-28 Timing method, device and system

Publications (2)

Publication Number Publication Date
CN107666500A CN107666500A (en) 2018-02-06
CN107666500B true CN107666500B (en) 2021-01-15

Family

ID=61115391

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610605145.3A Active CN107666500B (en) 2016-07-28 2016-07-28 Timing method, device and system

Country Status (1)

Country Link
CN (1) CN107666500B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112255906B (en) * 2020-09-25 2021-08-24 深圳星标科技股份有限公司 Timing method, visual navigation aid equipment control method and related device
CN115270036B (en) * 2022-07-27 2024-01-30 北京道达天际科技股份有限公司 Webpage browsing duration calculation method based on liveness continuous time service

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104574118A (en) * 2015-01-09 2015-04-29 西安融成科技有限公司 Multi-party synchronous timing system and method
CN105611520A (en) * 2015-12-25 2016-05-25 北京奇虎科技有限公司 Method and device for realizing user Internet surfing control

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120046995A1 (en) * 2009-04-29 2012-02-23 Waldeck Technology, Llc Anonymous crowd comparison

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104574118A (en) * 2015-01-09 2015-04-29 西安融成科技有限公司 Multi-party synchronous timing system and method
CN105611520A (en) * 2015-12-25 2016-05-25 北京奇虎科技有限公司 Method and device for realizing user Internet surfing control

Also Published As

Publication number Publication date
CN107666500A (en) 2018-02-06

Similar Documents

Publication Publication Date Title
US10198410B2 (en) Method, device and mobile terminal for restoring page
WO2017036047A1 (en) Information extraction method and information extraction device
CN108076123B (en) Webpage debugging method, device and system
WO2015106660A1 (en) Security check method and system, terminal, verification server
CN103678343B (en) The method and apparatus of prompting webpage load progress
CN104021218A (en) Information display method and device
US11886798B2 (en) Method and apparatus for obtaining loading time length of image in webpage, and electronic device
CN107666500B (en) Timing method, device and system
CN108270646B (en) Method and device for detecting electronic class board network
CN103581987B (en) The test method and device of the page download speed of mobile terminal device
CN108960587A (en) Evaluation method, device and the readable storage medium storing program for executing of purchase of property consulting services quality
WO2014197495A1 (en) Method and apparatus for generating frequently asked questions
WO2020056878A1 (en) Method for acquiring launching duration of application interface, apparatus, and terminal device
CN113902436A (en) Analog card switching method, terminal device, card reader and storage medium
CN112882953A (en) Automatic demonstration method and system for application program based on android debugging bridge
CN109558297A (en) EMS memory management process and device
CN107231647B (en) Network detecting method, network detection device and intelligent terminal
CN106156096A (en) A kind of page time of staying acquisition methods, system and user terminal
CN110620788B (en) Information interaction method, related product and computer readable storage medium
CN112052163A (en) High-concurrency webpage pressure testing method and device, electronic equipment and storage medium
CN111312241A (en) Unmanned shopping guide method, terminal and storage medium
CN110806909A (en) Method and device for determining page frame dropping information of application program and electronic equipment
CN107967363B (en) Data processing method and device and electronic equipment
JP2019091012A (en) Information recognition method and device
CN114611035A (en) Page switching method and electronic equipment

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