A method and device for determining page dwell time
By monitoring page loading and routing changes events, the page stay time is calculated, which solves the problem of inaccurate stay time when content changes in single-page application mode, improves the accuracy of stay time, and is conducive to user portrait and page optimization.
Patent Information
- Application Number
- CN202010269384.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-08
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2040-04-08
AI Technical Summary
In a single-page application mode page, the page is not overloaded when the content changes, resulting in the existing method of determining the length of the page being stayed inaccurate enough.
Listen to the loading event and routing change event of the page, and calculate the length of the page by recording the first time of the loading event and the second time of the routing change event.
Improves the accuracy of the single-page application mode page stay time, helping to more accurately build user portraits and optimize pages.
Smart Images

Figure CN113496003B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for determining the dwell time of a page. Background Art
[0002] The length of time a user stays on a page can reflect the degree of user interest in the page. It is an important indicator of web page analysis and is of great significance for websites to build user portraits and optimize pages.
[0003] Currently, the following method is usually used to determine the page dwell time: the start time of the page is recorded when the page is loaded, and when the page is closed, the end time of the page is recorded, and the time difference between the end time and the start time is used as the page dwell time.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] In a single-page application mode page, the content of the page can be updated without closing and reloading the page. That is, when the content of the single-page application mode page changes, the page may not be reloaded. Therefore, when determining the page dwell time by the above method, the determined page dwell time will be inaccurate. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides a method and device for determining the length of time a page stays, and when a loading event of a first page is monitored, a first time of the loading event is determined. When the first page is in a single-page application mode, a route change event of the first page is monitored, and when a route change event is monitored, a second time corresponding to the route change event is determined. Then, based on the first time and the second time, the length of time the first page stays is determined. Since when the content of a page in a single-page application mode changes, although page unloading and page reloading events may not occur, route changes will occur. Therefore, by monitoring route change events, the accuracy of the length of time a page in a single-page application mode stays can be improved.
[0007] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for determining the dwell time of a page is provided.
[0008] A method for determining a page dwell time according to an embodiment of the present invention includes: monitoring a loading event of a first page, and when the loading event is monitored, determining a first time corresponding to the loading event;
[0009] Determine whether the mode of the first page is a single-page application mode, and if so, listen to a route change event corresponding to the first page;
[0010] When the route change event is monitored, determining a second time corresponding to the route change event;
[0011] A duration of staying on the first page is determined according to the first time and the second time.
[0012] Optionally, when the route change event is monitored, the method further includes:
[0013] Determining a second page according to the routing change event;
[0014] Determine whether the content of the second page is the same as the content of the first page, and if not, determine the duration of the stay of the first page according to the first time and the second time.
[0015] Optionally, it also includes:
[0016] When the content of the second page is the same as the content of the first page, the route change event is ignored.
[0017] Optionally, it also includes:
[0018] Listening to the uninstall event corresponding to the first page;
[0019] When the route change event is not monitored and the uninstall event is monitored, determining a third time corresponding to the uninstall event;
[0020] The duration of staying on the first page is determined according to the third time and the first time.
[0021] Optionally, when the mode of the first page is a multi-page application mode, the stay time of the first page is determined according to a third time of the unloading event and the first time.
[0022] Optionally, determining whether the mode of the first page is a single-page application mode includes:
[0023] Acquire configuration information, the configuration information including: modes corresponding to one or more pages;
[0024] According to the configuration information, it is determined whether the mode of the first page is a single-page application mode.
[0025] Optionally, the configuration information further includes: routes corresponding to the one or more pages; and determining the second page according to the route change event includes:
[0026] A second page corresponding to the route change event is determined according to the route corresponding to the route change event and the configuration information.
[0027] To achieve the above objective, according to another aspect of an embodiment of the present invention, a device for determining the dwell time of a page is provided.
[0028] A device for determining page dwell time according to an embodiment of the present invention comprises: a loading event monitoring module, a mode determination module, a routing event monitoring module and a dwell time determination module; wherein:
[0029] The loading event monitoring module is used to monitor the loading event of the first page, and when the loading event is monitored, determine the first time corresponding to the loading event;
[0030] The mode determination module is used to determine whether the mode of the first page is a single-page application mode, and if so, trigger the routing monitoring module;
[0031] The route monitoring module is used to monitor the route change event corresponding to the first page, and when the route change event is monitored, determine the second time corresponding to the route change event;
[0032] The dwell time determination module is used to determine the dwell time of the first page according to the first time and the second time.
[0033] Optionally, the route monitoring module is used to determine the second page according to the route change event when monitoring the route change event; determine whether the content of the second page is the same as the content of the first page, and if not, trigger the stay duration determination module.
[0034] Optionally, it also includes: uninstalling the event monitoring module; wherein,
[0035] The uninstall event monitoring module is used to monitor the uninstall event corresponding to the first page; when the route change event is not monitored and the uninstall event is monitored, determine the third time corresponding to the uninstall event and trigger the stay duration determination module;
[0036] The dwell time determination module is configured to determine a dwell time of the first page according to the third time and the first time.
[0037] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for determining the dwell time of a page is provided.
[0038] An electronic device for determining the length of time a page stays in an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a method for determining the length of time a page stays in an embodiment of the present invention.
[0039] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.
[0040] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a method for determining a page dwell time according to an embodiment of the present invention is implemented.
[0041] An embodiment of the above invention has the following advantages or beneficial effects: when a loading event of a first page is monitored, the first time of the loading event is determined. When the first page is in a single-page application mode, a route change event of the first page is monitored, and when a route change event is monitored, a second time corresponding to the route change event is determined. Then, based on the first time and the second time, the dwell time of the first page is determined. Since when the content of a page in a single-page application mode changes, although page unloading and page reloading events may not occur, route changes will occur. Therefore, by monitoring route change events, the accuracy of the dwell time of a page in a single-page application mode can be improved.
[0042] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0044] Figure 1 is a schematic diagram of main steps of a method for determining page dwell time according to an embodiment of the present invention;
[0045] Figure 2 is a schematic diagram of main steps of a method for determining a page dwell time in a single-page application mode according to an embodiment of the present invention;
[0046] Figure 3 is a schematic diagram of main steps of another method for determining page dwell time in a single-page application mode according to an embodiment of the present invention;
[0047] Figure 4 is a schematic diagram of main steps of another method for determining page dwell time according to an embodiment of the present invention;
[0048] Figure 5 is a schematic diagram of main modules of an apparatus for determining a page dwell time according to an embodiment of the present invention;
[0049] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0050] Figure 7It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0052] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.
[0053] Figure 1 It is a schematic diagram of main steps of a method for determining page dwell time according to an embodiment of the present invention.
[0054] like Figure 1 As shown, a method for determining the page dwell time in an embodiment of the present invention mainly includes the following steps:
[0055] Step S101: monitoring a loading event of a first page, and when the loading event is monitored, determining a first time corresponding to the loading event.
[0056] The loading event of the first page occurs when the first page is loaded. For example, in response to a loading request of the first page sent by a user, the loading event of the first page occurs. For pages of different formats, different methods can be used to monitor the loading event of the first page. Taking the API in JavaScript as an example, window.onload can be used to monitor the loading event of the first page. When the loading event of the first page is monitored, the first time t1 of the loading event can be recorded.
[0057] Step S102: Determine whether the mode of the first page is a single-page application mode, and if so, monitor a route change event corresponding to the first page.
[0058] Step S103: when the route change event is monitored, determining a second time corresponding to the route change event.
[0059] There are many ways to listen to route change events. For example, you can listen to route change events based on history API and hashHistory. Taking hashHistory as an example, when the route of the first page changes, the hashChange event will be triggered. You can listen to the route change event corresponding to the first page by listening to the hashChange event. In addition, taking hashHistory as an example, when the user triggers the forward or back button on the first page, that is, when the route of the first page changes, the popstate event will be triggered. You can listen to the route change event corresponding to the first page by listening to the popstate event.
[0060] In one embodiment of the present invention, configuration information about one or more pages may be preset. The configuration information includes modes corresponding to one or more pages. For example, the isSingle field is used in the configuration information to indicate whether the page is in single-page application mode. The configuration information may be set on the server side, or may be set in a device for determining the length of time a page stays that implements an embodiment of the present invention. When the configuration information is set on the server side, the device for determining the length of time a page stays in an embodiment of the present invention may obtain the configuration information based on the corresponding server address. When the configuration information is updated, it is only necessary to obtain the updated configuration information based on the server address without changing the code of the device for determining the length of time a page stays.
[0061] After obtaining the configuration information, a page identical to the first page may be determined from the multiple pages of the configuration information, and then, based on the mode of the first page recorded in the configuration information, it may be determined whether the mode of the first page is a single-page application mode. For example, the isSingle field in the configuration information may be parsed to determine whether the mode of the first page is a single-page application mode.
[0062] Furthermore, the configuration information may also include: routes corresponding to the one or more pages; when a route change event corresponding to the first page is monitored, the second page corresponding to the route change event may be determined based on the route corresponding to the route change event and the configuration information.
[0063] When the configuration information includes the route of the page, the fields corresponding to a page in the configuration information may be as shown in Table 1. As shown in Table 1, the reporting address of the server may also be set in the configuration information, so that after the apparatus for determining the page dwell time of the embodiment of the present invention determines the dwell time of the first page, it may automatically report the dwell time of the first page to the server according to the reporting address of the server.
[0064] Table 1
[0065] Key illustrate isSingle Is it a single page application? routes Page Routing server Server reporting address
[0066] It can be understood that what is shown in Table 1 is the field corresponding to a certain page in the configuration information. When the configuration information includes modes and routes corresponding to multiple pages, the mode and route corresponding to each page can be recorded in the form shown in Table 1. Accordingly, the identification information and its fields of each page can be recorded accordingly. When a route change event of the first page is detected, the page identical to the first page can be determined from the configuration information according to the identification information of the page, and the second page corresponding to the route change event can be determined according to the route of the first page recorded in the configuration information.
[0067] Since different routes may correspond to the same page content, in order to further improve the accuracy of the page dwell time, in one embodiment of the present invention, when the route change event is monitored, the second page is determined according to the route change event; it is determined whether the content of the second page is the same as the content of the first page, and if so, the route change event is ignored; otherwise, the dwell time of the first page is determined according to the first time and the second time.
[0068] In order to facilitate the comparison of the content of the first page and the second page, after the first page is loaded, the content of the first page can be stored in the cache. When the second page is determined, the content of the cached first page can be compared with the content of the second page. When the content of the first page is the same as the content of the second page, it means that the route corresponding to the route change event and the route corresponding to the first page loading event correspond to the same page content, which means that the page content viewed by the user has not changed. Therefore, when the content of the first page is the same as the content of the second page, the route change event is ignored to continuously record the length of time the user stays on the same page content, so as to more accurately determine the page stay time, which is conducive to more accurately building user portraits and optimizing pages based on the page stay time.
[0069] In addition, it can be understood that when the content of the first page is different from the content of the second page, the content of the second page can be used to replace the content of the first page stored in the cache. Then, when the route change event of the first page is monitored again, it can be determined whether the route change event has caused a change in the page content based on the page content corresponding to the route change event of the first page monitored again and the content of the second page in the cache, thereby facilitating more accurate determination of the page residence time.
[0070] According to the above embodiment, when the first page is in single-page application mode, Figure 2 As shown, the method for determining the page dwell time provided by the embodiment of the present invention may include the following steps:
[0071] Step S201: monitoring a loading event of a first page, and when the loading event is monitored, determining a first time corresponding to the loading event.
[0072] Step S202: monitoring a route change event corresponding to the first page, and when the route change event is monitored, determining a second page according to the route change event.
[0073] Step S203: Determine whether the content of the second page is the same as the content of the first page, if so, execute step S204, otherwise execute step S205.
[0074] Step S204: Ignore the route change event and execute step S202.
[0075] Step S205: determining a second time corresponding to the route change event, and determining a stay time of the first page according to the first time and the second time.
[0076] Through the above embodiment, when the content of the second page is different from that of the first page, the page dwell time is determined based on the second time corresponding to the route change event and the first time of the page loading time, thereby continuously recording the length of time the user stays on the same page content, thereby more accurately determining the page dwell time, which is further conducive to more accurately building user portraits and optimizing pages based on the page dwell time.
[0077] Step S104: Determine the duration of the first page stay according to the first time and the second time.
[0078] When a route change event of the first page is monitored, the stay time of the first page can be determined to be t2-t1 according to the second time t2 corresponding to the route change event and the first time t1 corresponding to the loading event of the first page.
[0079] In order to improve the efficiency of determining the duration of stay on the first page, when determining the first time t1 corresponding to the loading event of the first page, t1 can be first stored in the cache. After determining the second time t2 corresponding to the route change event of the first page, the duration of stay on the first page can be calculated as t2-t1 based on the cached t1. Moreover, t2 can be used to replace t1 in the cache, so when the route change event of the first page is monitored again, the duration of stay on the first page after the route change can be determined based on the time corresponding to the route change event of the first page monitored again and t2 in the cache.
[0080] In addition, when a user browses the first page of a single-page application mode, the user may close the first page when the page content has not changed. For example, when no route change event occurs, the user leaves the page. In order to accurately determine the duration of the first page, in one embodiment of the present invention, in addition to monitoring the route change event, the uninstall event corresponding to the first page is also monitored; when the route change event is not monitored and the uninstall event is monitored, the third time corresponding to the uninstall event is determined; based on the third time and the first time, the duration of the first page is determined.
[0081] When the user closes or refreshes the page, a page unload event occurs. In one embodiment of the present invention, taking the API in JavaScript as an example, the window.onbeforeunload method can be used to monitor page unload events. When the unload event of the first page is monitored before the route change event occurs, it means that no route change event occurs from the loading of the first page to the unloading of the first page, that is, the user leaves the first page before the content of the first page changes. At this time, the residence time of the first page can be determined according to the third time t3 corresponding to the unloading event and the first time t1 of the page loading event. At this time, the residence time of the first page is t3-t1.
[0082] According to the above embodiment, when the first page is in single-page application mode, Figure 3 As shown, the method for determining the page dwell time provided by the embodiment of the present invention may include the following steps:
[0083] Step S301: monitoring a loading event of a first page, and when the loading event is monitored, determining a first time corresponding to the loading event.
[0084] Step S302: monitoring the route change event and uninstall event corresponding to the first page.
[0085] Step S303: when the route change event is not monitored and the uninstall event is monitored, determining a third time corresponding to the uninstall event.
[0086] Step S304: Determine the duration of the first page stay according to the third time and the first time.
[0087] In addition, after monitoring the route change event of the first page, that is, after the first page is converted to the second page according to the route change event, when monitoring the uninstall event of the second page, the stay time of the second page can be determined according to the third time corresponding to the uninstall event of the second page and the second time corresponding to the route change event of the first page.
[0088] It is understandable that when the mode of the first page is a multi-page application mode, when the page content changes, the page needs to be unloaded and then reloaded, and the dwell time of the first page can be determined by monitoring the unloading event of the first page. Specifically, in one embodiment of the present invention, when the mode of the first page is a multi-page application mode, the dwell time of the first page is determined according to the third time of the unloading event and the first time.
[0089] When the mode of the first page is a multi-page application mode, the unloading event of the first page can also be monitored through window.onbeforeunload. Whenever the content of the first page changes, the current first page needs to be unloaded first, and then the new first page is reloaded. Therefore, the stay time of the first page in the multi-page application mode can be determined by monitoring the unloading event of the first page.
[0090] According to the above embodiment, Figure 4 As shown, the method for determining the page dwell time provided by the embodiment of the present invention may include the following steps:
[0091] Step S401: monitoring a loading event of a first page, and when the loading event is monitored, determining a first time corresponding to the loading event.
[0092] Step S402: Determine whether the mode of the first page is a single-page application mode, if yes, execute steps S403 to S409, otherwise execute step S410.
[0093] Step S403: monitor the route change event and uninstall event corresponding to the first page; when the route change event is not monitored and the uninstall event is monitored, execute step S404; when the uninstall event is not monitored and the route change event is monitored, execute step S405.
[0094] Step S404: determine the third time corresponding to the unloading event, and determine the duration of the stay on the first page according to the third time corresponding to the unloading event and the first time of the loading event; end the current process.
[0095] Step S405: determining a second page according to the route change event.
[0096] Step S406: Determine whether the content of the second page is the same as the content of the first page, if so, execute step S407, otherwise execute step S408.
[0097] Step S407: Ignore the route change event and execute step S403.
[0098] Step S408: Determine a second time corresponding to the route change event, and determine a stay time of the first page according to the second time and the first time corresponding to the loading event.
[0099] Step S409: when the uninstall event of the second page is monitored, the stay time of the second page is determined according to the fourth time corresponding to the uninstall event of the second page and the second time; and the current process ends.
[0100] Step S410: monitoring an uninstall event of the first page, and when the uninstall event is monitored, determining a stay time of the first page according to a fifth time corresponding to the uninstall event.
[0101] According to a method for determining the length of time a page stays in accordance with an embodiment of the present invention, it can be seen that when a loading event of a first page is monitored, the first time of the loading event is determined. When the first page is in a single-page application mode, a route change event of the first page is monitored, and when a route change event is monitored, a second time corresponding to the route change event is determined. Then, based on the first time and the second time, the length of time the first page stays is determined. Since when the content of a page in a single-page application mode changes, although page unloading and page reloading events may not occur, route changes will occur. Therefore, by monitoring route change events, the accuracy of the length of time a page in a single-page application mode stays can be improved.
[0102] Figure 5 4 is a schematic diagram of main modules of an apparatus for determining a page dwell time according to an embodiment of the present invention.
[0103] like Figure 5 As shown, the apparatus 500 for determining the page dwell time of the embodiment of the present invention comprises: a loading event monitoring module 501, a mode determination module 502, a routing event monitoring module 503 and a dwell time determination module 504; wherein,
[0104] The loading event monitoring module 501 is used to monitor the loading event of the first page, and when the loading event is monitored, determine the first time corresponding to the loading event;
[0105] The mode determination module 502 is used to determine whether the mode of the first page is a single-page application mode, and if so, trigger the routing monitoring module;
[0106] The route monitoring module 503 is used to monitor the route change event corresponding to the first page, and when the route change event is monitored, determine the second time corresponding to the route change event;
[0107] The dwell time determining module 504 is configured to determine a dwell time of the first page according to the first time and the second time.
[0108] In one embodiment of the present invention, the routing monitoring module 503 is used to determine the second page according to the routing change event when monitoring the routing change event; determine whether the content of the second page is the same as the content of the first page, and if not, trigger the stay duration determination module 504.
[0109] In one embodiment of the present invention, the route monitoring module 503 is used to ignore the route change event when the content of the second page is the same as the content of the first page.
[0110] In one embodiment of the present invention, the device further includes: an uninstall event monitoring module 505; wherein the uninstall event monitoring module 505 is used to monitor the uninstall event corresponding to the first page; when the route change event is not monitored and the uninstall event is monitored, determine the third time corresponding to the uninstall event, and trigger the stay duration determination module 504;
[0111] The dwell time determination module 504 is configured to determine a dwell time of the first page according to the third time and the first time.
[0112] In one embodiment of the present invention, the dwell time determination module 504 is used to determine the dwell time of the first page according to the third time of the uninstall event and the first time when the mode of the first page is a multi-page application mode.
[0113] In one embodiment of the present invention, the mode determination module 502 is used to obtain configuration information, the configuration information including: modes corresponding to one or more pages; and determine whether the mode of the first page is a single-page application mode according to the configuration information.
[0114] In one embodiment of the present invention, the configuration information further includes: routes corresponding to the one or more pages; the route monitoring module 503 is used to determine the second page corresponding to the route change event according to the route corresponding to the route change event and the configuration information.
[0115] According to a device for determining the dwell time of a page according to an embodiment of the present invention, it can be seen that when a loading event of a first page is monitored, the first time of the loading event is determined. When the first page is in a single-page application mode, a route change event of the first page is monitored, and when a route change event is monitored, a second time corresponding to the route change event is determined. Then, based on the first time and the second time, the dwell time of the first page is determined. Since when the content of a page in a single-page application mode changes, although page unloading and page reloading events may not occur, route changes will occur. Therefore, by monitoring route change events, the accuracy of the dwell time of a page in a single-page application mode can be improved.
[0116] Figure 6 An exemplary system architecture 600 is shown to which the method for determining the dwell time of a page or the apparatus for determining the dwell time of a page according to an embodiment of the present invention can be applied.
[0117] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0118] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0119] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0120] The server 605 may be a server that provides various services, such as a backend management server that provides support for shopping websites browsed by users using the terminal devices 601, 602, and 603. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information and product information) to the terminal device.
[0121] It should be noted that the method for determining the page dwell time provided in the embodiment of the present invention is generally executed by the terminal devices 601 , 602 , 603 , and accordingly, the device for determining the page dwell time is generally arranged in the terminal devices 601 , 602 , 603 .
[0122] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0123] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0124] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0125] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0126] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0127] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be arranged in a processor, for example, may be described as: a processor includes a loading event monitoring module, a mode determination module, a routing event monitoring module and a stay duration determination module. The names of these modules do not constitute a limitation on the modules themselves in certain circumstances, for example, the loading event monitoring module may also be described as a "module for monitoring the loading event of the first page".
[0130] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: monitoring the loading event of the first page, and when the loading event is monitored, determining the first time corresponding to the loading event; determining whether the mode of the first page is a single-page application mode, and if so, monitoring the route change event corresponding to the first page; when the route change event is monitored, determining the second time corresponding to the route change event; and determining the stay time of the first page according to the first time and the second time.
[0131] According to the technical solution of an embodiment of the present invention, when a loading event of a first page is monitored, a first time of the loading event is determined. When the first page is in a single-page application mode, a route change event of the first page is monitored, and when a route change event is monitored, a second time corresponding to the route change event is determined. Then, based on the first time and the second time, the dwell time of the first page is determined. Since when the content of a page in a single-page application mode changes, although page unloading and page reloading events may not occur, route changes will occur. Therefore, by monitoring route change events, the accuracy of the dwell time of a page in a single-page application mode can be improved.
[0132] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for determining the length of time a page stays, characterized in that: include: Monitoring a loading event of a first page, and when the loading event is monitored, determining a first time corresponding to the loading event; Determine whether the mode of the first page is a single-page application mode, and if so, listen to a route change event corresponding to the first page; When the route change event is monitored, determining a second time corresponding to the route change event, and determining a second page according to the route change event; determining whether the content of the second page is the same as the content of the first page; If not, determine the duration of the stay on the first page according to the first time and the second time.
2. The method according to claim 1, characterized in that Also includes: When the content of the second page is the same as the content of the first page, the route change event is ignored.
3. The method according to claim 1, characterized in that Also includes: Listening to the uninstall event corresponding to the first page; When the route change event is not monitored and the uninstall event is monitored, determining a third time corresponding to the uninstall event; The duration of staying on the first page is determined according to the third time and the first time.
4. The method according to claim 3, characterized in that When the mode of the first page is a multi-page application mode, the dwell time of the first page is determined according to a third time of the uninstall event and the first time.
5. The method according to claim 1, characterized in that: The determining whether the mode of the first page is a single-page application mode includes: Acquire configuration information, the configuration information including: modes corresponding to one or more pages; According to the configuration information, it is determined whether the mode of the first page is a single-page application mode.
6. The method according to claim 5, characterized in that The configuration information further includes: routes corresponding to the one or more pages; and determining the second page according to the route change event includes: A second page corresponding to the route change event is determined according to the route corresponding to the route change event and the configuration information.
7. A device for determining the duration of a page stay, characterized in that: include: Loading event monitoring module, mode determination module, route monitoring module and stay duration determination module; wherein, The loading event monitoring module is used to monitor the loading event of the first page, and when the loading event is monitored, determine the first time corresponding to the loading event; The mode determination module is used to determine whether the mode of the first page is a single-page application mode, and if so, trigger the routing monitoring module; The route monitoring module is used to monitor the route change event corresponding to the first page, and when the route change event is monitored, determine the second time corresponding to the route change event, and determine the second page according to the route change event; determine whether the content of the second page is the same as the content of the first page, and if not, trigger the stay time determination module; The dwell time determination module is used to determine the dwell time of the first page according to the first time and the second time.
8. The device according to claim 7, characterized in that Also includes: Uninstall the event monitoring module; among them, The uninstall event monitoring module is used to monitor the uninstall event corresponding to the first page; when the route change event is not monitored and the uninstall event is monitored, determine the third time corresponding to the uninstall event and trigger the stay duration determination module; The dwell time determination module is configured to determine a dwell time of the first page according to the third time and the first time.
9. An electronic device for determining the length of time a page stays, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Webpage staying duration statistic method
CN104850409A
Data statistics method and device for single page application
CN108416038A