Page use duration determination method and device, equipment, medium and program product
By detecting the page switching event update page departure time, and calculating the page usage time with information such as termination timestamps, the problem of inaccurate calculation of page usage time in the prior art is solved and the evaluation accuracy is improved.
Patent Information
- Application Number
- CN202411725619.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, it is poor to determine the usage time of the front-end page, especially when the page is not closed but not used, the calculation time is inaccurate.
By detecting the switching event of the target page, the page departure time is updated; combined with the termination time stamp, the opening time stamp and the page departure time, the page usage time is calculated to avoid the unused time being calculated.
Improve the accuracy of page usage time, avoid miscalculation of unused duration, and enhance the accurate evaluation of page usage behavior.
Smart Images

Figure CN119622137A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method and device for determining page usage duration, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the rapid development of the Internet, Internet companies are paying more and more attention to the refined operation of user groups. For example, they can track various user operations and analyze user behavior based on the tracking data, so as to improve and upgrade products based on user behavior. In current practical applications, the length of time users spend on the front-end page is usually used as a core indicator to evaluate the use effect of the product. The method of determining the length of time the front-end page is used in related technologies has poor accuracy. Summary of the invention
[0003] The present disclosure provides a method and device for determining page usage duration, an electronic device, a computer-readable storage medium, and a computer program product.
[0004] In a first aspect, the present disclosure provides a method for determining page usage duration, comprising: when a target page is loaded, obtaining a start timestamp of the target page; when a switching event of the target page is detected, updating a page leaving duration of the target page according to the switching event, wherein the switching event is used to indicate the switching of the target page between page hiding and page display; when a termination event of terminating the use of the target page is detected, obtaining a termination timestamp of the termination event; and determining the page usage duration of the target page according to the termination timestamp, the start timestamp and the page leaving duration.
[0005] Optionally, the page leaving time of the target page is updated according to the switching event, including: when the switching event is a page hiding event, updating the hiding timestamp of the target page to the first timestamp of the page hiding event, and keeping the page leaving time of the target page unchanged; when the switching event is a page display event, updating the page leaving time of the target page according to the hiding timestamp of the target page and the second timestamp of the page display event.
[0006] Optionally, the page leaving duration of the target page is updated according to the hidden timestamp of the target page and the second timestamp of the page display event, including: determining the time difference between the second timestamp and the hidden timestamp as the current leaving duration; adding the current leaving duration to the recorded page leaving duration to obtain an updated page leaving duration.
[0007] Optionally, the page usage duration of the target page is determined based on the termination timestamp, the start timestamp and the page leaving duration, including: determining the page usage time difference between the termination timestamp and the start timestamp; determining the difference between the page usage time difference and the page leaving duration, and determining the difference as the page usage duration of the target page.
[0008] Optionally, after acquiring the termination timestamp of the termination event, the method further comprises: determining a time difference between the termination timestamp and a first timestamp of the page hiding event when a previous switching event of the termination event is a page hiding event;
[0009] The page usage duration of the target page is determined according to the termination timestamp, the start timestamp and the page leaving duration, including: determining the page usage time difference between the termination timestamp and the start timestamp; updating the page leaving duration of the target page based on the time difference between the termination timestamp and the first timestamp; and determining the difference between the page usage time difference and the updated page leaving duration as the page usage duration of the target page.
[0010] Optionally, obtaining the termination timestamp of the termination event includes: when the termination event is a page closing event, determining the closing timestamp of the page closing event as the termination timestamp; when the termination event is a page refresh event, determining the refresh timestamp of the page refresh event as the termination timestamp.
[0011] In a second aspect, the present disclosure provides a device for determining page usage duration, comprising: a first acquisition module, configured to acquire the start timestamp of the target page when the target page is loaded; an update module, configured to update the page leaving duration of the target page according to the switching event when a switching event of the target page is detected, wherein the switching event is used to indicate the switching of the target page between page hiding and page display; a second acquisition module, configured to acquire the termination timestamp of the termination event when a termination event of terminating the use of the target page is detected; a determination module, configured to determine the page usage duration of the target page according to the termination timestamp, the start timestamp and the page leaving duration.
[0012] In a third aspect, the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for determining the page usage time.
[0013] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned method for determining page usage time when executed by a processor.
[0014] In a fifth aspect, the present disclosure provides a computer program product, which includes a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned method for determining the page usage time.
[0015] The method for determining the page usage duration provided by the embodiment of the present disclosure can determine whether the target page is specifically in a page hiding state or a page display state by detecting the switching event of the target page, so that the page leaving duration of the target page can be updated according to the switching event of the target page, and the page usage duration of the target page can be determined based on the termination timestamp of the termination event of the target page, the opening timestamp of the target page, and the page leaving duration of the target page. It can be achieved that on the basis of determining the page usage duration of the target page based on the termination timestamp and the opening timestamp, the page leaving duration of the target page can be further determined, and the page usage duration of the target page can be determined in combination with the determined page leaving duration, so as to avoid the page leaving duration being calculated in the page usage duration, and improve the accuracy of determining the page usage duration of the target page.
[0016] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 This is a schematic diagram of an application scenario of a method for determining page usage time provided by an embodiment of the present disclosure;
[0019] Figure 2 is a flow chart of a method for determining page usage time provided by an embodiment of the present disclosure;
[0020] Figure 3 is a schematic diagram of a method for determining page usage time provided by an embodiment of the present disclosure;
[0021] Figure 4 is a schematic diagram of another method for determining page usage time provided by an embodiment of the present disclosure;
[0022] Figure 5 A block diagram of a device for determining page usage duration provided by an embodiment of the present disclosure;
[0023] Figure 6 A block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0025] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0026] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0027] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0028] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0029] In the technical solution disclosed in this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution complies with relevant national laws and regulations (for example, the "Information Security Technology Personal Information Security Specification", etc.). For example: corresponding prescribed measures are taken for personal information access control; prescribed restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; when using personal information, clear identity orientation is eliminated to avoid precise positioning of specific individuals.
[0030] With the rapid development of the Internet, Internet companies are paying more and more attention to the refined operation of user groups in order to improve product service levels and reduce operating costs. For example, they can track various user operations and analyze user behavior based on tracking data, so as to improve and upgrade products based on user behavior. In current practical applications, the length of time users spend on the front-end page is usually used as the core indicator to evaluate the use effect of the product.
[0031] The method for calculating the usage time of the front-end page is often determined by the opening, closing and refreshing time of the front-end page. Although this method can be used to calculate the usage time of the front-end page, the time spent by the user on switching windows, hiding the browser, etc. before closing or refreshing the page will also be counted in the usage time of the front-end page, thereby reducing the accuracy of calculating the usage time of the front-end page.
[0032] Based on this, the embodiments of the present disclosure provide a method for determining page usage duration, an apparatus for determining page usage duration, an electronic device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0033] The method for determining the page usage duration according to the embodiment of the present disclosure can be performed by an electronic device such as a terminal device or a server, and the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The server can be an independent physical server, a server cluster composed of multiple physical servers, or a cloud server capable of cloud computing. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory.
[0034] See also Figure 1 , Figure 1 The following is a schematic diagram showing an application scenario of a method for determining page usage duration according to an embodiment of the present disclosure. Figure 1 As shown, the user opens two browser pages, Page 1 and Page 2, and uses Page 1 first, and switches to Page 2 without closing Page 1. While the user is using Page 2, although Page 1 is not closed, Page 1 is not used by the user either. Therefore, in determining the page usage time of Page 1, the time when Page 1 is not closed and not used cannot be calculated into the usage time of Page 1. If it is calculated into the usage time, the determined page usage time of Page 1 will be inaccurate.
[0035] Based on this, in the method for determining the page usage duration provided by the present disclosure, the page leaving duration of the page is determined during the period when the page is not closed, that is, the duration when the page is not used by the user. After obtaining the opening timestamp and the termination timestamp of the page, the time difference between the termination timestamp and the opening timestamp is determined, and then based on the time difference and the page leaving duration, the difference between the time difference and the page leaving duration is calculated, and the calculated difference is determined as the actual usage duration of the page. Therefore, in the process of determining the page usage duration of the page, the duration when the page is not closed and not used can be filtered out, thereby improving the accuracy of determining the page usage duration of the page.
[0036] The following is a detailed explanation of the method for determining the page usage duration provided by the embodiment of the present disclosure.
[0037] See also Figure 2 , Figure 2 A flow chart of a method for determining page usage duration provided according to an embodiment of the present disclosure is shown, which specifically includes the following steps:
[0038] Step 202: When the target page is loaded, obtain the opening timestamp of the target page.
[0039] The method for determining the page usage duration provided by the embodiments of the present disclosure can be specifically applied to browsers or any other application that can be used to browse pages. Among them, the target page refers to any page that needs to determine the page usage duration, such as a browser page, a shopping page, and the like. The page usage duration refers to the duration for which the target page is actually used, which can be specifically understood as the duration for which the target page is visible to the user. The start timestamp refers to the timestamp when the target page is loaded; the end timestamp refers to the timestamp when the target page is terminated, which can specifically include the timestamp when the target page is closed, or the timestamp when the target page is refreshed.
[0040] Specifically, after the target page is loaded, the browser or other application obtains the current timestamp of the target page, and determines the obtained current timestamp as the opening timestamp of the target page. For example, if the target page is loaded at 09:00:30, the opening timestamp of the target page is 09:00:30.
[0041] Step 204: when a switching event of the target page is detected, updating the page leaving time length of the target page according to the switching event.
[0042] After obtaining the opening timestamp of the target page, the switching event of the target page can be detected through the native event (visibilitychange) provided by the browser to determine whether the target page is switched after it is opened.
[0043] Among them, the switching event is used to indicate the switching of the target page between page hiding and page display, and specifically includes the page hiding event and page display event corresponding to the target page. The page hiding event is used to indicate that the target page is in a hidden state, for example, the target page is switched, the target page is minimized, etc.; the page display event is used to indicate that the target page is in a displayed state, that is, the target page is visible. The page leaving duration refers to the duration that the target page is in a hidden state.
[0044] Specifically, after obtaining the opening timestamp of the target page, the switching event of the target page is detected. When a switching event is detected, the page leaving time of the target page can be updated according to the switching event, so that the page usage time of the target page can be determined according to the updated page leaving time in the subsequent process.
[0045] In a specific implementation provided by the present disclosure, updating the page leaving time of the target page according to the switching event includes:
[0046] In the case where the switching event is a page hiding event, updating the hiding timestamp of the target page to the first timestamp of the page hiding event, and keeping the page leaving time length of the target page unchanged;
[0047] In the case where the switching event is a page display event, the page leaving duration of the target page is updated according to the hiding timestamp of the target page and the second timestamp of the page display event.
[0048] The hidden timestamp refers to the start timestamp of the target page being in the hidden state. The first timestamp refers to the timestamp of the page hiding event; and the second timestamp refers to the timestamp of the page display event.
[0049] Specifically, when a switching event of the target page is detected, it is determined that the switching event is specifically a page hiding event or a page display event. If the switching event is a page hiding event, it means that the target page is initially in a hidden state. At this time, the hidden timestamp of the target page can be updated to the timestamp of the occurrence of the page hiding event, that is, the first timestamp; if the switching event is a page display event, it means that the target page is initially in a display state. At this time, the page leaving time of the target page can be updated according to the hidden timestamp of the target page and the timestamp of the occurrence of the page display event, that is, the second timestamp. Furthermore, according to the hidden timestamp of the target page and the second timestamp of the page display event, the implementation method of updating the page leaving time is specifically as follows:
[0050] In a specific implementation provided by the present disclosure, updating the page leaving time of the target page according to the hidden timestamp of the target page and the second timestamp of the page display event includes:
[0051] Determine the time difference between the second timestamp and the hidden timestamp as the current leaving duration;
[0052] The current leaving time is added to the recorded page leaving time to obtain an updated page leaving time.
[0053] In actual applications, multiple page display events and page hiding events may occur before the target page is closed. Therefore, the duration that the target page is in a hidden state may be counted and updated.
[0054] The current leaving time refers to the time during which the current target page is in a hidden state, specifically, the time difference between the second timestamp and the hidden timestamp.
[0055] Specifically, when the switching event is detected as a page display event, it means that the target page was in a hidden state before the page display event occurred. Therefore, it is necessary to determine the duration of the target page being in a hidden state before the page display event. Determine the time difference between the second timestamp of the page display event and the hidden timestamp of the target page, that is, the current leaving duration of the target page, obtain the recorded page leaving duration, and add the determined current leaving duration to the recorded page leaving duration to obtain the updated page leaving duration.
[0056] It should be noted that, in the embodiment provided by the present disclosure, the hidden timestamp of the target page is initialized to 0. When a page hiding event is detected, the hidden timestamp is updated to the first timestamp of the page hiding event. When a page display event is detected, if the hidden timestamp of the target page is greater than 0, it means that the target page is switched from a hidden state to a displayed state. At this time, the page leaving time of the target page can be updated based on the above method. After updating the page leaving time of the target page, the hidden timestamp of the target page can be reset to 0. If the hidden timestamp of the target page is 0, it means that the target page has been in a displayed state. At this time, there is no need to update the page leaving time of the target page.
[0057] In actual applications, the above process of updating the page leaving time of the target page can be executed by the native API (document.hidden) provided by the browser, and its execution logic code is as follows:
[0058] document.addEventListener('visibilitychange',function(){
[0059] if(document.hidden){
[0060] leaveStartTime=new Date().getTime();
[0061] }else if(leaveStartTime>0){
[0062] leaveTime+=(new Date().getTime()-leaveStartTime);
[0063] leaveStartTime=0;
[0064] }
[0065] })
[0066] Among them, leaveStartTime is specifically the hidden timestamp of the target page, and leaveTime is specifically the length of time the page is left.
[0067] The present disclosure detects the switching event of the target page through the native event provided by the browser, and can specifically detect whether the switching event is a page hiding event or a page display event. Therefore, the page leaving time of the target page can be further updated according to the page hiding event and the page display event.
[0068] Step 206: When a termination event for terminating the use of the target page is detected, a termination timestamp of the termination event is obtained.
[0069] In actual applications, if a termination event is detected for a target page, it means that the target page is terminated. When the termination event for the target page is detected, the termination timestamp of the termination event is obtained.
[0070] In a specific implementation provided by the present disclosure, obtaining the termination timestamp of the termination event includes:
[0071] In the case where the termination event is a page closing event, determining the closing timestamp of the page closing event as the termination timestamp;
[0072] In the case that the termination event is a page refresh event, the refresh timestamp of the page refresh event is determined as the termination timestamp.
[0073] Among them, the page close event is used to indicate that the target page is closed; the page refresh event is used to indicate that the target page is refreshed. The close timestamp refers to the timestamp when the page close event occurs; the refresh timestamp refers to the timestamp when the page refresh event occurs.
[0074] Specifically, when a termination event of the target page is detected, if the termination event is a page closing event, the closing timestamp of the page closing event is obtained, and the closing timestamp is determined as the termination timestamp of the target page; if the termination event is a page refresh event, the refresh timestamp of the page refresh event is obtained, and the refresh timestamp is determined as the termination timestamp of the target page.
[0075] Step 208: Determine the page usage time of the target page according to the termination timestamp, the start timestamp and the page leaving time.
[0076] After obtaining the end timestamp, the start timestamp and the page leaving time of the target page, the page use time of the target page can be determined according to the end timestamp, the start timestamp and the page leaving time.
[0077] Based on this, in a specific implementation provided by the present disclosure, determining the page usage duration of the target page according to the termination timestamp, the start timestamp and the page leaving duration includes:
[0078] Determine a page usage time difference between the end timestamp and the start timestamp;
[0079] The difference between the page usage time difference and the page leaving time is determined, and the difference is determined as the page usage time of the target page.
[0080] The page usage time difference refers to the time difference between the end timestamp and the start timestamp.
[0081] Specifically, the page usage time difference between the termination timestamp and the start timestamp is determined. Since there will be a page leaving time before the target page is terminated, it is necessary to further determine the difference between the page usage time difference and the page leaving time, and determine the determined difference as the page usage time of the target page. The specific execution logic code is as follows:
[0082] document.addEventListener('beforeunload',function(){
[0083] var endTime=new Date().getTime();
[0084] var stayTime=endTime–startTime–leaveTime;
[0085] })
[0086] Among them, endTime is specifically the end timestamp, and stayTime is specifically the start timestamp.
[0087] See also Figure 3 , Figure 3 A schematic diagram of a method for determining page usage duration according to an embodiment of the present disclosure is shown. Figure 3 The method for determining the page usage duration provided by the embodiment of the present disclosure is explained by taking the example of FIG. Figure 3As shown, 0 is the start timestamp of the target page, 50 is the end timestamp of the target page's end event, and during the period from 0 to 50 minutes, a page hide event and a page display event are detected on the target page, and the first timestamp of the page hide event is specifically 10 minutes, and the second timestamp of the page display event is specifically 25 minutes. It can be known that the target page is in the page display state during the period from 0 to 10 minutes, in the page hide state during the period from 10 to 25 minutes, and in the page display state again during the period from 25 to 50 minutes.
[0088] After the target page is loaded, the opening timestamp of the target page can be obtained as 0 minutes; it is detected that a page hiding event occurs at 10 minutes on the target page, the first timestamp of the page hiding event is determined to be 10 minutes, and the hidden timestamp of the target page is updated to 10 minutes; it is detected that a page display event occurs at 25 minutes on the target page, the second timestamp of the page display event is determined to be 25 minutes, at this point, it can be determined that the time difference between the second timestamp and the hidden timestamp is 25-10=15 minutes, that is, the current leaving time of the target page is 15 minutes; it is detected that a termination event occurs at 50 minutes on the target page, the termination timestamp of the termination event is determined to be 50 minutes, based on this, it can be determined that the page usage time of the target page is 50-0-15=35 minutes.
[0089] Furthermore, in actual applications, it may happen that the target page is in a hidden state and is terminated. Figure 1 For example, when the user is using page 2, page 1 is in a hidden state. If the user wants to close page 1 at this time, he can close page 1 by closing the tab of page 1 in the menu bar in the browser interface. In this process, the user does not need to switch to page 1 to close it, that is, page 1 is closed in a hidden state. In this case, the previous switching event of the termination event is specifically a page hiding event. At this time, it is necessary to determine the time difference between the page hiding event and the termination event, and based on the time difference between the page hiding event and the termination event, update the page leaving time of the target page, so as to determine the page use time of the target page according to the updated page leaving time.
[0090] Therefore, in a specific implementation provided by the present disclosure, after obtaining the termination timestamp of the termination event, the method further includes:
[0091] In the case that a switching event preceding the termination event is a page hiding event, determining a time difference between the termination timestamp and a first timestamp of the page hiding event;
[0092] Determining the page usage duration of the target page according to the termination timestamp, the start timestamp, and the page leaving duration includes:
[0093] Determine a page usage time difference between the end timestamp and the start timestamp;
[0094] Based on the time difference between the termination timestamp and the first timestamp, updating the page leaving time of the target page;
[0095] The difference between the page usage time difference and the updated page leaving time is determined as the page usage time of the target page.
[0096] Specifically, when it is detected that the previous switching event of the termination event is a page hiding event, the time difference between the termination timestamp of the termination event and the first timestamp of the page hiding event is determined. The page usage time difference between the termination timestamp and the start timestamp is determined, and the time difference between the termination timestamp of the termination event and the first timestamp of the page hiding event is added to the page leaving duration of the target page to obtain the updated page leaving duration. After determining the difference between the page usage time difference and the updated page leaving duration, the difference between the page usage time difference and the updated page leaving duration is determined as the page usage duration of the target page.
[0097] See also Figure 4 , Figure 4 FIG. 2 is a schematic diagram showing another method for determining page usage duration according to an embodiment of the present disclosure. Figure 4 As shown, 0 is the start timestamp of the target page, 50 is the end timestamp of the target page's termination event, and during the period from 0 to 50 minutes, two page hiding events and one page display event are detected on the target page, and the first timestamp of the first page hiding event is specifically 10 minutes, the second timestamp of the page display event is specifically 25 minutes, and the first timestamp of the second page hiding event is specifically 40 minutes. It can be known that the target page is in the page display state during the period from 0 to 10 minutes, in the page hidden state during the period from 10 to 25 minutes, in the page display state again during the period from 25 to 40 minutes, and in the hidden state again during the period from 40 to 50 minutes.
[0098] Specifically, after the target page is loaded, the opening timestamp of the target page can be obtained as 0 minutes; it is detected that the target page has the first page hiding event at 10 minutes, the first timestamp of the first page hiding event is determined to be 10 minutes, and the hidden timestamp of the target page is updated to 10 minutes; it is detected that the target page has a page display event at 25 minutes, and the second timestamp of the page display event is determined to be 25 minutes. At this point, it can be determined that the time difference between the second timestamp and the hidden timestamp is 25-10=15 minutes, that is, the current leaving time of the target page is 15 minutes, that is, the page leaving time of the target page is 15 minutes; it is detected that the target page has the second page hiding event at 40 minutes, the first timestamp of the second page hiding event is determined to be 40 minutes, and the hidden timestamp of the target page is updated to 40 minutes; it is detected that the target page has a termination event at 50 minutes, and the termination timestamp of the termination event is determined to be 50 minutes. Since the previous switching event of the termination event is a page hide event, the time difference between the termination timestamp and the first timestamp of the second page hide event is determined to be 50-40=10 minutes, and the time difference between the termination timestamp and the first timestamp of the second page hide event is added to the page leave duration, and the updated page leave duration is obtained as 15+10=25 minutes. Based on this, the page usage duration of the target page can be determined to be 50-0-25=25 minutes.
[0099] The disclosed embodiment can determine the event type of the previous switching event before the termination event, determine the page usage time determination method corresponding to different switching events, and further improve the accuracy of determining the page usage time of the target page.
[0100] In actual applications, the determined page usage time of the target page may be sent to the server, so that the server stores the page usage time or provides it for subsequent use by other services.
[0101] The method for determining page usage duration provided by the present disclosure includes: when a target page is loaded, obtaining a start timestamp of the target page; when a switching event of the target page is detected, updating a page leaving duration of the target page according to the switching event, wherein the switching event is used to indicate the switching of the target page between page hiding and page display; when a termination event for terminating the use of the target page is detected, obtaining a termination timestamp of the termination event; and determining the page usage duration of the target page according to the termination timestamp, the start timestamp and the page leaving duration.
[0102] The disclosed embodiment realizes that by detecting the switching event of the target page, it can be determined whether the target page is specifically in the page hiding state or the page display state, so that the page leaving time of the target page can be updated according to the switching event of the target page, and the page use time of the target page can be determined based on the termination timestamp of the termination event of the target page, the opening timestamp of the target page, and the page leaving time of the target page. It can be realized that on the basis of determining the page use time of the target page based on the termination timestamp and the opening timestamp, the page leaving time of the target page can be further determined, and the page use time of the target page can be determined in combination with the determined page leaving time, so as to avoid the page leaving time being calculated in the page use time, and improve the accuracy of determining the page use time of the target page.
[0103] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0104] In addition, the present disclosure also provides a device for determining the usage time of a page, an electronic device, a computer-readable storage medium, and a computer program product, all of which can be used to implement any method for determining the usage time of a page provided by the present disclosure. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.
[0105] Figure 5 A block diagram of a device for determining page usage duration provided according to an embodiment of the present disclosure is shown. Figure 5 The embodiment of the present disclosure provides a device for determining the duration of page usage, the device comprising:
[0106] The first acquisition module 502 is configured to acquire the opening timestamp of the target page when the target page is loaded;
[0107] The updating module 504 is configured to update the page leaving time of the target page according to the switching event when a switching event of the target page is detected, wherein the switching event is used to indicate the switching of the target page between page hiding and page display;
[0108] A second acquisition module 506 is configured to acquire a termination timestamp of the termination event when a termination event for terminating the use of the target page is detected;
[0109] The determination module 508 is configured to determine the page usage duration of the target page according to the termination timestamp, the start timestamp and the page leaving duration.
[0110] Optionally, the updating module 504 is further configured to:
[0111] In the case where the switching event is a page hiding event, updating the hiding timestamp of the target page to the first timestamp of the page hiding event, and keeping the page leaving time length of the target page unchanged;
[0112] In the case where the switching event is a page display event, the page leaving duration of the target page is updated according to the hiding timestamp of the target page and the second timestamp of the page display event.
[0113] Optionally, the updating module 504 is further configured to:
[0114] Determine the time difference between the second timestamp and the hidden timestamp as the current leaving duration;
[0115] The current leaving time is added to the recorded page leaving time to obtain an updated page leaving time.
[0116] Optionally, the determining module 508 is further configured to:
[0117] Determine a page usage time difference between the end timestamp and the start timestamp;
[0118] The difference between the page usage time difference and the page leaving time is determined, and the difference is determined as the page usage time of the target page.
[0119] Optionally, the device further includes a time difference determination module, configured to:
[0120] In the case that a switching event preceding the termination event is a page hiding event, determining a time difference between the termination timestamp and a first timestamp of the page hiding event;
[0121] The determining module 508 is further configured to:
[0122] Determine a page usage time difference between the end timestamp and the start timestamp;
[0123] Based on the time difference between the termination timestamp and the first timestamp, updating the page leaving time of the target page;
[0124] The difference between the page usage time difference and the updated page leaving time is determined as the page usage time of the target page.
[0125] Optionally, the second acquisition module 506 is further configured to:
[0126] In the case where the termination event is a page closing event, determining the closing timestamp of the page closing event as the termination timestamp;
[0127] In the case that the termination event is a page refresh event, the refresh timestamp of the page refresh event is determined as the termination timestamp.
[0128] The device for determining page usage duration provided by the present disclosure includes: a first acquisition module, configured to acquire the start timestamp of the target page when the target page is loaded; an update module, configured to update the page leaving duration of the target page according to the switching event when a switching event of the target page is detected, wherein the switching event is used to indicate the switching of the target page between page hiding and page display; a second acquisition module, configured to acquire the termination timestamp of the termination event when a termination event of terminating the use of the target page is detected; a determination module, configured to determine the page usage duration of the target page according to the termination timestamp, the start timestamp and the page leaving duration.
[0129] The disclosed embodiment realizes that by detecting the switching event of the target page, it can be determined whether the target page is specifically in the page hiding state or the page display state, so that the page leaving time of the target page can be updated according to the switching event of the target page, and the page use time of the target page can be determined based on the termination timestamp of the termination event of the target page, the opening timestamp of the target page, and the page leaving time of the target page. It can be realized that on the basis of determining the page use time of the target page based on the termination timestamp and the opening timestamp, the page leaving time of the target page can be further determined, and the page use time of the target page can be determined in combination with the determined page leaving time, so as to avoid the page leaving time being calculated in the page use time, and improve the accuracy of determining the page use time of the target page.
[0130] Each module in the above-mentioned page usage time determination device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0131] Figure 6 A block diagram of an electronic device provided in an embodiment of the present disclosure.
[0132] Reference Figure 6The embodiment of the present disclosure provides an electronic device 600, which includes: at least one processor 601; at least one memory 602, and one or more I / O interfaces 603, connected between the processor 601 and the memory 602; wherein the memory 602 stores one or more computer programs that can be executed by the at least one processor 601, and the one or more computer programs are executed by the at least one processor 601 so that the at least one processor 601 can execute the above-mentioned page usage time determination method.
[0133] Each module in the above electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0134] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned method for determining the page usage duration when executed by a processor / processing core. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0135] The embodiment of the present disclosure also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned method for determining the page usage time.
[0136] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0137] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0138] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0139] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0140] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0141] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0142] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0143] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0144] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0145] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A method for determining page usage duration, characterized in that: include: When the target page is loaded, obtain the opening timestamp of the target page; When a switching event of the target page is detected, updating the page leaving time of the target page according to the switching event, wherein the switching event is used to indicate the switching of the target page between page hiding and page display; When a termination event for terminating the use of the target page is detected, obtaining a termination timestamp of the termination event; The page usage time of the target page is determined according to the termination timestamp, the start timestamp and the page leaving time.
2. The method according to claim 1, characterized in that Updating the page leaving time of the target page according to the switching event includes: In the case where the switching event is a page hiding event, updating the hiding timestamp of the target page to the first timestamp of the page hiding event, and keeping the page leaving time length of the target page unchanged; In the case where the switching event is a page display event, the page leaving duration of the target page is updated according to the hiding timestamp of the target page and the second timestamp of the page display event.
3. The method according to claim 2, characterized in that Updating the page leaving time of the target page according to the hidden timestamp of the target page and the second timestamp of the page display event includes: Determine the time difference between the second timestamp and the hidden timestamp as the current leaving duration; The current leaving time is added to the recorded page leaving time to obtain an updated page leaving time.
4. The method according to claim 1, characterized in that Determining the page usage duration of the target page according to the termination timestamp, the start timestamp, and the page leaving duration includes: Determine a page usage time difference between the end timestamp and the start timestamp; The difference between the page usage time difference and the page leaving time is determined, and the difference is determined as the page usage time of the target page.
5. The method according to claim 1, characterized in that After obtaining the termination timestamp of the termination event, the method further includes: In the case that a switching event preceding the termination event is a page hiding event, determining a time difference between the termination timestamp and a first timestamp of the page hiding event; Determining the page usage duration of the target page according to the termination timestamp, the start timestamp, and the page leaving duration includes: Determine a page usage time difference between the end timestamp and the start timestamp; Based on the time difference between the termination timestamp and the first timestamp, updating the page leaving time of the target page; The difference between the page usage time difference and the updated page leaving time is determined as the page usage time of the target page.
6. The method according to claim 1, characterized in that Get the termination timestamp of the termination event, including: In the case where the termination event is a page closing event, determining the closing timestamp of the page closing event as the termination timestamp; In the case that the termination event is a page refresh event, the refresh timestamp of the page refresh event is determined as the termination timestamp.
7. A device for determining page usage duration, characterized in that: include: A first acquisition module is configured to acquire an opening timestamp of the target page when the target page is loaded; an updating module, configured to, when a switching event of the target page is detected, update the page leaving time length of the target page according to the switching event, wherein the switching event is used to indicate the switching of the target page between page hiding and page display; A second acquisition module is configured to acquire a termination timestamp of the termination event when a termination event for terminating the use of the target page is detected; The determination module is configured to determine the page usage time of the target page according to the termination timestamp, the start timestamp and the page leaving time.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer-readable code or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the method according to any one of claims 1 to 6.
Citation Information
Cited By
Method, device and equipment for collecting page browsing duration of swan monk system, storage medium and product
CN121256154A