A user behavior path generation method and device, electronic equipment and storage medium

CN115757072BActive Publication Date: 2026-08-21BEIJING PACTERA JINXIN TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211477759.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-23
Publication Date
2026-08-21
Estimated Expiration
2042-11-23

AI Technical Summary

Technical Problem

[0004]有鉴于此,本申请的目的在于提供一种用户行为路径生成方法、装置、电子设备及存储介质,以解决用户行为路径描述不准确的问题

Benefits of technology

[0025] This application provides a user behavior path generation method, apparatus, electronic device, and storage medium that can simultaneously monitor the loading status of an H5 page view and the lifecycle changes of a target container. By monitoring the lifecycle changes of the target container, it determines whether to trigger a page background event or a page browsing event corresponding to the target container. In other words, it binds the browsing event of the H5 page to the lifecycle of the target container. Then, based on the triggering of the page background event or page browsing event, it obtains the current page path and the previous page address to generate a user behavior path. Even when the user stops browsing the current application and switches to browsing other applications or the mobile device is in a locked state, it can still generate the user's browsing behavior path for the current application. Compared with existing user behavior path generation methods, this solves the problem of inaccurate user behavior path description.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757072B_ABST
    Figure CN115757072B_ABST
Patent Text Reader

Abstract

The application provides a user behavior path generation method and device, electronic equipment and storage medium. The method comprises the following steps: selecting a target container from a plurality of candidate containers, loading a webpage view on the target container, and using the webpage view to carry an H5 page of a user operation; simultaneously listening to loading conditions of the webpage view and life cycle change conditions of the target container, and obtaining a first listening result and a second listening result; triggering a page pressure background event and a page browsing event based on the first listening result, and triggering the page pressure background event or the page browsing event based on the second listening result; if the page pressure background event or the page browsing event is triggered, obtaining a current page path and a forward page address of the current page; and generating a user behavior path by using the current page path and the forward page address. By using the above-mentioned user behavior path generation method, device, electronic equipment and storage medium, the problem of inaccurate description of the user behavior path is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and more specifically, to a user behavior path generation method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the rapid development of internet technology, user behavior path analysis is increasingly used in the daily operation of mobile applications to uncover user access patterns in order to improve the reach rate of core modules and optimize product design. In existing technologies, application servers can record the URL information of the web pages visited by users each time. When analyzing user behavior paths, the recorded URL information can be used to determine the user's navigation path between the various web pages visited.

[0003] However, the above method of recording URL information cannot effectively record whether the user is browsing the current application's page when the user stops browsing the current application and starts browsing other applications or when the mobile device is in a locked state, resulting in inaccurate description of the user's behavior path. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a user behavior path generation method, apparatus, electronic device and storage medium to solve the problem of inaccurate user behavior path description.

[0005] In a first aspect, embodiments of this application provide a user behavior path generation method, including:

[0006] Select the target container from multiple candidate containers, load the web page view on the target container, and use the web page view to carry the H5 page of user operation;

[0007] Simultaneously monitor the loading status of the webpage view and the lifecycle changes of the target container, and obtain the first monitoring result and the second monitoring result respectively;

[0008] The first listener result triggers a page background event and a page browsing event, and the second listener result triggers either a page background event or a page browsing event.

[0009] If a background event or a page browsing event is triggered, obtain the current page path and the address of the page preceding the current page.

[0010] Generate the user behavior path using the current page path and the previous page address.

[0011] Optionally, the loading status of the webpage view and the lifecycle changes of the target container are monitored simultaneously, and a first monitoring result and a second monitoring result are obtained respectively, including: monitoring the page completion loading method of the webpage view to determine whether the front-end page address has changed; taking the change of the front-end page address as the first monitoring result; monitoring the return method and pause method in the lifecycle of the target container to determine whether the return method and pause method are triggered; taking the triggering of the return method and pause method as the second monitoring result.

[0012] Optionally, triggering a page background event and a page browsing event based on the first listener result, and triggering a page background event or a page browsing event based on the second listener result, includes: if the first listener result is that the front-end page address has changed, triggering a page background event and a page browsing event in sequence; if the second listener result is that the return method is triggered, triggering a page browsing event; if the second listener result is that the pause method is triggered, triggering a page background event.

[0013] Optionally, if a page push-to-the-background event or a page browsing event is triggered, obtaining the current page path and the previous page address of the current page includes: if the first listener result is that the front-end page address has changed, after triggering the page push-to-the-background event, obtaining the current page path and the previous page address of the current page from the first data item and the second data item respectively, where the first data item is used to store the current page path and the second data item is used to store the previous page address; after triggering the page browsing event, using the front-end page address as the current page path, obtaining the previous page address of the current page from the first data item; if the second listener result is that a return method or a pause method is triggered, after triggering the page push-to-the-background event or the page browsing event, obtaining the current page path and the previous page address of the current page from the first data item and the second data item respectively.

[0014] Optionally, after using the front-end page address as the current page path and obtaining the forward page address of the current page from the first data item, the method further includes: using the value of the first data item in memory as the value of the second data item; using the front-end page address as the value of the first data item; obtaining the current time and storing the current time in the third data item in memory, wherein the third data item is used to store the current time.

[0015] Optionally, after triggering the page background event, the method also includes: obtaining the current time and the time in the third data item; and using the difference between the current time and the time in the third data item as the page browsing time.

[0016] Secondly, embodiments of this application also provide a user behavior path generation device, the device comprising:

[0017] The container selection module is used to select a target container from multiple candidate containers, load a web page view on the target container, and use the web page view to carry the H5 page of user operation;

[0018] The listening module is used to simultaneously monitor the loading status of the webpage view and the lifecycle changes of the target container, and obtain the first listening result and the second listening result respectively;

[0019] The event triggering module is used to trigger a page background event and a page browsing event based on the first listener result, and to trigger a page background event or a page browsing event based on the second listener result.

[0020] The address acquisition module is used to obtain the current page path and the address of the previous page if a page is pressed in the background or a page browsing event is triggered.

[0021] The path generation module is used to generate user behavior paths using the current page path and the previous page address.

[0022] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the user behavior path generation method described above are performed.

[0023] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the user behavior path generation method described above.

[0024] The embodiments of this application bring the following beneficial effects:

[0025] This application provides a user behavior path generation method, apparatus, electronic device, and storage medium that can simultaneously monitor the loading status of an H5 page view and the lifecycle changes of a target container. By monitoring the lifecycle changes of the target container, it determines whether to trigger a page background event or a page browsing event corresponding to the target container. In other words, it binds the browsing event of the H5 page to the lifecycle of the target container. Then, based on the triggering of the page background event or page browsing event, it obtains the current page path and the previous page address to generate a user behavior path. Even when the user stops browsing the current application and switches to browsing other applications or the mobile device is in a locked state, it can still generate the user's browsing behavior path for the current application. Compared with existing user behavior path generation methods, this solves the problem of inaccurate user behavior path description.

[0026] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0027] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 A flowchart of the user behavior path generation method provided in an embodiment of this application is shown;

[0029] Figure 2 A flowchart illustrating the user behavior path generation process provided in an embodiment of this application is shown;

[0030] Figure 3 A schematic diagram of the user behavior path generation device provided in an embodiment of this application is shown;

[0031] Figure 4 A schematic diagram of the structure of the electronic device provided in the embodiments of this application is shown. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.

[0033] It is worth noting that prior to this application, with the rapid development of internet technology, user behavior path analysis was increasingly used in the daily operation of mobile applications to uncover user access patterns in order to improve the reach of core modules and optimize product design. In existing technologies, application servers can record the URL information of the web pages visited by users each time. When analyzing user behavior paths, the recorded URL information can be used to determine the user's navigation path between the visited web pages. However, this method of recording URL information cannot effectively record whether the user is browsing the current application's page when they are no longer browsing the current application or are browsing other applications, or when the mobile device is locked, leading to inaccurate descriptions of user behavior paths.

[0034] Based on this, embodiments of this application provide a user behavior path generation method to improve the accuracy of describing user behavior paths.

[0035] Please see Figure 1 , Figure 1 This is a flowchart illustrating a user behavior path generation method provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the user behavior path generation method includes:

[0036] Step S101: Select a target container from multiple candidate containers, load a web page view on the target container, and use the web page view to carry the H5 page of user operation.

[0037] In this step, the container can refer to a container control. For example, for Android, the container can be an Activity container, and for iOS, the container can be a Control container.

[0038] Candidate containers refer to containers used by a particular application on a mobile device. For example, on a mobile device with the Android operating system installed, a particular application on that device displays pages using multiple containers, and these containers are candidate containers.

[0039] The target container can refer to the container used to display the H5 page; the target container is one of the candidate containers.

[0040] A web view can refer to the WebView component, which is used to host H5 pages.

[0041] In this embodiment, a mobile application displays a page using multiple candidate containers. One container is selected as the target container from these candidates and identified, for example, by determining its name. A WebView component is then loaded into the target container. When a user clicks a button or page element in the application to trigger the display of an H5 page, the target container is located using its identified name, and the H5 page is displayed using the WebView component on that target container.

[0042] In an optional embodiment, the method further includes: disabling the triggering of native browsing events corresponding to the target container.

[0043] Here, native browsing events can refer to the browsing events corresponding to the target container. Native browsing events are different from web page browsing events, which are the browsing events corresponding to H5 pages.

[0044] Specifically, the target container itself is also a native page, which is developed using the native system kernel. To avoid generating redundant data, the triggering of native browsing events corresponding to the target container can be blocked. That is, native browsing events for this Activity will no longer be triggered, and data such as the current page path and the previous page address corresponding to the native browsing events will not be collected.

[0045] Step S102: Simultaneously monitor the loading status of the webpage view and the lifecycle changes of the target container, and obtain the first monitoring result and the second monitoring result respectively.

[0046] In this step, the loading status refers to the changes in the loaded H5 pages in the webpage view. The loading status is used to determine whether a new H5 page is displayed in the webpage view.

[0047] Lifecycle changes refer to the changes in visibility of the target container. Lifecycle changes are used to reflect whether the target container carrying the H5 page is in a display state.

[0048] The first monitoring result can refer to the result of monitoring whether the loaded H5 page in the webpage view has changed.

[0049] The second monitoring result can refer to whether the lifecycle of the target container has changed.

[0050] In this embodiment, the loading status of the webpage view and the lifecycle changes of the target container are monitored simultaneously. A first monitoring result is obtained when monitoring the loading status of the webpage view, and a second monitoring result is obtained when monitoring the lifecycle changes of the target container. Specifically, monitoring the loading status of the webpage view primarily involves listening for whether an H5 page redirect occurs, and monitoring the lifecycle changes of the target container primarily involves listening for events such as screen turning off, browsing other applications, or returning to the main interface.

[0051] In one optional embodiment, the loading status of the webpage view and the lifecycle changes of the target container are monitored simultaneously, and a first monitoring result and a second monitoring result are obtained respectively, including: monitoring the page completion loading method of the webpage view to determine whether the front-end page address has changed; taking the change of the front-end page address as the first monitoring result; monitoring the return method and pause method in the lifecycle of the target container to determine whether the return method and pause method are triggered; taking the triggering of the return method and pause method as the second monitoring result.

[0052] Here, the page completion loading method can refer to either the onPageFinished method or the locationHash method. OnPageFinished corresponds to the Android operating system, while locationHash corresponds to the iOS operating system.

[0053] The front-end page address refers to the address of the H5 page currently displayed by the application, and the front-end page address can be obtained from the page's loading method.

[0054] The method to return can be either the onActivityResume method or the viewWillAppear method. The onActivityResume method corresponds to the Android operating system, while the viewWillAppear method corresponds to the iOS operating system.

[0055] The pause method can refer to either the onActivityPaused method or the applicationWillResignActive method. The onActivityPaused method corresponds to the Android operating system, while the applicationWillResignActive method corresponds to the iOS operating system.

[0056] The following reference Figure 2 This section will introduce the process of generating user behavior paths.

[0057] Figure 2 A flowchart of the user behavior path generation process provided in an embodiment of this application is shown.

[0058] like Figure 2 As shown, after selecting the target container in step S200, step S210 can be executed to listen for the page completion loading method of the webpage view, and step S220 can be executed to listen for the lifecycle of the target container.

[0059] After executing step S210, step S211 is executed to determine if the front-end page address has changed. If the front-end page address has changed, steps S212 and S213 are executed sequentially; otherwise, the process ends. When executing step S220 to monitor the target container's lifecycle, it is determined whether the return method and pause method are triggered. If the return method is triggered, step S222 is executed to trigger the page browsing event and determine the values ​​of `url` and `ref_url`. If the pause method is triggered, step S221 is executed to trigger the page background event and determine the values ​​of `url`, `ref_url`, and browsing time.

[0060] When listening for page loading completion, taking Android as an example, listen to the `onPageFinished` method of the WebView component to determine if the front-end page address (location) has changed. If the front-end page address has not changed, the process ends. Taking iOS as an example, add a `locationHash` (change subscription) method to the WebView component, listen to the `locationHash` method of the WebView component, and determine if the front-end page address (location) has changed. If the front-end page address has not changed, the process ends.

[0061] When monitoring the lifecycle of a target container, taking the Android operating system as an example, we listen for the `onActivityResume` and `onActivityPaused` methods. If `onActivityResume` is triggered, the target container is visible; if `onActivityPaused` is triggered, the target container is not visible. Taking the iOS operating system as an example, we listen for the `viewWillAppear` and `applicationWillResignActive` methods. If `viewWillAppear` is triggered, the target container is visible; if `applicationWillResignActive` is triggered, the target container is not visible.

[0062] Step S103: Trigger a page background event and a page browsing event based on the first listening result, and trigger a page background event or a page browsing event based on the second listening result.

[0063] In this step, the "Push to Background" event is used to push the H5 page into the background, making it invisible to the user.

[0064] Page view events are used to display the page after an H5 redirect, making it visible to the user.

[0065] In this embodiment, if the first listening result detects a change in the H5 page, a page push-to-the-background event and a page browsing event are triggered sequentially. If the second listening result detects that the target container is invisible, for example, when the mobile device is off or returns to the main interface, the target container is invisible, then a page push-to-the-background event is triggered; if the second listening result detects that the target container is visible, then a page browsing event is triggered.

[0066] In one optional embodiment, triggering a page background event and a page browsing event based on a first listening result, and triggering a page background event or a page browsing event based on a second listening result, includes: if the first listening result is that the front-end page address has changed, triggering a page background event and a page browsing event in sequence; if the second listening result is triggered by a return method, triggering a page browsing event; if the second listening result is triggered by a pause method, triggering a page background event.

[0067] like Figure 2 As shown, step S211 determines whether the front-end page address (location) has changed. If the front-end page address has not changed, the process ends. If the front-end page address has changed, step S212 is executed sequentially to trigger the page push background event, determine the values ​​of url, ref_url and browsing time, and then step S213 is executed to trigger the page browsing event, determine the values ​​of url and ref_url.

[0068] When executing step S220 and listening to the lifecycle of the target container, if the onActivityResume method is triggered, it indicates that the target container is visible. Then, execute step S222 to trigger the page browsing event and determine the values ​​of url and ref_url. If the onActivityPaused method is triggered, it indicates that the target container is not visible. Then, execute step S221 to trigger the page background event and determine the values ​​of url, ref_url, and browsing time.

[0069] Step S104: If a background event or page browsing event is triggered, obtain the current page path and the address of the previous page of the current page.

[0070] In this step, the current page path can refer to the page address of the current H5 page, which is denoted as url.

[0071] The forward page address can refer to the address of the previous page of the current H5 page. The forward page address is used to indicate which page the current H5 page is redirected from. The forward page address is denoted as: ref_url.

[0072] In this embodiment of the application, whether the page push-back event is triggered or the page browsing event is triggered, it is necessary to obtain the current page path and the previous page address in order to generate the user behavior path using the obtained current page path and the previous page address.

[0073] In one optional embodiment, if a page push-to-the-background event or a page browsing event is triggered, obtaining the current page path and the previous page address of the current page includes: if the first listening result is that the front-end page address has changed, after triggering the page push-to-the-background event, obtaining the current page path and the previous page address of the current page from the first data item and the second data item respectively, wherein the first data item is used to store the current page path and the second data item is used to store the previous page address; after triggering the page browsing event, using the front-end page address as the current page path, obtaining the previous page address of the current page from the first data item; if the second listening result is that a return method is triggered or a pause method is triggered, after triggering the page push-to-the-background event or the page browsing event, obtaining the current page path and the previous page address of the current page from the first data item and the second data item respectively.

[0074] Here, the first data item can refer to the data item used to store the value of the current page path URL, denoted as: referrer_url.

[0075] The second data item can refer to the data item used to store the value of the forward page address ref_url, denoted as: pageLevae_referrer.

[0076] Specifically, `referrer_url` and `pageLevae_referrer` have been created in the mobile device's memory to store `url` and `ref_url`, respectively. When listening to the webpage view, if it is determined that the front-end page address has changed and a page push event is triggered, then `url` is taken from the memory value of `referrer_url`, and `ref_url` is taken from the memory value of `pageLevae_referrer`. Then, after the page view event is triggered, the current H5 page's location value is used as the value of `url` (i.e., `url` takes the location value), and the value of `ref_url` is retrieved from `referrer_url` (i.e., `ref_url` takes the memory value of `referrer_url`). This is because at this time, the value of the latest displayed H5 page and the previous page address have not yet been updated in `referrer_url` and `pageLevae_referrer`.

[0077] When monitoring the lifecycle of the target container, if it is determined that a return method will be triggered, then after triggering the page view event, the value of `url` is retrieved from `referrer_url` (i.e., `url` is taken from the memory `referrer_url` value), and the value of `ref_url` is retrieved from `pageLevae_referrer` (i.e., `ref_url` is taken from the memory `pageLevae_referrer` value). Similarly, if it is determined that a pause method will be triggered, then after triggering the page push-to-the-background event, the value of `url` is retrieved from `referrer_url` (i.e., `url` is taken from the memory `referrer_url` value), and the value of `ref_url` is retrieved from `pageLevae_referrer` (i.e., `ref_url` is taken from the memory `pageLevae_referrer` value).

[0078] like Figure 2 As shown, when executing step S212, not only is the page pushed to the background event triggered, but the value in the referrer_url in memory is also used as the value of the URL, and the value of pageLevae_referrer is used as the value of ref_url; when executing step S213, not only is the page browsing event triggered, but the location value is also used as the value of the URL, and the value in referrer_url is used as the value of ref_url; when executing step S221, not only is the page pushed to the background event triggered, but the value in the referrer_url in memory is also used as the value of the URL, and the value of pageLevae_referrer is used as the value of ref_url; when executing step S222, not only is the page browsing event triggered, but the value in the referrer_url in memory is also used as the value of the URL, and the value of pageLevae_referrer is used as the value of ref_url.

[0079] In an optional embodiment, after obtaining the forward page address of the current page from the first data item by using the front-end page address as the current page path, the method further includes: using the value of the first data item in memory as the value of the second data item; using the front-end page address as the value of the first data item; obtaining the current time and storing the current time in a third data item in memory, wherein the third data item is used to store the current time.

[0080] Here, the third data item can refer to the data item used to store the current time, and the third data item is denoted as: enerPageTime.

[0081] Specifically, after obtaining the current page path and the previous page address, the contents of the first and second data items need to be updated. The address of the newly displayed H5 page, i.e., the value of `location`, needs to be stored in the first data item. Simultaneously, the value originally stored in the first data item is stored as the previous page address in the second data item. At the same time, the latest current time is obtained and stored in the third data item in memory.

[0082] like Figure 2 As shown, after executing step S213, step S214 is executed to obtain and store the current time, the previous page address, and the current page path. Here, the new Date() function is used to obtain the current time and store it in enterPageTime (i.e., store the current time: enterPageTime = new Date()); in addition, the value of referrer_url in memory is stored in pageLeave_referrer (i.e., store the previous page address: pageLeave_referrer = memory referrer_url value), and the location value is stored in referrer_url (i.e., store the current page path: referrer_url = location value).

[0083] In an optional embodiment, after triggering the page background event, the method further includes: obtaining the current time and the time in the third data item; and using the difference between the current time and the time in the third data item as the page browsing duration.

[0084] Here, the time in the third data item is the time obtained after the page browsing event is triggered. This time is the time when the new H5 page opens. The current time obtained after the page push to the background event is the time when the new H5 page is pushed to the background. Therefore, subtracting the time in the third data item from the current time gives the duration from when the new H5 page opens to when it is pushed to the background, which is the browsing time of the user on the new H5 page.

[0085] like Figure 2 As shown, in steps S212 and S221, after triggering the page background event and determining the url and ref_url, the difference between the current time and the time in the third data item will also be used as the browsing time.

[0086] At the same time, after executing step S222, step S223 will also be executed to obtain and store the current time. The current time is obtained by using the newDate function and stored in enterPageTime (i.e., storing the current event: enterPageTime = new Date()).

[0087] Step S105: Generate the user behavior path using the current page path and the previous page address.

[0088] In this step, the user behavior path can refer to the path corresponding to the user's browsing behavior in the application. The user behavior path consists of multiple page addresses with forward and backward navigation relationships.

[0089] In this embodiment of the application, an example is taken where an H5 page opens page A at time a, jumps from page A to page B at time b, turns off the screen at time c, opens the application at time d, and finally jumps from page B to page E at time e.

[0090] After navigating from page A to page B, the values ​​of url and ref_url are obtained respectively: url = referrer_url = B, ref_url = pageLevae_referrer = A. The current time b is obtained, and referrerPageTime = a, where ba is the browsing time of page A. At this point, a behavior path A→B is generated based on the values ​​of url and ref_url.

[0091] When the screen is off, first listen to the target container's lifecycle to confirm that `onActivityPaused` has been triggered. Then, trigger the page push-to-the-background event and obtain the values ​​of `url` and `ref_url`. At this point, `url = referrer_url = B`, `ref_url = pageLevae_referrer = A`, and display page B based on the value of `url`. Then, when listening to the WebView, find that the location has not changed, the process ends. At this point, generate a second behavior path A→B based on the values ​​of `url` and `ref_url`.

[0092] When the application is opened, the lifecycle of the target container is first monitored to determine if `onActivityResume` is triggered. Then, a page view event is triggered, and the values ​​of `url` and `ref_url` are obtained, resulting in `url = B` and `ref_url = B`. The current time is obtained as `d`, and `interPageTime = d`. Then, when monitoring the WebView, it is found that the location has not changed, and the process ends. At this point, a third action path, B→B, is generated based on the values ​​of `url` and `ref_url`.

[0093] When transitioning from page B to page E, the lifecycle of the target container is first monitored. It is confirmed that neither the `onActivityResume` nor `onActivityPaused` methods are triggered, so the values ​​of `url` and `ref_url` are not retrieved. However, when monitoring the WebView, a change in location is detected. Therefore, the page is first pushed to the background event, obtaining `url = B` and `ref_url = B`. Then, the page browsing event is triggered, using the current page E as the value of `url`, i.e., `url = E` and `ref_url = B`. Next, the current time `e` is retrieved, and `respectPageTime = d`, where `ed` is the browsing time between page B and page E. Finally, the value of the first data item is used as the value of the second data item, `pageLevae_referrer` changes from B to B, and the front-end page address `E` is used as the value of the first data item, i.e., `referrer_url = E`. At this point, a third behavioral path B→E is generated based on the values ​​of `url` and `ref_url`.

[0094] The user behavior path is composed of the aforementioned multiple behavior path pairs A→B, A→B, B→B, and B→E. Since there are two repeated A→B behavior path pairs, we know that a screen-off or return to the home screen action occurred. The B→B behavior path pair indicates that the application was opened again to view page B. The B→E behavior path pair indicates a jump from page B to page E. Furthermore, the page browsing time for the A→B and B→E paths can be accurately determined.

[0095] Compared with existing user behavior path generation methods, this application can simultaneously monitor the loading status of the H5 page view and the lifecycle changes of the target container. By monitoring the lifecycle changes of the target container, it determines whether to trigger the corresponding page background event or page browsing event. In other words, it binds the browsing event of the H5 page with the lifecycle of the target container. Then, based on the triggering of the page background event or page browsing event, it obtains the current page path and the previous page address to generate the user behavior path. Even when the user stops browsing the current application and switches to browsing other applications or the mobile device is in a locked state, the user's browsing behavior path for the current application can still be generated, solving the problem of inaccurate description of user behavior paths.

[0096] Based on the same inventive concept, this application also provides a user behavior path generation device corresponding to the user behavior path generation method. Since the principle of the device in this application is similar to the user behavior path generation method described above in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0097] Please see Figure 3 , Figure 3 This is a schematic diagram of a user behavior path generation device provided in an embodiment of this application. Figure 3 As shown, the user behavior path generation device 300 includes:

[0098] The container selection module 301 is used to select a target container from multiple candidate containers, load a web page view on the target container, and use the web page view to carry the H5 page of user operation.

[0099] The listening module 302 is used to simultaneously monitor the loading status of the web page view and the lifecycle changes of the target container, and obtain the first listening result and the second listening result respectively.

[0100] Event triggering module 303 is used to trigger a page background event and a page browsing event based on the first listening result, and to trigger a page background event or a page browsing event based on the second listening result;

[0101] The address acquisition module 304 is used to obtain the current page path and the address of the previous page if a page is triggered by a background event or a page browsing event.

[0102] The path generation module 305 is used to generate user behavior paths using the current page path and the previous page address.

[0103] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.

[0104] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, they can perform the operations described above. Figure 1 The steps of the user behavior path generation method in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0105] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the user behavior path generation method in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.

[0106] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0107] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0108] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0109] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0110] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0111] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for generating user behavior paths, characterized in that, include: Select a target container from multiple candidate containers, load a webpage view on the target container, and use the webpage view to carry the H5 page of user operation; Simultaneously monitor the loading status of the webpage view and the lifecycle changes of the target container, and obtain the first monitoring result and the second monitoring result respectively; The first listening result triggers a page background event and a page browsing event, and the second listening result triggers either a page background event or a page browsing event. If a background event or a page browsing event is triggered, obtain the current page path and the address of the page preceding the current page. Using the current page path and the previous page address, a user behavior path is generated; The simultaneous monitoring of the loading status of the webpage view and the lifecycle changes of the target container, and the acquisition of the first monitoring result and the second monitoring result respectively, includes: Listen for the page completion loading method of the webpage view to determine if the front-end page address has changed; The first monitoring result is whether the front-end page address has changed. Monitor the return and pause methods in the lifecycle of the target container to determine whether the return and pause methods are triggered. Whether the return method and the pause method are triggered is used as the second listening result.

2. The method according to claim 1, characterized in that, The triggering of a page background event and a page browsing event based on the first monitoring result, and the triggering of a page background event or a page browsing event based on the second monitoring result, include: If the first listening result indicates that the front-end page address has changed, the page push-to-background event and the page browsing event will be triggered sequentially. If the second listener result is a method re-return trigger, then trigger the page browsing event; If the second listener result is a pause method trigger, then trigger the page background event.

3. The method according to claim 2, characterized in that, If a background event or page browsing event is triggered, the current page path and the address of the page preceding the current page are obtained, including: If the first listening result is that the front-end page address has changed, after triggering the page push-to-back-end event, the current page path and the previous page address of the current page are obtained from the first data item and the second data item respectively. The first data item is used to store the current page path and the second data item is used to store the previous page address. After the page browsing event is triggered, the front-end page address is used as the current page path, and the previous page address of the current page is obtained from the first data item; If the second listening result is a return method trigger or a pause method trigger, after triggering the page background event or page browsing event, obtain the current page path and the previous page address of the current page from the first data item and the second data item respectively.

4. The method according to claim 3, characterized in that, After obtaining the forward page address of the current page from the first data item by using the front-end page address as the current page path, the method further includes: Use the value of the first data item in memory as the value of the second data item; Use the front-end page address as the value of the first data item; Obtain the current time and store it in a third data item in memory, the third data item being used to store the current time.

5. The method according to claim 3, characterized in that, After triggering the page background event, the following is also included: Get the current time and the time in the third data item; The difference between the current time and the time in the third data item is used as the page browsing time.

6. A user behavior path generation device, characterized in that, include: The container selection module is used to select a target container from multiple candidate containers, load a web page view on the target container, and use the web page view to carry the H5 page of user operation; The monitoring module is used to simultaneously monitor the loading status of the webpage view and the lifecycle changes of the target container, and obtain the first monitoring result and the second monitoring result respectively. The event triggering module is used to trigger a page background event and a page browsing event based on the first listening result, and to trigger a page background event or a page browsing event based on the second listening result; The address acquisition module is used to obtain the current page path and the address of the previous page if a page is pressed in the background or a page browsing event is triggered. The path generation module is used to generate a user behavior path using the current page path and the previous page address; The monitoring module is specifically used for: Listen for the page completion loading method of the webpage view to determine if the front-end page address has changed; The first monitoring result is whether the front-end page address has changed. Monitor the return and pause methods in the lifecycle of the target container to determine whether the return and pause methods are triggered. Whether the return method and the pause method are triggered is used as the second listening result.

7. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the user behavior path generation method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the user behavior path generation method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • H5 page loading method and device, equipment and storage medium

    CN113326080A

  • Page positioning method and device, electronic equipment and storage medium

    CN114721758A