Page dwell time statistical method and device, computer device and storage medium

CN117112378BActive Publication Date: 2026-09-22CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310980672.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-04
Publication Date
2026-09-22
Estimated Expiration
2043-08-04

AI Technical Summary

Technical Problem

[0004]然而,目前的页面停留时长统计方法,需要客户端和服务端都需要进行开发,如果对之前的网页要新增记录时,必须对该客户端网页的埋点功能进行新增开发,而客户端程序开发较为繁琐且周期性长,会影响页面停留时长统计效率

Benefits of technology

[0051]上述页面停留时长统计方法、装置、计算机设备、存储介质和计算机程序产品,通过获取用户标识在目标网页的当前状态为登入状态及对应的时间戳、前一状态为登入状态及对应的时间戳;计算所述用户标识在目标网页的当前状态为登入状态对应的时间戳与用户标识在目标网页的前一状态为登入状态对应的时间戳之间的第一差值;若所述第一差值小于连续登入最少间隔时长,则所述目标页面停留时长等于历史页面停留时长;若所述第一差值大于所述连续登入最少间隔时长,且小于等于连续登入最长间隔时长,则所述目标页面停留时长等于历史页面停留时长加所述第一差值;其中所述连续登入最少间隔时长小于所述连续登入最长间隔时长;若所述第一差值大于所述连续登入最长间隔时长,则所述目标页面停留时长等于历史页面停留时长加上所述连续登入最少间隔时长。通过获取用户在网页的当前登入状态和前一登入状态,将两次状态对应的时间戳信息计算的差值与预设的连续登入最少间隔时长和连续登入最少间隔时长进行比较,选择目标页面停留时长的计算规则并进行计算,不需要对客户端进行开发,从而提高页面停留时长统计的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117112378B_ABST
    Figure CN117112378B_ABST
Patent Text Reader

Abstract

The application relates to a page stay duration statistical method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: obtaining a current login state, a previous login state and corresponding time stamps of a user identifier on a target webpage; calculating a first difference value between the time stamp corresponding to the current login state and the time stamp corresponding to the previous login state of the user identifier on the target webpage; if the first difference value is less than a minimum continuous login interval duration, then a target page stay duration is equal to a historical page stay duration; if the first difference value is greater than the minimum continuous login interval duration and less than or equal to a maximum continuous login interval duration, then the target page stay duration is equal to the historical page stay duration plus the first difference value; and if the first difference value is greater than the maximum continuous login interval duration, then the target page stay duration is equal to the historical page stay duration plus the minimum continuous login interval duration. The method can improve the efficiency of page stay duration statistics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for calculating page dwell time. Background Technology

[0002] With the development of big data technology, statistical techniques for measuring page dwell time have emerged. Page dwell time is a common metric in website analytics, used to reflect how long users spend on certain pages.

[0003] In traditional technology, the current method for calculating page dwell time involves tracking the duration of page dwell time on the client side, with the client sending the user's page dwell time information to the server at regular intervals.

[0004] However, current methods for measuring page dwell time require development on both the client and server sides. If a new record needs to be added to an existing webpage, the tracking functionality of that webpage must be developed. Client-side program development is cumbersome and time-consuming, which affects the efficiency of page dwell time measurement. Summary of the Invention

[0005] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the efficiency of page dwell time statistics in response to the above-mentioned technical problems.

[0006] Firstly, this application provides a method for calculating page dwell time. The method includes:

[0007] Obtain the user's current login status and corresponding timestamp on the target webpage, and the previous login status and corresponding timestamp.

[0008] Calculate the first difference between the timestamp corresponding to the current state of the user identifier being logged in on the target webpage and the timestamp corresponding to the previous state of the user identifier being logged in on the target webpage;

[0009] If the first difference is less than the minimum interval between consecutive logins, then the dwell time on the target page is equal to the dwell time on the historical page.

[0010] If the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, then the target page dwell time is equal to the historical page dwell time plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval.

[0011] If the first difference is greater than the longest consecutive login interval, then the target page dwell time is equal to the historical page dwell time plus the shortest consecutive login interval.

[0012] In one embodiment, the page dwell time calculation method further includes:

[0013] Obtain the user's current state on the target webpage as logged out and the corresponding timestamp, and the previous state as logged in and the corresponding timestamp.

[0014] Calculate the second difference between the timestamp corresponding to the current state of the user identifier on the target webpage being logged out and the timestamp corresponding to the previous state of the user identifier on the target webpage being logged in;

[0015] If the second difference is less than or equal to the preset time from login to logout, then the target page dwell time is equal to the historical page dwell time plus the second difference minus the minimum interval time for consecutive logins;

[0016] If the second difference is greater than the preset duration from login to logout, then the target page dwell time is equal to the historical page dwell time plus the preset duration from login to logout.

[0017] In one embodiment, the page dwell time calculation method further includes:

[0018] Query the event log to find the previous state of the user identifier on the target webpage and the corresponding timestamp.

[0019] In one embodiment, the page dwell time calculation method further includes:

[0020] If the user's current state on the target webpage is either first login or logged out, then the duration of stay on the target page is equal to the duration of stay on historical pages plus the minimum interval between consecutive logins.

[0021] In one embodiment, the method of obtaining the user identifier's current state on the target webpage as either initial login or logout includes:

[0022] Retrieve the user identifier from the event log to its previous state on the target webpage;

[0023] If the previous state of the user identifier on the target webpage is not found in the event log, then the current state of the user identifier on the target webpage is considered to be the first login state.

[0024] If the event log shows a previous state of the user identifier on the target webpage where the previous state was logged out, then the current state of the user identifier on the target webpage is considered to be logged out.

[0025] In one embodiment, the page dwell time calculation method further includes:

[0026] If the user identifier is found to be logged out in both the current and previous states on the target webpage, then the duration of stay on the target page is equal to the duration of stay on the historical pages.

[0027] Secondly, this application also provides a page dwell time statistics device. The device includes:

[0028] The first acquisition module is used to acquire the user's current state as logged in and the corresponding timestamp on the target webpage, as well as the previous state as logged in and the corresponding timestamp.

[0029] The first calculation module is used to calculate a first difference between the timestamp corresponding to the current state of the user identifier on the target webpage being logged in and the timestamp corresponding to the previous state of the user identifier on the target webpage being logged in.

[0030] The first judgment module is used to determine if the first difference is less than the minimum interval between consecutive logins, and the dwell time of the target page is equal to the dwell time of the historical page.

[0031] The second judgment module is used to determine that if the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, the target page dwell time is equal to the historical page dwell time plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval.

[0032] The third judgment module is used to determine that if the first difference is greater than the longest consecutive login interval, the target page dwell time is equal to the historical page dwell time plus the shortest consecutive login interval.

[0033] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0034] Obtain the user's current login status and corresponding timestamp on the target webpage, and the previous login status and corresponding timestamp.

[0035] Calculate the first difference between the timestamp corresponding to the current state of the user identifier being logged in on the target webpage and the timestamp corresponding to the previous state of the user identifier being logged in on the target webpage;

[0036] If the first difference is less than the minimum interval between consecutive logins, then the dwell time on the target page is equal to the dwell time on the historical page.

[0037] If the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, then the target page dwell time is equal to the historical page dwell time plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval.

[0038] If the first difference is greater than the longest consecutive login interval, then the target page dwell time is equal to the historical page dwell time plus the shortest consecutive login interval.

[0039] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0040] Obtain the user's current login status and corresponding timestamp on the target webpage, and the previous login status and corresponding timestamp.

[0041] Calculate the first difference between the timestamp corresponding to the current state of the user identifier being logged in on the target webpage and the timestamp corresponding to the previous state of the user identifier being logged in on the target webpage;

[0042] If the first difference is less than the minimum interval between consecutive logins, then the dwell time on the target page is equal to the dwell time on the historical page.

[0043] If the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, then the target page dwell time is equal to the historical page dwell time plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval.

[0044] If the first difference is greater than the longest consecutive login interval, then the target page dwell time is equal to the historical page dwell time plus the shortest consecutive login interval.

[0045] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0046] Obtain the user's current login status and corresponding timestamp on the target webpage, and the previous login status and corresponding timestamp.

[0047] Calculate the first difference between the timestamp corresponding to the current state of the user identifier being logged in on the target webpage and the timestamp corresponding to the previous state of the user identifier being logged in on the target webpage;

[0048] If the first difference is less than the minimum interval between consecutive logins, then the dwell time on the target page is equal to the dwell time on the historical page.

[0049] If the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, then the target page dwell time is equal to the historical page dwell time plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval.

[0050] If the first difference is greater than the longest consecutive login interval, then the target page dwell time is equal to the historical page dwell time plus the shortest consecutive login interval.

[0051] The aforementioned page dwell time statistics method, apparatus, computer equipment, storage medium, and computer program product obtain the current login state and corresponding timestamp of the user identifier on the target webpage, and the previous login state and corresponding timestamp; calculate a first difference between the timestamp corresponding to the current login state of the user identifier on the target webpage and the timestamp corresponding to the previous login state of the user identifier on the target webpage; if the first difference is less than the minimum consecutive login interval, the dwell time on the target page is equal to the dwell time on the historical page; if the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, the dwell time on the target page is equal to the dwell time on the historical page plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval; if the first difference is greater than the maximum consecutive login interval, the dwell time on the target page is equal to the dwell time on the historical page plus the minimum consecutive login interval. By obtaining the user's current login status and previous login status on the webpage, the difference between the timestamp information corresponding to the two statuses is calculated and compared with the preset minimum interval between consecutive logins. The calculation rule for the dwell time on the target page is selected and the calculation is performed. No client-side development is required, thereby improving the efficiency of page dwell time statistics. Attached Figure Description

[0052] Figure 1 This is a diagram illustrating the application environment of a page dwell time statistics method in one embodiment;

[0053] Figure 2 This is a flowchart illustrating a method for calculating page dwell time in one embodiment;

[0054] Figure 3 This is a flowchart illustrating the page dwell time statistics method in another embodiment;

[0055] Figure 4 This is a schematic diagram of the process for obtaining the user's identifier in the target webpage as either a first login state or a logged-out state in one embodiment.

[0056] Figure 5 This is a structural block diagram of a page dwell time statistics device in one embodiment;

[0057] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0059] The page dwell time statistics method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Server 104 obtains the user's current login state and corresponding timestamp, and the previous login state and corresponding timestamp, on the target webpage; it calculates a first difference between the timestamp corresponding to the user's current login state and the timestamp corresponding to the user's previous login state on the target webpage; if the first difference is less than the minimum consecutive login interval, the target page dwell time is equal to the historical page dwell time; if the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, the target page dwell time is equal to the historical page dwell time plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval; if the first difference is greater than the maximum consecutive login interval, the target page dwell time is equal to the historical page dwell time plus the minimum consecutive login interval. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0060] Step S202: Obtain the user identifier's current state on the target webpage as logged in and the corresponding timestamp, and the previous state as logged in and the corresponding timestamp.

[0061] In this context, a user identifier is a user-defined identifier used to name variables, functions, arrays, etc. The purpose of a user identifier is to distinguish users and locate single points. A state refers to using a set of characteristic data to describe each object, and this characteristic data changes over time. The current state refers to the state of the object at the current point in time, as reflected by the characteristic data at that moment.

[0062] Optionally, when a user interacts with the client-side page, the client-side page obtains user information and page information, such as the user checking in on applications like WeChat and Weibo, or information about the webpage the user visits. User information may include a user ID or a device ID. The client sends the obtained user information and target page information to the server. The server filters the obtained information. During the filtering operation, it can save currently unnecessary information to the database for later retrieval, or it can delete filtered information. After the filtering operation, user identification information and the user's status on the webpage are retained. The server ultimately obtains the filtered and retained information, that is, the current status of the user's identification on the target webpage. The processor obtains user A's previous and current status on target page A, i.e., login status and login status, as well as the timestamps corresponding to the two statuses. At this point, the user is continuously logged in on the target webpage.

[0063] The processor compares the first difference with the minimum consecutive login interval and the maximum consecutive login interval to determine the relationship between the first difference and these intervals. If the minimum consecutive login interval is set to 10 seconds and the maximum consecutive login interval is set to 3 minutes, the minimum consecutive login interval is less than the maximum consecutive login interval.

[0064] Step S204: Calculate the first difference between the timestamp corresponding to the current state of the user identifier on the target webpage being logged in and the timestamp corresponding to the previous state of the user identifier on the target webpage being logged in.

[0065] A timestamp is a sequence of characters or encoded information used to identify when a specific event occurs, usually giving the date and time, sometimes accurate to a fraction of a second.

[0066] Following the above embodiment, the processor obtains user A's current login status on webpage A and the corresponding timestamp 9:00:00, user A's previous login status on webpage A and the corresponding timestamp 9:00:05; the first difference is 5 seconds.

[0067] Step S206: If the first difference is less than the minimum interval between consecutive logins, the dwell time on the target page is equal to the dwell time on the historical page; if the first difference is greater than the minimum interval between consecutive logins and less than or equal to the maximum interval between consecutive logins, the dwell time on the target page is equal to the dwell time on the historical page plus the first difference; wherein the minimum interval between consecutive logins is less than the maximum interval between consecutive logins; if the first difference is greater than the maximum interval between consecutive logins, the dwell time on the target page is equal to the dwell time on the historical page plus the minimum interval between consecutive logins.

[0068] The interval duration refers to the time difference between two timestamps, usually measured in seconds, minutes, hours, days, etc. A timestamp is a sequence of characters or encoded information used to identify when a specific event occurred, typically providing a date and time, accurate to a fraction of a second. The processor considers a user's current state as logged in and the previous state as logged in as consecutive logins. The consecutive login interval time refers to the time difference between the timestamps corresponding to at least two login states obtained by the processor within a preset period. The minimum consecutive login interval time is selected from the set of consecutive login interval times. The maximum consecutive login interval time can be measured in milliseconds, seconds, minutes, hours, days, etc., and is selected from the set of consecutive login interval times. The minimum consecutive login interval time is always less than the maximum consecutive login interval time. Historical page dwell time is an auto-incrementing sequence, referring to the cumulative time a user spends on a page.

[0069] Optionally, following the above embodiment, the timestamp corresponding to the previous login state of processor user A on target page A is 9:00:00, and the current login state is 9:00:05. The first difference is 5 seconds. Assuming the consecutive login interval is 10 seconds, the first difference is less than or equal to the consecutive login interval. That is, the time difference of the user's consecutive logins on the target webpage is less than the minimum consecutive login interval. In this case, the time interval can be ignored, and the value of the dwell time on the target page does not need to be accumulated. The dwell time on the target page is equal to the value of the dwell time on the historical pages that has already been accumulated.

[0070] Optionally, continuing with the aforementioned embodiment, user A's previous login state on target page A has a timestamp of 9:00:00, and the current login state is 9:02:00. The first difference is 2 minutes, the consecutive login interval is 10 seconds, and the longest consecutive login interval is 3 minutes. In this case, the first difference is greater than the minimum consecutive login interval of 10 seconds but less than the maximum consecutive login interval of 3 minutes. Therefore, the duration of stay on the target page is equal to the historical page stay time plus the first difference. That is, the first difference is the actual duration of stay on the target page, and the range of the first difference is between the preset minimum consecutive login interval and the preset maximum consecutive login interval. The duration of stay on the target page is equal to the historical page stay time plus the first difference.

[0071] Optionally, continuing with the aforementioned embodiment, user A's previous login state on target page A has a timestamp of 9:00:00, and the current login state is 9:05:00. The first difference is 5 minutes, and the longest consecutive login interval is 3 minutes. In this case, the first difference of 5 minutes is greater than the shortest consecutive login interval of 3 minutes. Therefore, the dwell time on the target page is the dwell time on the historical page plus the default assigned duration, which is the shortest consecutive login interval. When the first difference is greater than the longest consecutive login interval, it can be considered that the user is logged out on the target webpage.

[0072] In the above method for calculating page dwell time, the following steps are taken: First, the user's current state on the target webpage (login state) and its corresponding timestamp, and the user's previous state (login state) and its corresponding timestamp are obtained. Then, a first difference is calculated between the timestamp corresponding to the user's current state (login state) and the timestamp corresponding to the user's previous state (login state). If this first difference is less than the minimum consecutive login interval, the dwell time on the target page is equal to the dwell time on the historical page. If the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, the dwell time on the target page is equal to the dwell time on the historical page plus the first difference. The minimum consecutive login interval is less than the maximum consecutive login interval. If the first difference is greater than the maximum consecutive login interval, the dwell time on the target page is equal to the dwell time on the historical page plus the minimum consecutive login interval. By obtaining the user's current login status and previous login status on the webpage, and comparing them with the preset minimum and maximum consecutive login intervals, the calculation method for the target page dwell time is determined, and the target page dwell time is calculated according to the calculation method. No client-side development is required, thereby improving the efficiency of page dwell time statistics.

[0073] In one embodiment, such as Figure 3 As shown, methods for calculating page dwell time also include:

[0074] Step S302: Obtain the user identifier's current state on the target webpage as logged out and the corresponding timestamp, and the previous state as logged in and the corresponding timestamp.

[0075] Optionally, the processor obtains the previous logout state and current login state of user A on the target page A, i.e., login state-logout state, as well as the timestamps corresponding to the two states, such as logging in at 9:00 and logging out at 9:20. At this time, user A is logged in and then logged out on webpage A, which is the user's actual login and logout duration.

[0076] Optionally, the processor compares the second difference of 20 minutes with a preset duration from login to logout, such as a preset duration of 15 minutes, to determine the relationship between the second difference and the preset duration. In this case, the second difference of 20 minutes is greater than the preset duration of 15 minutes. The actual duration of a complete cycle from login to logout on the target page is greater than the preset duration.

[0077] Step S304: Calculate the second difference between the timestamp corresponding to the current state of the user identifier on the target webpage being logged out and the timestamp corresponding to the previous state of the user identifier on the target webpage being logged in.

[0078] Optionally, following the above embodiment, a second difference of 20 minutes is calculated by comparing the timestamp corresponding to the current logged-out state of the obtained user identifier on the target webpage with the timestamp corresponding to the previous logged-in state of the user identifier on the target webpage.

[0079] Step S306: If the second difference is less than or equal to the preset duration from login to logout, the target page dwell time is equal to the historical page dwell time plus the second difference minus the minimum interval between consecutive logins; if the second difference is greater than the preset duration from login to logout, the target page dwell time is equal to the historical page dwell time plus the preset duration from login to logout.

[0080] The preset duration from login to logout is the preset duration of a complete cycle from login to logout on the target page, and the unit can be milliseconds, seconds, minutes, hours, days, etc.

[0081] Optionally, following the above embodiment, assume that the preset time from login to logout is 15 minutes. In this case, the second difference of 20 minutes is greater than the preset time of 15 minutes from login to logout, that is, the actual time the user spends on the target page for a complete cycle from login to logout is greater than the preset time, and the time spent on the target page is equal to the time spent on historical pages plus the preset time.

[0082] In practical applications, if a user logs into a webpage and does not perform any action within a certain period, it is assumed that the user has not stayed on the page during that time. The preset timeframe is considered the user's dwell time during this period, and the page dwell time at this point is the sum of the historical page dwell time and the preset timeframe.

[0083] Optionally, in one embodiment, the second difference is 10 minutes, which means the second difference of 10 minutes is less than or equal to the third duration of 15 minutes. That is, the actual duration of a complete cycle from login to logout on the target page is less than or equal to the preset duration. In this case, the duration of stay on the target page should be the historical page duration plus the second difference minus the minimum interval between consecutive logins.

[0084] In practical applications, when a user logs into the page, performs other operations, and then logs out, the duration of stay on the target page is equal to the duration of stay on the historical page plus (the second difference - the minimum interval between consecutive logins). This is because the default duration assigned upon login, i.e., the minimum interval between consecutive logins, has already been calculated once in the duration of stay on the historical page, so the minimum interval between consecutive logins needs to be subtracted.

[0085] In this embodiment, the target page dwell time is calculated by comparing the second difference with the preset duration from login to logout.

[0086] In one embodiment, the method for calculating page dwell time further includes:

[0087] Query the event log to find the previous state of the user identifier on the target webpage and the corresponding timestamp.

[0088] The event log records important software and hardware events, including user login, logout, and other related operations, along with corresponding timestamp information.

[0089] Optionally, after the processor obtains the current state of the user identifier on the target webpage, it will query the event log for relevant records of the user identifier's previous state on the target webpage and the timestamp information corresponding to the previous state.

[0090] In this embodiment, the previous state of the user identifier on the target webpage and the timestamp information corresponding to the previous state are queried from the event log, providing a basis for the subsequent calculation of the page dwell time.

[0091] In one embodiment, the method for calculating page dwell time further includes:

[0092] If the user's current state on the target webpage is either first login or logged out, then the duration of stay on the target page is equal to the duration of stay on historical pages plus the minimum interval between consecutive logins.

[0093] The "first login" state refers to the first time a user enters a website or computer system. For example, if user A logs into webpage A for the first time at 9:00 AM, user A only has a logged-in state at this time. Calculating the duration of stay on the target page requires obtaining the states of at least two time points. Therefore, the processor will assign a default duration for the first login state. The "logout" state refers to the user exiting a website or computer system. At this time, only the user's logged-out state is available, and it is impossible to obtain the states of two time points. Therefore, when calculating the duration of stay on the target page, the processor will assign a default duration for the first login state. The duration unit can be milliseconds, seconds, minutes, or hours. In this scheme, the default duration is defined as the minimum interval between consecutive logins based on historical data. The time interval refers to the time difference between two timestamps, usually in seconds, minutes, hours, days, etc. A timestamp is a sequence of characters or encoded information used to identify when a specific event occurred, usually providing a date and time, and can be accurate to a fraction of a second. The historical page stay duration for the user's first login state is 0 seconds. The consecutive login time interval refers to the time difference between the timestamps corresponding to at least two login states detected by the processor within a preset period. The minimum consecutive login interval is selected from the set of consecutive login intervals. The target page dwell time is formed by updating the historical page dwell time, that is, it is an auto-incrementing sequence based on the historical page dwell time.

[0094] Optionally, the processor determines whether the user's current state on the target webpage is either the first login state or the logged-out state. If so, the duration of stay on the target page is the duration of stay on historical pages plus the minimum interval between consecutive logins.

[0095] Optionally, the processor determines that the user's current state on the target webpage is an initial login state, and the historical page dwell time for the user's initial login state is 0 seconds; the minimum interval for consecutive logins can be 5 seconds, 10 seconds, or other times, and is not limited here. In this case, the dwell time on the target page is the historical page dwell time plus the minimum interval for consecutive logins, i.e., 0 + minimum interval for consecutive logins.

[0096] Optionally, the processor determines that the user's current state on the target webpage is logged out. In this case, the duration of stay on the target page is the historical duration of stay plus the minimum interval between consecutive logins. For example, if the historical duration of stay is 600 seconds and the minimum interval between consecutive logins is 10 seconds, then the duration of stay on the target page is 600 seconds + 10 seconds.

[0097] In this embodiment, by determining whether the user's current state on the target webpage is first login or logout, the corresponding calculation rule is selected to calculate the dwell time on the target page.

[0098] In one embodiment, such as Figure 4 As shown, the methods for obtaining the user's current state on the target webpage, whether it is a first login state or a logged-out state, include:

[0099] Step S402: Query the previous state of the user identifier on the target webpage from the event log.

[0100] The event log records important software and hardware events, including user login, logout, and other related operations, along with corresponding timestamp information.

[0101] Optionally, the processor queries the event log for the user's previous state on the target webpage.

[0102] Step S404: If the previous state of the user identifier on the target webpage is not found in the event log, then the current state of the user identifier on the target webpage is considered to be the first login state.

[0103] Optionally, if the processor cannot find a record in the event log indicating the user's previous state on the target webpage, the processor assumes that the user's current state on the target webpage is the first login state.

[0104] In practical applications, if a user does not log out normally after first logging into the webpage and no logout record can be found in the event log, then the first login state can be considered an abnormal state until the time spent on the target page is counted.

[0105] Step S406: If the event log shows a previous state of the user identifier on the target webpage, and the previous state was a logged-out state, then the current state of the user identifier on the target webpage is considered to be a logged-out state.

[0106] Optionally, the processor queries the event log to find a record of the user's previous state on the target webpage. The processor then reads the content of the query record. If the previous state is logged out, the processor assumes that the user's current state on the target webpage will remain logged out until the current login operation record overwrites the logged-out state record.

[0107] Optionally, if the processor finds a record in the event log indicating the user's previous state on the target webpage, the processor will then read the content of the found record. If the previous state was a login state, the processor will perform other processing.

[0108] In practical applications, if the user has not yet performed a login action to overwrite their logged-out state by the current moment of the target page's dwell time, the user's current state remains the most recent logged-out state. If the user performs a login action by the current moment of the target page's dwell time, their current state will be logged in.

[0109] In this embodiment, the current state is determined as either first login or logout by querying the information of the user's previous state on the target webpage. Then, an appropriate method for calculating the page dwell time is selected based on the first login or logout state, and the page dwell time can still be calculated even in abnormal situations.

[0110] In one embodiment, the method for calculating page dwell time further includes:

[0111] If the user identifier is found to be logged out in both the current and previous states on the target webpage, then the duration of stay on the target page is equal to the duration of stay on the historical pages.

[0112] Optionally, if the processor obtains that the user identifier is in the current state of the target webpage and the previous state is also in the logout state, that is, the change of the user state is "logout-logout", then it is considered that the target user has logged out. Therefore, the dwell time on the target page is equal to the dwell time on the historical page, and there is no need to accumulate the time difference between the logout state and the logout state.

[0113] In this embodiment, by determining whether the user's current state on the target webpage is logged out and whether the previous state was logged out, the corresponding calculation rule is selected to calculate the dwell time on the target page.

[0114] In one embodiment, the method for calculating page dwell time includes:

[0115] The login and logout status of user A on webpages A and B, along with the corresponding timestamp information, are shown in the table below.

[0116] 1) User A performs an operation on webpage A at time 1.

[0117]

[0118] 2) User A jumps from webpage A to webpage B at time point 2.

[0119]

[0120] 3) User A redirects from webpage B back to webpage A at time point 3.

[0121]

[0122] 4) User A performs another operation on webpage A at time 4.

[0123]

[0124] Optionally, the minimum interval between consecutive logins is set to 10 seconds, the maximum interval between consecutive logins is set to 3 minutes, and the preset time from login to logout is set to 15 minutes.

[0125] At time point 1, 9:00 AM, user A logs into webpage A for the first time. Given that user A's current state on webpage A is first login, the target page dwell time equals the historical page dwell time plus the default assigned time. In this solution, the default assigned time is defined as the minimum interval between consecutive logins. The historical page dwell time is 0. Target page dwell time = historical page dwell time + default assigned time = 0 + 10 seconds = 10 seconds.

[0126] At time point 2, 9:02, User A logs out of webpage A. At this time, User A's current state on webpage A is logged out, and the previous state was logged in. Therefore, User A's state on webpage A is determined to be: Login-Logout. Thus, it is necessary to calculate the second difference between the timestamp 9:02 corresponding to User A's current state of being logged out and the timestamp 9:00 corresponding to User A's previous state of being logged in. The second difference is 2 minutes. Further analysis is needed to determine the relationship between the second difference of 2 minutes and the preset duration of 15 minutes for a single login to logout process. Clearly, the second difference of 2 minutes is less than or equal to the preset duration of 15 minutes for a single login to logout process. Therefore, the target page dwell time is calculated as: Target Page Dwell Time = Historical Page Dwell Time + (Second Difference - Minimum Interval Between Consecutive Logins). 10 seconds + (2 minutes - 10 seconds) = 2 minutes.

[0127] At 9:02, User A logs out of webpage B. Given that User A's current state on webpage B is their first login, the target page dwell time equals the historical page dwell time plus the default assigned time. In this solution, the default assigned time is defined as the minimum interval between consecutive logins. The historical page dwell time is 0. Target page dwell time = historical page dwell time + default assigned time = 0 + 10 seconds = 10 seconds.

[0128] At time point 3, at 9:22, user A jumps from webpage B back to webpage A, that is, user A logs into webpage A. At this time, user A's status on webpage A changes to "logout-login". Therefore, it is considered that user A's status on webpage A is logged out. Thus, the duration of stay on the target page = the duration of stay on the historical page + the minimum interval between consecutive logins = 2 minutes + 10 seconds.

[0129] User A's current state is logged out of webpage B, and the previous state was logged into webpage B. At this time, User A's state on webpage B has changed to "login-logout". Therefore, the difference between the timestamps corresponding to the two states is calculated, and the difference is 20 minutes. Further, the relationship between the difference of 20 minutes and the preset time of 15 minutes from login to logout is determined. Obviously, the difference is greater than the preset time of login to logout. Therefore, the target page dwell time = historical page dwell time + preset time of login to logout = 10 seconds + 15 minutes.

[0130] Time point 4 is 9:23, which is when User A performs another operation on webpage A, i.e., User A's state on webpage A changes to "Login-Login". The difference of 1 minute between the timestamp corresponding to User A's current state of "Login" (9:23) and the timestamp corresponding to User A's previous state of "Login" (9:22) on webpage A is calculated. Further analysis is performed on the relationship between the difference of 1 minute and the minimum interval for consecutive logins set at 10 seconds and the maximum interval for consecutive logins set at 3 minutes. The difference of 1 minute is greater than the minimum interval for consecutive logins of 10 seconds and less than the maximum interval for consecutive logins of 3 minutes. Therefore, the duration of User A's stay on the target page of webpage A = the duration of stay on the historical page + the first difference = 2 minutes 10 seconds + 1 minute = 3 minutes 10 seconds.

[0131] User A's current state on webpage B is "logout," and the previous state was "logout," meaning the state change is "logout-logout." Therefore, the duration of user A's stay on the target page of webpage B equals the duration of their stay on previous pages, which is 15 minutes and 10 seconds.

[0132] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0133] Based on the same inventive concept, this application also provides a page dwell time statistics device for implementing the page dwell time statistics method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more page dwell time statistics device embodiments provided below can be found in the limitations of the page dwell time statistics method described above, and will not be repeated here.

[0134] In one embodiment, such as Figure 5 As shown, a page dwell time statistics device is provided, including: a first acquisition module 501, a first calculation module 502, a first judgment module 503, a second judgment module 504, and a third judgment module 505, wherein:

[0135] The first acquisition module 501 is used to acquire the user identifier's current state as logged in and the corresponding timestamp on the target webpage, and the previous state as logged in and the corresponding timestamp.

[0136] The first calculation module 502 is used to calculate the first difference between the timestamp corresponding to the current state of the user identifier on the target webpage being logged in and the timestamp corresponding to the previous state of the user identifier on the target webpage being logged in.

[0137] The first judgment module 503 is used to determine the target page dwell time equal to the historical page dwell time if the first difference is less than the minimum interval between consecutive logins.

[0138] The second judgment module 504 is used to determine the target page dwell time as the historical page dwell time plus the first difference if the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval; wherein the minimum consecutive login interval is less than the maximum consecutive login interval.

[0139] The third judgment module 505 is used to determine that if the first difference is greater than the longest consecutive login interval, the target page dwell time is equal to the historical page dwell time plus the shortest consecutive login interval.

[0140] In one embodiment, the page dwell time counting device further includes:

[0141] The second acquisition module is used to acquire the user's current status on the target webpage as logged out and the corresponding timestamp, and the previous status as logged in and the corresponding timestamp.

[0142] The second calculation module is used to calculate the second difference between the timestamp corresponding to the user identifier's current state on the target webpage being logged out and the timestamp corresponding to the user identifier's previous state on the target webpage being logged in.

[0143] The fourth judgment module is used to determine the target page dwell time if the second difference is less than or equal to the preset time from login to logout. In this case, the target page dwell time is equal to the historical page dwell time plus the second difference minus the minimum interval between consecutive logins.

[0144] The fifth judgment module is used to determine that if the second difference is greater than the preset time from login to logout, the target page dwell time is equal to the historical page dwell time plus the preset time from login to logout.

[0145] In one embodiment, the page dwell time counting device further includes:

[0146] The query module is used to retrieve the user's previous state on the target webpage and the corresponding timestamp from the event log.

[0147] In one embodiment, the page dwell time counting device further includes:

[0148] The first state determination duration calculation module is used to determine the duration of the user's stay on the target page when the user's current state on the target page is either first login or logged out. In this case, the duration of the stay on the target page is equal to the duration of the stay on the historical page plus the minimum interval between consecutive logins.

[0149] In one embodiment, the first state determination duration calculation module includes:

[0150] The query unit is used to retrieve the previous state of a user identifier on the target webpage from the event log;

[0151] The first state determination duration calculation unit is used to determine that if the previous state of the user identifier on the target webpage is not found in the event log, the current state of the user identifier on the target webpage is considered to be the first login state.

[0152] The second state determination duration calculation unit is used to determine that if the previous state of the user identifier on the target webpage is found in the event log and the previous state is a logout state, then the current state of the user identifier on the target webpage is considered to be a logout state.

[0153] In one embodiment, the page dwell time counting device further includes:

[0154] The second state determination duration calculation module determines the duration of the user's stay on the target page by calculating the duration of the stay on the historical page if the user's current state on the target page is logged out and the previous state was logged out.

[0155] The various modules in the aforementioned page dwell time statistics device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0156] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores page dwell time statistics. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a page dwell time statistics method.

[0157] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0158] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0159] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0160] Obtain the current login state and corresponding timestamp of the user identifier on the target webpage, and the previous login state and corresponding timestamp of the user identifier on the target webpage; calculate a first difference between the timestamp corresponding to the current login state of the user identifier on the target webpage and the timestamp corresponding to the previous login state of the user identifier on the target webpage; if the first difference is less than the minimum consecutive login interval, the dwell time on the target page is equal to the dwell time on the historical page; if the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, the dwell time on the target page is equal to the dwell time on the historical page plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval; if the first difference is greater than the maximum consecutive login interval, the dwell time on the target page is equal to the dwell time on the historical page plus the minimum consecutive login interval.

[0161] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0162] Obtain the user identifier's current state on the target webpage as logged out and its corresponding timestamp, and its previous state as logged in and its corresponding timestamp; calculate a second difference between the timestamp corresponding to the user identifier's current state as logged out and the timestamp corresponding to the user identifier's previous state as logged in; if the second difference is less than or equal to a preset duration from login to logout, then the target page dwell time is equal to the historical page dwell time plus the second difference minus the minimum interval between consecutive logins; if the second difference is greater than the preset duration from login to logout, then the target page dwell time is equal to the historical page dwell time plus the preset duration from login to logout.

[0163] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0164] Query the event log to find the previous state of the user identifier on the target webpage and the corresponding timestamp.

[0165] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0166] If the user's current state on the target webpage is either first login or logged out, then the duration of stay on the target page is equal to the duration of stay on historical pages plus the minimum interval between consecutive logins.

[0167] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0168] The event log is used to query the previous state of the user identifier on the target webpage. If the previous state of the user identifier on the target webpage is not found in the event log, the current state of the user identifier on the target webpage is considered to be the first login state. If the previous state of the user identifier on the target webpage is found in the event log, and the previous state is the logout state, the current state of the user identifier on the target webpage is considered to be the logged-out state.

[0169] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0170] If the user identifier is found to be logged out in both the current and previous states on the target webpage, then the duration of stay on the target page is equal to the duration of stay on the historical pages.

[0171] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0172] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0173] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0174] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0175] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0176] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for calculating page dwell time, characterized in that, The method includes: Obtain the user's current login status and corresponding timestamp on the target webpage, and the previous login status and corresponding timestamp. Calculate the first difference between the timestamp corresponding to the current state of the user identifier being logged in on the target webpage and the timestamp corresponding to the previous state of the user identifier being logged in on the target webpage; If the first difference is less than the minimum interval between consecutive logins, then the dwell time on the target webpage is equal to the dwell time on the historical page. If the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, then the duration of stay on the target webpage is equal to the duration of stay on the historical page plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval. If the first difference is greater than the longest consecutive login interval, then the duration of stay on the target webpage is equal to the duration of stay on the historical page plus the shortest consecutive login interval.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the user's current state on the target webpage as logged out and the corresponding timestamp, and the previous state as logged in and the corresponding timestamp. Calculate the second difference between the timestamp corresponding to the current state of the user identifier on the target webpage being logged out and the timestamp corresponding to the previous state of the user identifier on the target webpage being logged in; If the second difference is less than or equal to the preset time from login to logout, then the target webpage dwell time is equal to the historical page dwell time plus the second difference minus the minimum interval time for consecutive logins; If the second difference is greater than the preset time from login to logout, then the dwell time on the target webpage is equal to the dwell time on the historical page plus the preset time from login to logout.

3. The method according to claim 1 or 2, characterized in that, The method further includes: Query the event log to find the previous state of the user identifier on the target webpage and the corresponding timestamp.

4. The method according to claim 1, characterized in that, The method further includes: If the user's current state on the target webpage is either first login or logged out, then the duration of stay on the target webpage is equal to the duration of stay on historical pages plus the minimum interval between consecutive logins.

5. The method according to claim 4, characterized in that, The methods for obtaining the user identifier's current state on the target webpage, whether it is a first login state or a logged-out state, include: Retrieve the user identifier from the event log to its previous state on the target webpage; If the previous state of the user identifier on the target webpage is not found in the event log, then the current state of the user identifier on the target webpage is considered to be the first login state. If the event log shows a previous state of the user identifier on the target webpage where the previous state was logged out, then the current state of the user identifier on the target webpage is considered to be logged out.

6. The method according to claim 1, characterized in that, The method further includes: If the user identifier is found to be logged out in both the current and previous states on the target webpage, then the duration of stay on the target webpage is equal to the duration of stay on the historical pages.

7. A device for calculating page dwell time, characterized in that, The device includes: The first acquisition module is used to acquire the user's current state as logged in and the corresponding timestamp on the target webpage, as well as the previous state as logged in and the corresponding timestamp. The first calculation module is used to calculate a first difference between the timestamp corresponding to the current state of the user identifier on the target webpage being logged in and the timestamp corresponding to the previous state of the user identifier on the target webpage being logged in. The first judgment module is used to determine if the first difference is less than the minimum interval between consecutive logins, and the dwell time of the target webpage is equal to the dwell time of the historical page. The second judgment module is used to determine that if the first difference is greater than the minimum consecutive login interval and less than or equal to the maximum consecutive login interval, the duration of the target webpage stay is equal to the duration of the historical page stay plus the first difference; wherein the minimum consecutive login interval is less than the maximum consecutive login interval. The third judgment module is used to determine that if the first difference is greater than the longest consecutive login interval, the duration of the target webpage stay is equal to the duration of the historical page stay plus the shortest consecutive login interval.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of 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, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Learning duration calculation method and system

    CN115660910A

  • Maintenance system and method for correctly displaying the on-line user information on a web system

    TW200709608A