CN115630253A - Page idle detection method and device, electronic equipment and storage medium - Google Patents

Page idle detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115630253A
CN115630253A CN202211397203.XA CN202211397203A CN115630253A CN 115630253 A CN115630253 A CN 115630253A CN 202211397203 A CN202211397203 A CN 202211397203A CN 115630253 A CN115630253 A CN 115630253A
Authority
CN
China
Prior art keywords
timing
idle
user operation
user
monitoring
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
CN202211397203.XA
Other languages
Chinese (zh)
Inventor
胡春亮
黄洪
胡明远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nettrix Information Industry Beijing Co Ltd
Original Assignee
Nettrix Information Industry Beijing 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 Nettrix Information Industry Beijing Co Ltd filed Critical Nettrix Information Industry Beijing Co Ltd
Priority to CN202211397203.XA priority Critical patent/CN115630253A/en
Publication of CN115630253A publication Critical patent/CN115630253A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a page idle detection method and device, electronic equipment and a storage medium. The page idle detection method may specifically include: under the condition that the client is determined to be successfully connected, event monitoring is carried out on the user operation through a monitoring module; under the condition that the user operation is determined to be effective, performing first idle timing through a timing module; the user effective operation is a user operation with an operation frequency smaller than a preset operation frequency threshold; and determining first current idle time according to the first idle timing result, and disconnecting the client connection under the condition that the first current idle time exceeds a first preset time threshold. The technical scheme of the embodiment of the invention can reduce the participation of the server, avoid the resource waste of the server and reduce the pressure of the server, thereby improving the performance of the server.

Description

Page idle detection method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a page idle detection method and device, electronic equipment and a storage medium.
Background
With the rapid development of the internet, various websites and applications are developed like a bamboo shoot in spring after rain, so that more and more users acquire various network resources through the internet, but as the number of users increases, the pressure of servers providing network resources is also increasing. In order to reduce the pressure of the server and avoid resource waste, the front end of the Web (World Wide Web, internet) can make some mechanisms to control the indiscriminate output of resources, and the timeout mechanism is one of the mechanisms.
The existing page idle detection method generally adopts a mode of combining a client and a server to jointly establish a timeout mechanism. Specifically, firstly, the client monitors the operation of the user on the page and sends an instruction for updating the timeout time to the server. And judging whether the time exceeds a set threshold value or not after the server updates the time, if so, actively disconnecting, and reconnecting the client.
However, the above-mentioned page idle detection method involves the server in a timeout mechanism, and while monitoring the page, the user may perform various operations at the same time, which adds an additional burden to the server.
Disclosure of Invention
The embodiment of the invention provides a page idle detection method and device, electronic equipment and a storage medium, which can reduce participation of a server, avoid resource waste of the server and reduce the pressure of the server so as to improve the performance of the server.
According to an aspect of the present invention, a method for detecting page idleness is provided, which includes:
under the condition that the client is determined to be successfully connected, event monitoring is carried out on user operation through a monitoring module;
under the condition that the user operation is determined to be effective, performing first idle timing through a timing module; the user effective operation is a user operation with an operation frequency smaller than a preset operation frequency threshold;
and determining first current idle time according to the first idle timing result, and disconnecting the client connection under the condition that the first current idle time exceeds a first preset time threshold.
In addition, the page idle detection method according to the above embodiment of the present invention may further have the following additional technical features:
optionally, the page idle detection method further includes:
and returning to execute the operation of monitoring the event of the user operation through the monitoring module under the condition that the user operation is determined to be invalid.
One embodiment of the above invention has the following advantages or benefits: the method and the device have the advantages that a supplementary processing strategy for determining that the user operation is the user invalid operation is added, namely when the user operation is the user invalid operation, the event monitoring is continuously carried out on the user operation through the monitoring module, so that the event throttling of the user operation event is realized, and the waste of resources and performance caused by the high-frequency trigger event can be effectively avoided.
Optionally, the page idle detection method further includes:
when the monitoring module monitors the operation of the first user, the timing module is used for carrying out second idle timing;
under the condition that the monitoring module monitors the operation of a second user, determining second current idle time according to a second idle timing result;
determining the second user operation as the effective user operation under the condition that the second current idle time is determined to reach a second preset time threshold;
and under the condition that the second current idle time is determined not to reach the second preset time threshold, determining the second user operation as the invalid user operation.
One embodiment of the above invention has the following advantages or benefits: a specific implementation mode for determining the effective operation and the ineffective operation of the user is provided, so that resource and performance waste caused by triggering the user operation for multiple times in a short time is avoided.
Optionally, the page idle detection method further includes:
under the condition that the client is determined to be successfully connected, performing third idle timing through the timing module, and determining third current idle time according to a third idle timing result;
and under the condition that the monitoring module does not monitor the user operation and the third current idle time exceeds a first preset time threshold, disconnecting the client.
One embodiment of the above invention has the following advantages or benefits: the supplementary processing strategy that the monitoring module does not monitor the user operation is added, namely, the timing module is used for carrying out third idle timing when the client is successfully connected, so that the client is disconnected when the monitoring module does not monitor the user operation and the third current idle time exceeds the first preset time threshold, and the client can be disconnected when the user operation does not exist, thereby ensuring the realization of an overtime mechanism.
Optionally, before the first idle timing is performed by the timing module, the method further includes:
sending a timing resetting instruction to a timing module through a monitoring module;
and updating the third current idle time to a preset time value through the timing module according to the reset timing instruction.
One embodiment of the above invention has the following advantages or benefits: the monitoring module sends a reset timing instruction to the timing module, and the timing module updates the third current idle time to a preset time value according to the reset timing instruction, so that the timing module can start new idle timing, and the accuracy of idle timing is improved.
Optionally, before performing event monitoring on the user operation through the monitoring module, the method further includes:
determining a monitoring object; the monitoring object comprises a browser page and/or an application page;
the event monitoring is carried out on the user operation through a monitoring module, and the event monitoring comprises the following steps:
and performing event monitoring on the user operation in the monitored object through the monitoring module.
One embodiment of the above invention has the following advantages or benefits: the specific application scenario of event monitoring is provided to realize event monitoring on user operation in a browser page or an application page, so that the application scenario of event monitoring on user operation is expanded.
Optionally, the user operation includes at least one of a mouse click event, a keyboard input event, a mouse slide event, a mouse wheel scroll event, and a screen touch event.
One embodiment of the above invention has the following advantages or benefits: the method provides various operation events included by the user operation, and can monitor the user operation more comprehensively, thereby expanding the application scene of the method.
According to another aspect of the present invention, there is provided a page idle detection apparatus, including:
the monitoring module is used for monitoring the event of the user operation under the condition that the client is determined to be successfully connected;
the timing module is used for carrying out first idle timing under the condition that the user operation is determined to be effective operation of the user; the user effective operation is a user operation with an operation frequency smaller than a preset operation frequency threshold;
and the timing module is also used for determining first current idle time according to the first idle timing result and disconnecting the client connection under the condition that the first current idle time exceeds a first preset time threshold.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the page idle detection method according to any embodiment of the invention.
According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to implement the page idle detection method according to any one of the embodiments of the present invention when executed.
According to the technical scheme of the embodiment of the invention, when the client is determined to be successfully connected, the monitoring module monitors the event of the user operation, and when the user operation is determined to be the effective operation of the user, the timing module performs the first idle timing to determine the first current idle time according to the first idle timing result, so that the client connection is disconnected when the first current idle time exceeds the first preset time threshold, the problem of overlarge server burden pressure in an overtime mechanism of the conventional page idle detection method is solved, the participation of the server can be reduced, the resource waste of the server is avoided, and the pressure of the server is reduced, so that the performance of the server is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
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 flowchart of a page idle detection method according to an embodiment of the present invention;
fig. 2 is a flowchart of a page idle detection method according to a second embodiment of the present invention;
fig. 3 is an exemplary flowchart of a page idle detection method provided by a third embodiment of the present invention;
fig. 4 is a schematic diagram of a page idle detection apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the page idle detection method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a page idle detection method provided in an embodiment of the present invention, where this embodiment is applicable to a situation where participation of a server is reduced in a timeout mechanism, server pressure is reduced, and server performance is improved, and this method may be executed by a page idle detection apparatus, and this apparatus may be implemented in a software and/or hardware manner, and may generally be directly integrated in an electronic device that executes this method, where this electronic device may be a terminal device or a server device. Specifically, as shown in fig. 1, the page idle detection method may specifically include the following steps:
and S110, under the condition that the client is determined to be successfully connected, performing event monitoring on the user operation through a monitoring module.
Wherein, the successful connection of the client may be the successful connection of the client and the server. It should be noted that, the successful connection of the client may be determined after the client receives the message of successful connection sent by the server, or the successful connection of the client may be determined after the client sends the connection request to the server. The listening module may be a module for listening to user operations. The user operation may be any operation of the user, for example, a keyboard operation, a mouse operation, or a touch operation, which is not limited in this embodiment of the present invention.
In the embodiment of the invention, whether the client is successfully connected is determined, and the event monitoring is carried out on the user operation through the monitoring module when the client is successfully connected. It will be appreciated that each user action may be determined to be an event. And performing event monitoring on the user operation, namely monitoring whether the user operation event occurs.
S120, under the condition that the user operation is determined to be the effective operation of the user, performing first idle timing through a timing module; and the user effective operation is the user operation of which the operation frequency is less than a preset operation frequency threshold value.
Wherein the user valid operation may be a valid user operation. The first idle timer may be a timer operation that records the idle time. It will be appreciated that idle time is also time without user action. The operating frequency may be a frequency at which a user operates. The preset operating frequency threshold may be a preset threshold of operating frequency. It is understood that, when the operation frequency of the user operation is less than the preset operation frequency, the user operation may be determined as the user valid operation.
In the embodiment of the invention, after the monitoring module monitors the event of the user operation, the monitoring module can further determine whether the monitored user operation is the effective user operation when the monitoring module monitors the user operation, and the timing module performs the first idle timing when the user operation is the effective user operation.
It is understood that the user operation may include a user valid operation and a user invalid operation. And when the operation frequency of the user operation is greater than the preset operation frequency, determining the user operation as the invalid user operation. If the operating frequency of the user operation is greater than the preset operating frequency threshold, it indicates that multiple user operation events occur in a short time, and in order to avoid triggering idle timing for multiple times, the user operation events occurring multiple times in a short time can be determined as invalid user operations. When the user operation is the invalid operation of the user, idle timing is not carried out, so that resource waste is avoided.
S130, determining first current idle time according to the first idle timing result, and disconnecting the client connection under the condition that the first current idle time exceeds a first preset time threshold.
Wherein the first idle timing result may be a result obtained by the first idle timing. The first current idle time may be an idle time obtained by the first idle timer. For example, assuming that the first idle timing result is 5 counting results obtained by the first idle timing, the first current idle time may be 5 minutes, or may be 5 seconds, and the like, which is not limited in this embodiment of the present invention. The first predetermined time threshold may be a predetermined time threshold. Optionally, the first preset time threshold may be a preset idle timeout threshold, that is, a preset maximum time threshold without user operation, for example, 0.5 hour, or 1 hour, and the like.
In the embodiment of the present invention, after the first idle timing is performed by the timing module, a first current idle time may be further determined according to a first idle timing result, so as to determine whether the first current idle time exceeds a first preset time threshold, and the client connection is disconnected when the first current idle time exceeds the first preset time threshold. For example, assuming that the first preset time threshold is 0.5 hours, the client connection may be disconnected when the first current idle time is determined to be greater than 0.5 hours.
Optionally, the first idle timing result may be determined at any time after the timing module performs the first idle timing, or the first idle timing result may be determined when the system time interval reaches the set time interval, and the like, which is not limited in the embodiment of the present invention. For example, the first idle timing result may be determined at any time, thereby determining whether the first current idle time exceeds the first preset time threshold at any time. The operation of determining the result of the first idle timing may also be performed every 5 minutes, so that the operation of determining whether the first current idle time exceeds the first preset time threshold is performed every 5 minutes.
According to the technical scheme, when the client is determined to be successfully connected, event monitoring is carried out on user operation through the monitoring module, when the user operation is determined to be effective operation of the user, first idle timing is carried out through the timing module, first current idle time is determined according to a first idle timing result, the client is disconnected when the first current idle time exceeds a first preset time threshold, the problem that server burden pressure is overlarge in an overtime mechanism of an existing page idle detection method is solved, server participation can be reduced, resource waste of the server is avoided, meanwhile, the pressure of the server is reduced, and therefore the performance of the server is improved.
Example two
Fig. 2 is a flowchart of a page idle detection method provided in the second embodiment of the present invention, which further details the above technical solutions and provides various specific optional implementation manners for performing event monitoring on a user operation through a monitoring module and determining that the user operation is an effective user operation. The solution in this embodiment may be combined with the individual alternatives in one or more of the embodiments described above. As shown in fig. 2, the method may include the steps of:
s210, under the condition that the client is determined to be successfully connected, event monitoring is carried out on the user operation through a monitoring module.
Optionally, before performing event monitoring on the user operation through the monitoring module, the method may further include: determining a monitoring object; the monitoring object comprises a browser page and/or an application page; correspondingly, the event monitoring of the user operation by the monitoring module may include: and carrying out event monitoring on the user operation in the monitored object through the monitoring module.
The monitoring object may be an object for performing event monitoring on the user operation, and may be, for example, a page for performing event monitoring on the user operation. It can be understood that the listening object may be one page or multiple pages, which is not limited in this embodiment of the present invention. Specifically, the monitoring object may be a browser page, an application page, or a browser page and an application page. The application page may be a page in an application.
Specifically, before the monitoring module monitors the event of the user operation, the monitored object may be determined, so as to perform the event monitoring on the user operation in the monitored object through the monitoring module.
According to the technical scheme, a specific application scene of event monitoring is provided, so that event monitoring of user operation is realized in a browser page or an application page, and the application scene of event monitoring of user operation is expanded.
Optionally, after the monitored object is determined, the monitoring module may be further started, and a monitoring mechanism in the monitoring module is initialized, so as to perform event monitoring on the user operation in the monitored object through the monitoring mechanism in the monitoring module.
Optionally, the user operation may include at least one of a mouse click event, a keyboard input event, a mouse slide event, a mouse wheel scroll event, and a screen touch event.
The mouse click event may be an operation of clicking a mouse by a user. The key input event may be an operation of a user inputting data through a key pad. The mouse sliding event may be an operation of a user sliding a mouse, that is, an event of a mouse cursor sliding in the monitored object. The mouse wheel scroll event may be a user operation to scroll the mouse wheel. The screen touch event may be an operation in which a user touches the screen.
Specifically, when the monitoring module monitors an event of a user operation, the monitoring module may monitor at least one event of a mouse click event, a keyboard input event, a mouse slide event, a mouse wheel scroll event, and a screen touch event.
According to the technical scheme, various operation events included in user operation are provided, and the user operation can be monitored more comprehensively, so that the application scene of the method is expanded.
S220, performing third idle timing through the timing module, and determining third current idle time according to a third idle timing result.
Wherein the third idle timer may be another timer operation that records the idle time. The third idle timing result may be a result obtained by the third idle timing. The third current idle time may be an idle time obtained by the third idle timer.
In the embodiment of the present invention, when the client is successfully connected, the timing module may perform a third idle timing, so as to determine a third current idle time according to a third idle timing result.
It should be noted that, in the embodiment of the present invention, the order of S210 and S220 is not limited, that is, S210 and S220 may be performed synchronously.
S230, determining whether the monitoring module monitors user operation; if yes, go to S240; otherwise, S280 is executed.
In the embodiment of the present invention, after the monitoring module monitors the event of the user operation and the timing module performs the third idle timing, it may be further determined whether the monitoring module monitors the user operation.
Specifically, if the monitoring module monitors the user operation, it may be further determined whether the user operation is an effective user operation. If the monitoring module does not monitor the user operation, it may be further determined whether the third current idle time exceeds a first preset time threshold.
S240, determining whether the user operation is effective operation of the user; if yes, go to S250; otherwise, return to execute S210.
In the embodiment of the present invention, after determining that the monitoring module monitors the user operation, it may be further determined whether the user operation is a valid user operation. Specifically, if the user operation is the user valid operation, the monitoring module may further send a reset timing instruction to the timing module, so that the timing module updates the third current idle time to the preset time value according to the reset timing instruction, and the timing module performs the first idle timing. If the user operation is the invalid user operation, the operation of monitoring the event of the user operation through the monitoring module can be returned to be executed.
According to the technical scheme, the supplementary processing strategy for determining that the user operation is the user invalid operation is added, namely when the user operation is the user invalid operation, the monitoring module continues to monitor the event of the user operation, so that the event throttling of the user operation event is realized, and the resource and performance waste caused by triggering the event at a high frequency can be effectively avoided.
Optionally, the method may further include: when the monitoring module monitors the operation of the first user, the timing module is used for carrying out second idle timing; under the condition that the monitoring module monitors the operation of a second user, determining second current idle time according to a second idle timing result; determining the second user operation as the effective user operation under the condition that the second current idle time is determined to reach a second preset time threshold; and under the condition that the second current idle time is determined not to reach the second preset time threshold, determining the second user operation as the invalid user operation.
The first user operation may be any user operation. The second idle timer may be another timer operation that records the idle time. The second user operation may be one that occurs after the first user operation. The second idle timing result may be a result obtained by the second idle timing. The second current idle time may be an idle time obtained by the second idle timer. The second preset time threshold may be another preset time threshold, for example, n seconds, n minutes, or the like, which is not limited in this embodiment of the present invention, where n may be any number of 1, 2, 3, or the like.
Specifically, when the monitoring module monitors the first user operation, the timing module performs second idle timing, and when the monitoring module monitors the second user operation, determines second current idle time according to a second idle timing result to determine whether the second current idle time reaches a second preset time threshold, so that when the second current idle time reaches the second preset time threshold, the second user operation is determined as user valid operation, and when the second current idle time does not reach the second preset time threshold, the second user operation is determined as user invalid operation.
It is to be understood that if the second user operation is not monitored after the monitoring module monitors the first user operation, indicating that no user operation event occurs, the second current idle time may be determined at any time, so that the client connection is disconnected when the second current idle time exceeds the first preset time threshold.
According to the technical scheme, a specific implementation mode for determining the effective operation and the ineffective operation of the user is provided, so that resource and performance waste caused by triggering the user operation for multiple times in a short time is avoided.
And S250, sending a reset timing instruction to the timing module through the monitoring module.
And S260, updating the third current idle time to a preset time value through the timing module according to the reset timing instruction.
The reset timing command may be a command to perform timing resetting. The preset time value may be a preset time value, for example, 0, or other values, which is not limited in the embodiment of the present invention.
In the embodiment of the present invention, after it is determined that the user operation is the valid user operation, a reset timing instruction may be further sent to the timing module through the monitoring module, so that the timing module updates the third current idle time to the preset time value according to the reset timing instruction.
According to the technical scheme, the monitoring module sends the reset timing instruction to the timing module, and the timing module updates the third current idle time to the preset time value according to the reset timing instruction, so that the timing module can start new idle timing, and the accuracy of idle timing is improved.
S270, performing first idle timing through the timing module, determining first current idle time according to a first idle timing result, and disconnecting the client connection under the condition that the first current idle time exceeds a first preset time threshold.
It should be noted that, if the first current idle time does not exceed the first preset time threshold, the monitoring module may continue to monitor the event of the user operation. If the monitoring module does not monitor the user operation, it may be determined at any time whether the first current idle time exceeds a first preset time threshold. If the monitoring module monitors the user operation, whether the user operation is the user effective operation can be further determined, and when the user operation is the user effective operation, a timing resetting instruction is sent to the timing module through the monitoring module, so that idle timing is carried out again through the timing module.
S280, under the condition that the third current idle time exceeds the first preset time threshold, disconnecting the client.
In the embodiment of the invention, when the monitoring module does not monitor the user operation, whether the third current idle time exceeds a first preset time threshold is determined, so that the client connection is disconnected when the third current idle time exceeds the first preset time threshold. It can be understood that, if the monitoring module does not monitor the user operation, which indicates that the monitored object is in the idle state, when the time that the monitored object is in the idle state, that is, the third current idle time, exceeds the first preset time threshold, the client connection may be disconnected.
It should be noted that, if the third current idle time does not exceed the first preset time threshold, the operation of performing event monitoring on the user operation through the monitoring module may be returned to be executed.
According to the technical scheme, a supplementary processing strategy that the monitoring module does not monitor the user operation is added, namely, the timing module is used for performing third idle timing when the client is successfully connected, so that the client is disconnected when the monitoring module does not monitor the user operation and the third current idle time exceeds the first preset time threshold, and the connection can be disconnected when the user operation does not exist, and therefore, the implementation of an overtime mechanism is guaranteed.
According to the technical scheme of the embodiment, when the client is determined to be successfully connected, event monitoring is carried out on user operation through the monitoring module, third idle timing is carried out through the timing module, and third current idle time is determined according to a third idle timing result, so that the client connection is disconnected when the user operation is not monitored by the monitoring module and the third current idle time exceeds a first preset time threshold. When the user operation monitored by the monitoring module is effective operation of the user, a reset timing instruction is sent to the timing module through the monitoring module, the third current idle time is updated to be a preset time value through the timing module according to the reset timing instruction, first idle timing is carried out through the timing module, and the first current idle time is determined according to a first idle timing result, so that the client connection is disconnected when the first current idle time exceeds a first preset time threshold value, the problem that the server burden pressure is too high in an overtime mechanism of the existing page idle detection method is solved, the participation of the server can be reduced, the resource waste of the server is avoided, the server pressure is reduced, and the server performance is improved.
EXAMPLE III
In order to make those skilled in the art better understand the page idle detection method of the present embodiment, fig. 3 is an exemplary flowchart of a page idle detection method provided by a third embodiment of the present invention, and as shown in fig. 3, the page idle detection method may specifically include the following contents:
(1) After detecting that the user logs in successfully, setting a timeout threshold (namely a first preset time threshold) and monitoring the object. It will be appreciated that the user enters a username and password for user login. If it is a new user, the user login may be performed after the user registration is completed.
(2) After the timeout threshold time and the monitored object are set, the monitoring module (i.e. module one) and the timing module (i.e. module two) are started. It is understood that the listening module and the timing module may be performed simultaneously. The monitoring module can be used for monitoring whether the operation of the user is a valid operation. The timing module may be configured to determine whether a current accumulated idle time exceeds a timeout threshold.
(3) The monitoring module is started, firstly, the monitoring mechanism is initialized, and the user operation is monitored after the initialization. And when the monitoring mechanism monitors that the user performs the user operation, judging whether the user is the effective operation. And if the operation is not the effective operation of the user, returning to continue monitoring the user operation. If the operation is valid, a timing resetting instruction is sent to the timing module, so that the timing module can clearly count the current time and start new idle time counting. It can be understood that the event throttling mechanism of the monitoring module is triggered (i.e. whether the user operation is the effective operation of the user is determined), so as to prevent multiple triggers of resetting the timing instruction caused by multiple user operations executed by the user in a short time, thereby reducing the system pressure.
(4) When the monitoring module is started, the timing module is started, timing is started from 0, and a timing mechanism is triggered every 1 second. When the timing mechanism is triggered, the idle time at this time is the last recorded time +1. And if a reset timing instruction sent by the monitoring module is received, clearing the current idle time and starting new timing from 0 again.
(5) It is determined whether the current accumulated idle time exceeds a set timeout threshold. It should be noted that, if the idle time unit is different from the timeout threshold unit, the time data needs to be processed in units in a unified manner before determining whether the currently accumulated idle time exceeds the set timeout threshold.
(6) If the current accumulated idle time exceeds the timeout threshold, a prompt message may be generated to prompt the system to recognize that the current user has automatically disconnected because no operation has been performed for a long time, and disconnect after 1 second. If the current accumulated idle time does not exceed the timeout threshold, returning to continuously determine whether the current accumulated idle time exceeds the set timeout threshold.
According to the technical scheme, participation of the server is not needed, the overtime mechanism is realized only through the client, and huge pressure of the server is reduced; by adding an event throttling mechanism, the waste of performance and resources caused by triggering a reset timing event for multiple times in a short time is prevented; by monitoring various user operations, the user operations can be monitored at the mobile phone end, and the application scene of the timeout mechanism is expanded.
Example four
Fig. 4 is a schematic diagram of a page idle detection apparatus according to a fourth embodiment of the present invention, and as shown in fig. 4, the apparatus includes: a listening module 410 and a timing module 420, wherein:
a monitoring module 410, configured to perform event monitoring on a user operation when it is determined that the client connection is successful;
a timing module 420, configured to perform a first idle timing when it is determined that the user operation is a valid user operation; the user effective operation is a user operation with an operation frequency smaller than a preset operation frequency threshold;
the timing module 420 is further configured to determine a first current idle time according to the first idle timing result, and disconnect the client connection when the first current idle time exceeds a first preset time threshold.
According to the technical scheme, when the client is determined to be successfully connected, event monitoring is carried out on user operation through the monitoring module, when the user operation is determined to be effective operation of the user, first idle timing is carried out through the timing module, first current idle time is determined according to a first idle timing result, the client is disconnected when the first current idle time exceeds a first preset time threshold, the problem that server burden pressure is overlarge in an overtime mechanism of an existing page idle detection method is solved, server participation can be reduced, resource waste of the server is avoided, meanwhile, the pressure of the server is reduced, and therefore the performance of the server is improved.
Optionally, the page idle detection apparatus may be further configured to: and returning to execute the operation of monitoring the event of the user operation through the monitoring module under the condition that the user operation is determined to be the invalid operation of the user.
Optionally, the page idle detection apparatus may be further configured to: when the monitoring module monitors the operation of the first user, the timing module is used for carrying out second idle timing; under the condition that the monitoring module monitors the operation of a second user, determining second current idle time according to a second idle timing result; determining the second user operation as the effective user operation under the condition that the second current idle time is determined to reach a second preset time threshold; and under the condition that the second current idle time is determined not to reach the second preset time threshold, determining the second user operation as the invalid user operation.
Optionally, the page idle detection apparatus may be further configured to: under the condition that the client is determined to be successfully connected, performing third idle timing through the timing module, and determining third current idle time according to a third idle timing result; and under the condition that the monitoring module does not monitor the user operation and the third current idle time exceeds a first preset time threshold, disconnecting the client.
Optionally, the monitoring module 410 may be further specifically configured to: sending a timing resetting instruction to the timing module; accordingly, the timing module 420 may be specifically configured to: and updating the third current idle time to a preset time value according to the reset timing instruction.
Optionally, the monitoring module 410 may be further specifically configured to: determining a monitoring object; the monitoring object comprises a browser page and/or an application page; and performing event monitoring on the user operation in the monitored object through the monitoring module.
Optionally, the user operation may include at least one of a mouse click event, a keyboard input event, a mouse slide event, a mouse wheel scroll event, and a screen touch event.
The page idle detection device provided by the embodiment of the invention can execute the page idle detection method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
FIG. 5 illustrates a schematic diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the page free detection method.
In some embodiments, the page idle detection method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the page free detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the page free detection method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for detecting page idleness is characterized by comprising the following steps:
under the condition that the client is determined to be successfully connected, event monitoring is carried out on user operation through a monitoring module;
under the condition that the user operation is determined to be effective, performing first idle timing through a timing module; the user effective operation is a user operation with an operation frequency smaller than a preset operation frequency threshold;
and determining first current idle time according to the first idle timing result, and disconnecting the client connection under the condition that the first current idle time exceeds a first preset time threshold.
2. The method of claim 1, further comprising:
and returning to execute the operation of monitoring the event of the user operation through the monitoring module under the condition that the user operation is determined to be invalid.
3. The method of claim 2, further comprising:
under the condition that the monitoring module monitors the operation of a first user, performing second idle timing through the timing module;
under the condition that the monitoring module monitors the operation of a second user, determining second current idle time according to a second idle timing result;
determining the second user operation as the user effective operation under the condition that the second current idle time is determined to reach a second preset time threshold;
and under the condition that the second current idle time is determined not to reach a second preset time threshold, determining the second user operation as the invalid user operation.
4. The method of claim 1, further comprising:
under the condition that the client is determined to be successfully connected, performing third idle timing through the timing module, and determining third current idle time according to a third idle timing result;
and disconnecting the client connection under the condition that the monitoring module does not monitor the user operation and the third current idle time exceeds the first preset time threshold.
5. The method of claim 4, wherein prior to said first idle timing by the timing module, further comprising:
sending a timing resetting instruction to the timing module through the monitoring module;
and updating the third current idle time to a preset time value through the timing module according to the reset timing instruction.
6. The method according to claim 1, before the event listening for the user operation by the listening module, further comprising:
determining a monitoring object; the monitoring object comprises a browser page and/or an application page;
the event monitoring is carried out on the user operation through the monitoring module, and the event monitoring comprises the following steps:
and performing event monitoring on the user operation in the monitored object through the monitoring module.
7. The method of any of claims 1-6, wherein the user operation comprises at least one of a mouse click event, a keyboard entry event, a mouse slide event, a mouse wheel scroll event, and a screen touch event.
8. A page idle detection device, comprising:
the monitoring module is used for monitoring events of user operation under the condition that the connection of the client is determined to be successful;
the timing module is used for carrying out first idle timing under the condition that the user operation is determined to be effective operation of the user; the user effective operation is a user operation with an operation frequency smaller than a preset operation frequency threshold;
and the timing module is also used for determining first current idle time according to the first idle timing result and disconnecting the client connection under the condition that the first current idle time exceeds a first preset time threshold.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the page free detection method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the page idle detection method of any one of claims 1-7 when executed.
CN202211397203.XA 2022-11-09 2022-11-09 Page idle detection method and device, electronic equipment and storage medium Pending CN115630253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211397203.XA CN115630253A (en) 2022-11-09 2022-11-09 Page idle detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211397203.XA CN115630253A (en) 2022-11-09 2022-11-09 Page idle detection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115630253A true CN115630253A (en) 2023-01-20

Family

ID=84908023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211397203.XA Pending CN115630253A (en) 2022-11-09 2022-11-09 Page idle detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115630253A (en)

Similar Documents

Publication Publication Date Title
CN109936613B (en) Disaster recovery method and device applied to server
CN111177513B (en) Determination method and device of abnormal access address, electronic equipment and storage medium
CN113742174B (en) Cloud mobile phone application monitoring method and device, electronic equipment and storage medium
WO2018161609A1 (en) Broadcast receiver control method and device, mobile terminal and storage medium
CN106648916B (en) Method and device for reporting pedometer message
CN108011860B (en) Method, device and terminal for processing broadcast message
CN113760982A (en) Data processing method and device
CN114554110B (en) Video generation method, device, electronic equipment and storage medium
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN117040799A (en) Page interception rule generation and page access control method and device and electronic equipment
CN115630253A (en) Page idle detection method and device, electronic equipment and storage medium
CN113676531B (en) E-commerce flow peak clipping method and device, electronic equipment and readable storage medium
CN115543416A (en) Configuration updating method and device, electronic equipment and storage medium
CN113747423B (en) Cloud mobile phone state synchronization method, device, equipment, storage medium and program product
CN113225265B (en) Flow control method, device, equipment and computer storage medium
CN114500105A (en) Network packet interception method, device, equipment and storage medium
CN114051057A (en) Method and device for determining queuing time of cloud equipment, electronic equipment and medium
CN116719621B (en) Data write-back method, device, equipment and medium for mass tasks
CN114237752B (en) Push page display method and device, electronic equipment and storage medium
CN114006902B (en) Cloud mobile phone restarting method, device, equipment and storage medium
CN108595281B (en) Moving object processing method, moving object processing device, storage medium and terminal
CN113553074B (en) Applet distribution control method, device, electronic equipment and storage medium
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN117785403A (en) Heartbeat task execution device for equipment, electronic equipment and storage medium
CN117194113A (en) Container snapshot generation method, device, equipment and medium

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