User behavior tracking method and device, storage medium and terminal
By deploying a monitoring resident process in the terminal and using hook monitoring functions, user behavior can be tracked directly from the application layer, solving the problem of difficulty in capturing user behavior in existing technologies, achieving lightweight, real-time and accurate user behavior tracking, and improving user experience and terminal response speed.
Patent Information
- Application Number
- CN202410302821.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2025-09-16
AI Technical Summary
Existing technologies make it difficult to accurately capture user behavior on the computer side, especially behaviors such as searching for keywords in the browser and opening files again, and common methods rely on driver loss performance.
By deploying a monitoring resident process in the terminal, using hook monitoring functions and preset timers to monitor window features, tracking user behavior directly from the application layer, judging whether the window features contain specified features and executing corresponding actions, it adapts to different monitoring schemes for browser and non-browser windows.
It achieves lightweight, real-time and accurate capture of user behavior, improves user experience and terminal response speed, reduces dependence on drivers, and enhances the immediacy and reliability of user behavior tracking.
Smart Images

Figure CN120653518A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, storage medium, and terminal for tracking user behavior. Background Art
[0002] In the digital age, data has become a key driver of development. Within this vast amount of data, gaining a deep understanding of user behavior and consumer decision-making processes is crucial. User behavior data tracking is a key tool for gaining insight into user behavior and decision-making. When user behavior data is fully organized, analyzed, and effectively utilized, it helps provide users with more products and information that meet their needs. Therefore, a user behavior tracking method is needed to track user behavior and usage activities on websites, applications, or services, analyze user behavior within the service, and provide personalized content to users. Summary of the Invention
[0003] The present application provides a user behavior tracking method, device, storage medium and terminal, which can solve the technical problem of difficulty in capturing user behavior in related technologies.
[0004] In a first aspect, an embodiment of the present application provides a user behavior tracking method, the method comprising:
[0005] When a target user behavior targeting a window is monitored, a target window feature of the window is obtained;
[0006] Determining whether the target window features include specified window features;
[0007] If the target window features include the designated window features, a designated action corresponding to the designated window features is executed.
[0008] In a preferred embodiment, the acquiring the target window feature of the window includes: acquiring first identification information corresponding to the window, and determining the target window feature of the window based on the first identification information.
[0009] In a preferred embodiment, after obtaining the target window characteristics of the window, it also includes: judging whether the window is a browser window based on the target window characteristics; if the window is a non-browser window, executing the step of judging whether the target window characteristics include specified window characteristics; if the window is a browser window, monitoring the change state of the second identification information of the window based on a preset timer, and monitoring user behavior based on the change state; wherein, all browser windows in the same browser have the same first identification information.
[0010] In a preferred embodiment, the monitoring of the change status of the second identification information of the window based on a preset timer and monitoring of user behavior according to the change status include: monitoring whether the second identification information of the window changes based on a preset timer; if the second identification information changes, determining that the target user behavior occurs; obtaining the target window characteristics of the window and judging whether the target window characteristics include the specified window characteristics include: obtaining the changed target window characteristics of the window after the second identification changes and judging whether the changed target window characteristics include the specified window characteristics.
[0011] In a preferred embodiment, if the target window characteristics include the specified window characteristics, executing the specified action corresponding to the specified window characteristics includes: if the target window characteristics include the specified window characteristics, determining the specified action corresponding to the specified window characteristics according to a preset behavior processing rule; and executing the specified action.
[0012] In a preferred embodiment, when the target user behavior for the window is monitored, before obtaining the target window information of the window, it also includes: setting a hook monitoring function corresponding to the target user behavior, and monitoring the user behavior based on the hook monitoring function.
[0013] In a preferred embodiment, the type of the window feature is at least one of the name of the process to which the window belongs, the window class name, the window title, and the command line of the process to which the window belongs.
[0014] In a second aspect, an embodiment of the present application provides a user behavior tracking device, the device comprising:
[0015] An information tracking module, configured to obtain target window features of a window when a target user behavior targeting a window is detected;
[0016] A behavior judgment module, configured to judge whether the target window features include specified window features;
[0017] The action execution module is configured to execute a specified action corresponding to the specified window feature if the target window feature includes the specified window feature.
[0018] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the above method.
[0019] In a fourth aspect, an embodiment of the present application provides a terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is suitable for being loaded by the processor and executing the steps of the above-mentioned method.
[0020] The beneficial effects of the technical solutions provided by some embodiments of the present application include at least:
[0021] The present application provides a user behavior tracking method. When a target user behavior targeting a window is monitored, the target window features of the window are obtained; it is determined whether the target window features contain the specified window features; if the target window features contain the specified window features, the specified action corresponding to the specified window features is executed. Since the window features of different windows are different, when the target user behavior is monitored, the window features of the window corresponding to the target user behavior are compared with the specified window features, and the comparison results are used to determine whether the user has opened the specified window. In this way, the user behavior of opening the specified window can be accurately captured through the user behavior tracking method, so as to clarify information such as user needs and preferences based on the user's behavior of opening the specified window, and the action corresponding to the specified window can be executed based on the user information. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 An exemplary system architecture diagram of a user behavior tracking method provided in an embodiment of the present application;
[0024] Figure 2 A flowchart of a user behavior tracking method provided in an embodiment of the present application;
[0025] Figure 3 A flowchart of a user behavior tracking method provided in another embodiment of the present application;
[0026] Figure 4 A structural block diagram of a user behavior tracking device provided in an embodiment of the present application;
[0027] Figure 5 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] To make the features and advantages of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0029] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0030] In the digital age, data has become a key driver of development. Amidst this vast amount of data, gaining a deep understanding of user behavior and consumer decision-making processes is crucial, and user behavior data tracking is a key tool for gaining insights into user behavior and decision-making. User tracking is a technology used within websites, applications, or services to track user behavior and usage activities in order to analyze their behavior and needs within the service. By tracking and collecting user behavior data, it provides comprehensive reports on user identities, movements, and behavior within specific areas. If user behavior data is well organized, analyzed, and effectively utilized, developers can provide users with more products and information that meet their needs. With user tracking, website or app developers can better understand users' personal information and their activities within their websites or apps, thereby improving the user experience and generating more revenue. It also helps measure the uptime of websites or apps, allowing for quick adjustments to increase user satisfaction and enhance the quality of the website or app.
[0031] User tracking isn't just about tracking user behavior; it can also help developers understand which pages are most frequently visited, how many searches are generated, how long or short page load times are, whether users frequently stay on a particular page, and why. This helps them understand which parts of the website attract different types of users. It can also give developers a competitive technical advantage, allowing them to understand what makes their products interesting and engaging, thereby creating in-depth experiences that enable timely interaction. In some application scenarios, internet companies often need to implement business-related logic based on specific user behaviors, such as prompting users when they open or install certain software, recommending templates when they open PowerPoint files, and recommending personalized features when they search for keywords in their browsers.
[0032] Currently, tracking user behavior on a computer typically involves using a driver to monitor process creation and analyze which programs a user has opened. However, this method typically relies on drivers and degrades computer performance. Furthermore, it can't capture actions like searching for keywords in a browser or opening a file within an already running program.
[0033] Therefore, an embodiment of the present application provides a user behavior tracking method. When a target user behavior for a window is monitored, the target window features of the window are obtained; it is determined whether the target window features contain specified window features; if the target window features contain specified window features, the specified action corresponding to the specified window features is executed to solve the above-mentioned technical problem of difficulty in capturing user behavior.
[0034] See also Figure 1 , Figure 1 This is an exemplary system architecture diagram of a user behavior tracking method provided in an embodiment of the present application.
[0035] like Figure 1 As shown, the system architecture may include a terminal 101, a network 102, and a server 103. The network 102 is used to provide a medium for a communication link between the terminal 101 and the server 103. The network 102 may include various types of wired communication links or wireless communication links, for example, a wired communication link may include an optical fiber, a twisted pair, or a coaxial cable, and a wireless communication link may include a Bluetooth communication link, a Wireless-Fidelity (Wi-Fi) communication link, or a microwave communication link.
[0036] The terminal 101 can interact with the server 103 through the network 102 to receive a message from the server 103 or send a message to the server 103, or the terminal 101 can interact with the server 103 through the network 102 to receive a message or data sent by other users to the server 103. The terminal 101 can be hardware or software. When the terminal 101 is hardware, it can be various electronic devices, including but not limited to smart watches, smart phones, tablet computers, laptop portable computers and desktop computers. When the terminal 101 is software, it can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules (for example: for providing distributed services), or it can be implemented as a single software or software module, which is not specifically limited here.
[0037] In an embodiment of the present application, when the terminal 101 monitors the target user behavior against the window, it obtains the target window characteristics of the window; then, the terminal 101 further determines whether the target window characteristics include the specified window characteristics; based on this, the terminal 101 can execute the specified action corresponding to the specified window characteristics when the target window characteristics include the specified window characteristics.
[0038] The server 103 may be a business server that provides various services. It should be noted that the server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster consisting of multiple servers, or it may be implemented as a single server. When the server 103 is software, it may be implemented as multiple software or software modules (for example, for providing distributed services), or it may be implemented as a single software or software module, which is not specifically limited herein.
[0039] Alternatively, the system architecture may also not include the server 103. In other words, the server 103 may be an optional device in the embodiments of this specification, that is, the method provided in the embodiments of this specification may be applied to a system structure that only includes the terminal 101, and the embodiments of this application do not limit this.
[0040] It should be understood that Figure 1 The number of terminals, networks, and servers in the figure is only for illustration and any number of terminals, networks, and servers may be used according to implementation requirements.
[0041] See also Figure 2 , Figure 2 This is a flowchart of a user behavior tracking method provided in an embodiment of the present application. The execution subject of an embodiment of the present application can be a terminal that executes user behavior tracking, a processor in a terminal that executes the user behavior tracking method, or a user behavior tracking service in a terminal that executes the user behavior tracking method. For ease of description, the specific execution process of the user behavior tracking method is described below using the example of a processor in a terminal as the execution subject.
[0042] like Figure 2 As shown, the user behavior tracking method may at least include:
[0043] S202: When a target user behavior targeting a window is monitored, a target window feature of the window is obtained.
[0044] Optionally, the user's operations on the computer terminal are performed according to their needs. For example, when shopping, the user will open a shopping website; when looking for information, the user will open a search engine website; when leisure and entertainment are needed, the user will open a film and television website, a social networking website, etc. This means that the user's needs, preferences and other personalized information can be analyzed based on the user's operations on the computer terminal. Therefore, a large number of developers will obtain user behavior data by tracking user behavior, so as to analyze the user's current needs through the behavior data and perform actions that meet the user's needs on the user terminal, such as information push, pop-up windows, etc.
[0045] Alternatively, since the current method of tracking user behavior is to use the creation of a driver monitoring process to analyze what programs the user has opened. However, this method usually requires reliance on the driver and consumes computer performance, and it is impossible to capture behaviors such as users searching for keywords in a browser. Similarly, behaviors such as opening a file again in an already running program cannot be captured. In order to use a lightweight user behavior tracking method that does not rely on the driver layer and tracks directly from the application layer, the user behavior tracking method can be deployed in a monitoring resident process pre-installed in the terminal. When the monitoring resident process is started on the terminal, the user behavior tracking method in the embodiment of the present application can be implemented on the terminal.
[0046] Optionally, considering that users will open windows one by one when using the terminal, and these windows can provide users with the content information they need, if the user's target user behavior with respect to the window can be tracked, such as opening, switching, etc., the window opened by the user and the characteristic information of the window can be located through the target user behavior. The characteristic information of the window can explain various information such as the attributes, properties, and type of the window, which is conducive to analyzing the corresponding needs of the user when opening this window.
[0047] In a feasible implementation, the type of window feature is at least one of the process name to which the window belongs, the window class name, the window title, and the command line of the process to which the window belongs. The process name to which the window belongs describes the name of the software process in which the window opened by the user is located; the window title is the title of the window itself; the command line of the process to which the window belongs can be used to locate the position of the window in the process to which it belongs; and the window class name can be used to locate the code module corresponding to the window in the process code.
[0048] Then, in an embodiment of the present application, when monitoring the startup of the resident process, when the target user behavior for the window is monitored, the target window characteristics of the window are directly obtained, so as to further determine what kind of window the user has opened and execute actions that meet the user's needs on the terminal.
[0049] S204: Determine whether the target window features include the specified window features.
[0050] Optionally, if the target window features corresponding to the target user behavior are obtained and then analyzed, and then the action is executed based on the analysis results, there will be a certain delay between the time point of obtaining the target window features and the time point of executing the action. It is impossible to determine whether the user still has the corresponding demand for the action when the action is executed after some analysis. Therefore, it can be pre-specified that certain specified actions will be executed when certain specified windows appear. In this way, when tracking user behavior, it is only necessary to determine whether the current window is a specified window based on the target window features. If it is a specified window, the specified action corresponding to the specified window can be directly executed, thereby enhancing the terminal's immediate response during the user behavior tracking process and enhancing the real-time performance of the user behavior tracking method and action execution.
[0051] Optionally, the pre-defined specified window features and the specified actions corresponding to the specified window features can be carried by the user behavior tracking method and stored in the current terminal, and the terminal can directly call the specified window features to make a judgment; or they can be stored in a remote server, and when the monitoring resident process is started, the pre-defined specified window features and the specified actions corresponding to the specified window features are pulled from the server and stored locally, and then the user behavior tracking is performed based on the specified window features and the specified actions corresponding to the specified window features. The storage in the remote server facilitates the updating and maintenance of the specific content of the pre-defined specified window features.
[0052] Then, in the embodiment of the present application, after obtaining the target window features of the window, the degree of match between the target window features of the window and the specified window features can be determined. In the case of a complete match, the current window can be confirmed to be the specified window. Specifically, when determining the degree of match between the target window features and the specified window features, it can be determined whether the target window features include the specified window features. If the target window features include all the specified window features, it can be determined that the current window is indeed consistent with the specified window.
[0053] S206: If the target window features include the specified window features, execute a specified action corresponding to the specified window features.
[0054] Optionally, from the introduction of the above embodiment, it can be known that if the target window characteristics include the specified window characteristics, it means that the current window has all the characteristics of the specified window, then the current window is the specified window that needs to perform a predetermined action. Therefore, at this time, the specified action corresponding to the specified window characteristics is executed on the current window, and the action corresponding to the specified window can be executed according to the tracked user behavior information, thereby meeting user needs and improving the user experience.
[0055] In an embodiment of the present application, a user behavior tracking method is provided. When a target user behavior targeting a window is monitored, the target window features of the window are obtained; it is determined whether the target window features contain the specified window features; if the target window features contain the specified window features, the specified action corresponding to the specified window features is executed. Since the window features of different windows are different, when the target user behavior is monitored, the window features of the window corresponding to the target user behavior are compared with the specified window features, and based on the comparison results, it is determined whether the user has opened the specified window. In this way, the user behavior of opening the specified window can be accurately captured through the user behavior tracking method, so that information such as user needs and preferences can be clarified based on the user's behavior of opening the specified window, and the action corresponding to the specified window can be executed based on the user information.
[0056] See also Figure 3 , Figure 3 A flowchart of a user behavior tracking method provided in another embodiment of the present application.
[0057] like Figure 3 As shown, the user behavior tracking method may at least include:
[0058] S302: Set a hook monitoring function corresponding to the target user behavior, and monitor the user behavior based on the hook monitoring function.
[0059] Optionally, a hook monitoring function can be used to track user behavior. The hook monitoring function is the Hook function. Hook is a system mechanism used to replace the "interrupt" under DOS. It is translated into Chinese as "hook" or "hook". After hooking a specific running event, once a hooked event occurs, the program that hooked the event will receive a notification, and the program can respond to the event at the first time. It can be understood that when a corresponding hook monitoring function is set for the target user behavior that needs to be captured, when the target user behavior occurs among all user behaviors, the hook monitoring function can respond and capture the target user behavior currently occurring, thus realizing the monitoring of user behavior based on the hook monitoring function.
[0060] Specifically, when setting the hook monitoring function corresponding to the target user behavior, you can call the SetWinEventHook function to set the message hook. The SetWinEventHook function is a Windows API function that allows the program to monitor a series of window events, such as creation, destruction, activation or focus change, etc. By using SetWinEventHook, you can set a hook monitoring function to listen to these events and get notified when the event occurs.
[0061] Furthermore, when configuring the hook monitoring function's parameters, you first need to set the minimum event value (EVENT_MIN) and maximum event value (EVENT_MAX). These values define the range of events the hook monitoring function intends to monitor. For example, if you want to monitor for events related to opening new windows, you can set both the minimum and maximum event values to EVENT_SYSTEM_FOREGROUND. Additionally, you need to set the module handle. A handle is an identifier used to identify an object or item. In programming, a handle is a special smart pointer used to identify various resources in the Windows system, such as windows, files, and controls. Depending on the specific implementation scenario, for example, if you want to monitor for events related to opening new windows, the module handle can be set to nullptr. Furthermore, you also need to configure the callback function that is returned when the target user action is monitored. Again, for example, if you want to monitor for events related to opening new windows, set the pointer (i.e., callback address) of the custom callback function to win_event_proc. If you want to monitor for all new window openings in the terminal, both the process ID and thread ID can be set to the default value of 0. On the other hand, the hook monitoring function flag also needs to be set to WINEVENT_OUTOFCONTEXT|WINEVENT_SKIPOWNPROCESS, because the window generated by this process (that is, the monitored resident process) is not within the monitoring range, and there is no need to obtain the user's window behavior in this process. Therefore, it is necessary to exclude events caused by the target user behavior generated in this process.
[0062] It should be noted that the setting and configuration of the above-mentioned hook monitoring function can be determined according to the needs of the actual application scenario, and the embodiments of the present application do not make specific limitations on this.
[0063] S304: When a target user behavior targeting a window is monitored, first identification information corresponding to the window is obtained, and target window features of the window are determined based on the first identification information.
[0064] Optionally, the window characteristics are obtained after the window is located. Therefore, in an actual scenario, when user behavior is monitored based on the hook monitoring function, when the target user behavior for the window is monitored, the callback function will receive a message. At this time, the hook monitoring function will obtain the first identification information of the window and return it to the callback function, so that the terminal determines the target window characteristics of the window based on the first identification information.
[0065] Specifically, the first identification information can be a window handle. When the callback function receives the window handle, it determines multiple target window features of the window based on the window handle. The target window features can be the process name, window class name, window title, and command line of the process to which the window belongs. In specific implementation, the callback function calls the GetWindowThreadProcessId interface to obtain the process ID of the window, obtains the process handle based on the process ID, and calls the GetProcessImageFileName interface based on the process handle to obtain the process name to which the window belongs; calls the NtQueryInformationProcess interface based on the process handle to obtain process information, and then calls the ReadProcessMemory interface to obtain the process command line; calls the GetWindowText interface based on the window handle to obtain the window title. If the title is empty, it means that the current window is a child window and may not have its own independent title. Therefore, it is necessary to obtain the title of its parent window (i.e., the owner window) as its title. At this time, the GetWindow interface is called to pass GW_OWNER to obtain the parent window handle, and then the GetWindowText interface is called based on the parent window handle to obtain the window title; and calls the GetClassName interface based on the window handle to obtain the window class name.
[0066] S306: Determine whether the window is a browser window based on the target window characteristics.
[0067] Alternatively, since windows in non-browsers are opened based on tags, functions, etc., they all have their own handles. Then, through the different handles, the callback function can directly obtain information about different windows. However, the handles of windows in browsers do not change, and only a unified handle is used. Therefore, when the window in the browser changes, the process originally monitored based on the window handle will not be able to call back the target user behavior of opening a new window. Therefore, for tracking user behavior in the browser, other adaptive solutions are also needed for monitoring.
[0068] In an embodiment of the present application, in order to more comprehensively process all target user behaviors for windows, after obtaining the corresponding target user behaviors, it is possible to determine whether the window is a browser window based on the target window characteristics, and perform corresponding processing on browser windows and non-browser windows respectively. Determining whether a window is a browser window based on the target window characteristics is mainly achieved by using the process name of the window in the target window characteristics.
[0069] S308: If the window is a non-browser window, executing the step of determining whether the target window characteristics include the specified window characteristics.
[0070] Optionally, if the process name of the window in the target window characteristics is not any browser process name, the window can be determined to be a non-browser window. At this time, it is directly determined whether the target window characteristics contain the specified window characteristics to determine whether the current window is the specified window.
[0071] S310: If the target window features include the specified window features, determine the specified action corresponding to the specified window features according to the preset behavior processing rules; and execute the specified action.
[0072] Optionally, if the target window characteristics include the specified window characteristics, indicating that the current window is the specified window, then the specified action corresponding to the specified window characteristics is executed. Specifically, when executing the specified action corresponding to the specified window characteristics, the correspondence between multiple specified windows and multiple specified actions can be pre-specified in the preset behavior processing rules, so that after obtaining the target window characteristics of the non-browser window, the specified action corresponding to the specified window characteristics can be determined according to the preset behavior processing rules, and the specified action is executed. Conversely, if the target window characteristics do not include all the specified window characteristics, it means that the current window is not the specified window, and the specified action corresponding to the specified window specified in the preset behavior processing rules will not be executed.
[0073] or
[0074] S312: If the window is a browser window, monitor the change state of the second identification information of the window based on a preset timer, and monitor user behavior according to the change state.
[0075] Alternatively, if the process name of the window in the target window feature is a browser process name, the window can be determined to be a browser window. Since all browser windows in the same browser have the same first identification information, it means that at this time, it is impossible to track the user's opening behavior of a new window based solely on the window's first identification information, i.e., the window handle. However, although the handle of the new window will not change, the title will change. Therefore, when monitoring the user's behavior on the browser window in the browser, a timer can be used to monitor the title changes of the window, and the title change information can be used to capture and call back the new window behavior. When the window title changes, the new window behavior is called back, and the monitoring rule is matched. If a match is found, the corresponding action is executed. That is, the change state of the second identification information of the window is monitored based on the preset timer, and the user behavior is monitored based on the change state.
[0076] Specifically, when monitoring the change status of the second identification information of the window based on the preset timer and monitoring the user behavior according to the change status, it is based on whether the second identification information of the window is changed based on the preset timer. If the second identification information changes, it is determined that the target user behavior has occurred, that is, the user has opened a new window in the browser.
[0077] S314: Obtain the changed target window features of the window after the second identifier changes, and determine whether the changed target window features include the specified window features.
[0078] Optionally, for a browser window, when determining whether the browser window is a designated window, the specific method is to obtain the changed target window characteristics of the window after the second identifier changes. At this time, the changed target window characteristics are the window characteristics of the new window being monitored. Therefore, it should be determined whether the changed target window characteristics contain the designated window characteristics.
[0079] S316: If the changed target window features include the specified window features, determine the specified action corresponding to the specified window features according to the preset behavior processing rules; and execute the specified action.
[0080] Optionally, if the target window characteristics after the change include the specified window characteristics, it means that the current window is the specified window, and the specified action corresponding to the specified window characteristics is executed. Specifically, when executing the specified action corresponding to the specified window characteristics, the correspondence between multiple specified windows and multiple specified actions can be pre-specified in the preset behavior processing rules, so that after obtaining the target window characteristics of the browser window, the specified action corresponding to the specified window characteristics can be determined according to the preset behavior processing rules, and the specified action is executed. Conversely, if the target window characteristics after the change do not include all the specified window characteristics, it means that the current window is not the specified window, and the specified action corresponding to the specified window specified in the preset behavior processing rules will not be executed.
[0081] In an embodiment of the present application, a user behavior tracking method is provided, a hook monitoring function corresponding to the target user behavior is set, the user behavior is monitored based on the hook monitoring function, and the hook monitoring function is used to capture the changes in active windows, with high performance and accurate monitoring results; when the target user behavior for the window is monitored, the first identification information corresponding to the window is obtained, and the target window characteristics of the window are determined based on the first identification information; according to the target window characteristics, whether the window is a browser window is determined, and adaptive schemes are selected for monitoring windows in different scenarios; if the window is a non-browser window, the step of determining whether the target window characteristics contain the specified window characteristics is executed, and if the target window characteristics contain the specified window characteristics, the target window characteristics are determined based on the first identification information. The preset behavior processing rules determine the specified action corresponding to the specified window feature and execute the specified action; if the window is a browser window, the change status of the second identification information of the window is monitored based on the preset timer, and the user behavior is monitored according to the change status to accurately capture the user's window behavior in the browser; when matching, the changed target window feature of the window after the second identification changes is obtained, and it is determined whether the changed target window feature contains the specified window feature. If the changed target window feature contains the specified window feature, the specified action corresponding to the specified window feature is determined according to the preset behavior processing rules and the specified action is executed. The entire process is lightweight and does not rely on the driver layer. It is tracked directly from the application layer, with high stability and a more reliable solution.
[0082] See also Figure 4 , Figure 4 This is a structural block diagram of a user behavior tracking device provided in an embodiment of the present application. Figure 4 As shown, the user behavior tracking device 400 includes:
[0083] The information tracking module 410 is used to obtain the target window characteristics of the window when monitoring the occurrence of the target user behavior for the window;
[0084] The behavior determination module 420 is used to determine whether the target window features include the specified window features;
[0085] The action execution module 430 is configured to execute a specified action corresponding to the specified window feature if the target window feature includes the specified window feature.
[0086] Optionally, the information tracking module 410 is further configured to obtain first identification information corresponding to the window, and determine a target window feature of the window based on the first identification information.
[0087] Optionally, the user behavior tracking device 400 also includes: a browser monitoring module, which is used to determine whether the window is a browser window based on the target window characteristics; if the window is a non-browser window, executing the step of determining whether the target window characteristics contain specified window characteristics; if the window is a browser window, monitoring the change state of the second identification information of the window based on a preset timer, and monitoring user behavior based on the change state; wherein, all browser windows in the same browser have the same first identification information.
[0088] Optionally, the browser monitoring module is also used to monitor whether the second identification information of the window changes based on a preset timer; if the second identification information changes, it is determined that the target user behavior has occurred; the information tracking module 410 is also used to obtain the changed target window characteristics of the window after the second identification changes; the behavior judgment module 420 is also used to determine whether the changed target window characteristics contain specified window characteristics.
[0089] Optionally, the action execution module 430 is further configured to determine a specified action corresponding to the specified window feature according to a preset behavior processing rule if the target window feature includes the specified window feature; and execute the specified action.
[0090] Optionally, the user behavior tracking device 400 further includes: a behavior monitoring module, which is used to set a hook monitoring function corresponding to the target user behavior and monitor the user behavior based on the hook monitoring function.
[0091] Optionally, the type of the window feature is at least one of a name of the process to which the window belongs, a window class name, a window title, and a command line of the process to which the window belongs.
[0092] In an embodiment of the present application, a user behavior tracking device is provided, wherein an information tracking module is used to obtain target window features of a window when a target user behavior targeting a window is monitored; a behavior judgment module is used to judge whether the target window features contain specified window features; and an action execution module is used to execute a specified action corresponding to the specified window features if the target window features contain specified window features. Since the window features of different windows are different, when the target user behavior is monitored, the window features of the window corresponding to the target user behavior are compared with the specified window features, and whether the user opens the specified window is determined based on the comparison results. In this way, the user behavior of opening the specified window can be accurately captured through the user behavior tracking method, so that information such as user needs and preferences can be clarified based on the user's behavior of opening the specified window, and the action corresponding to the specified window can be executed based on the user information.
[0093] An embodiment of the present application further provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded by a processor and executing the steps of any method in the above embodiments.
[0094] See Figure 5 , Figure 5 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. Figure 5 As shown, the terminal 500 may include: at least one terminal processor 501 , at least one network interface 504 , a user interface 503 , a memory 505 , and at least one communication bus 502 .
[0095] The communication bus 502 is used to implement the connection and communication between these components.
[0096] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0097] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0098] The terminal processor 501 may include one or more processing cores. The terminal processor 501 utilizes various interfaces and circuits to connect various components within the entire terminal 500. It executes instructions, programs, code sets, or instruction sets stored in the memory 505, and accesses data stored in the memory 505 to perform various functions and process data for the terminal 500. Optionally, the terminal processor 501 may be implemented using at least one hardware form selected from the group consisting of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The terminal processor 501 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content displayed on the display screen; and the modem handles wireless communications. It is understood that the modem may not be integrated into the terminal processor 501 and may be implemented as a separate chip.
[0099] Among them, the memory 505 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned terminal processor 501. As Figure 5 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a user behavior tracking program.
[0100] exist Figure 5 In the terminal 500 shown, the user interface 503 is mainly used to provide an input interface for the user and obtain the data input by the user; and the terminal processor 501 can be used to call the user behavior tracking program stored in the memory 505 and perform the following operations:
[0101] When a target user behavior targeting a window is detected, the target window features of the window are obtained;
[0102] Determine whether the target window features contain the specified window features;
[0103] If the target window features include the specified window features, the specified action corresponding to the specified window features is executed.
[0104] In some embodiments, when executing the acquisition of the target window feature of a window, the terminal processor 501 specifically performs the following steps: acquiring first identification information corresponding to the window, and determining the target window feature of the window based on the first identification information.
[0105] In some embodiments, when executing the user behavior tracking program, the terminal processor 501 also specifically performs the following steps: determining whether the window is a browser window based on the target window characteristics; if the window is a non-browser window, executing the step of determining whether the target window characteristics contain specified window characteristics; if the window is a browser window, monitoring the change state of the second identification information of the window based on a preset timer, and monitoring user behavior based on the change state; wherein, all browser windows in the same browser have the same first identification information.
[0106] In some embodiments, when the terminal processor 501 executes the change status of the second identification information of the monitoring window based on a preset timer and monitors the user behavior according to the change status, it specifically performs the following steps: whether the second identification information of the monitoring window changes based on the preset timer; if the second identification information changes, it is determined that the target user behavior has occurred; when the terminal processor 501 executes the acquisition of the target window characteristics of the window and determines whether the target window characteristics include the specified window characteristics, it specifically performs the following steps: obtain the changed target window characteristics of the window after the second identification changes, and determine whether the changed target window characteristics include the specified window characteristics.
[0107] In some embodiments, when the terminal processor 501 executes the specified action corresponding to the specified window feature if the target window feature includes the specified window feature, it specifically performs the following steps: if the target window feature includes the specified window feature, determine the specified action corresponding to the specified window feature according to the preset behavior processing rules; and execute the specified action.
[0108] In some embodiments, when the terminal processor 501 monitors the target user behavior for the window, before obtaining the target window information of the window, it also specifically performs the following steps: setting a hook monitoring function corresponding to the target user behavior, and monitoring the user behavior based on the hook monitoring function.
[0109] In some embodiments, the type of the window feature is at least one of the name of the process to which the window belongs, the window class name, the window title, and the command line of the process to which the window belongs.
[0110] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0111] Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of these modules may be selected to achieve the purpose of this embodiment based on actual needs.
[0112] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The above-mentioned computer program product includes one or more computer instructions. When the above-mentioned computer program instructions are loaded and executed on a computer, the above-mentioned process or function according to the embodiment of this specification is generated in whole or in part. The above-mentioned computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium or transmitted by the above-mentioned computer-readable storage medium. The above-mentioned computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The above-mentioned computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVDs)), or semiconductor media (for example, solid state disks (SSDs)).
[0113] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0114] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0115] The above is a description of a user behavior tracking method, device, storage medium, and terminal provided in this application. For those skilled in the art, based on the ideas of the embodiments of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this application.
Claims
1. A user behavior tracking method, characterized in that: The method comprises: When a target user behavior targeting a window is monitored, a target window feature of the window is obtained; Determining whether the target window features include specified window features; If the target window features include the designated window features, a designated action corresponding to the designated window features is executed.
2. The method according to claim 1, characterized in that The acquiring target window features of the window includes: First identification information corresponding to the window is acquired, and a target window feature of the window is determined based on the first identification information.
3. The method according to claim 2, characterized in that After acquiring the target window feature of the window, the method further includes: Determining whether the window is a browser window according to the target window feature; If the window is a non-browser window, executing the step of determining whether the target window characteristics include the specified window characteristics; If the window is a browser window, monitoring a change state of the second identification information of the window based on a preset timer, and monitoring user behavior according to the change state; Wherein, all browser windows in the same browser have the same first identification information.
4. The method according to claim 3, characterized in that The step of monitoring a change state of the second identification information of the window based on a preset timer and monitoring user behavior according to the change state includes: monitoring whether the second identification information of the window changes based on a preset timer; If the second identification information changes, it is determined that the target user behavior occurs; The acquiring target window features of the window and determining whether the target window features include specified window features include: Acquire the changed target window features of the window after the second identifier changes, and determine whether the changed target window features include the designated window features.
5. The method according to claim 1, characterized in that If the target window features include the specified window features, executing a specified action corresponding to the specified window features includes: If the target window features include the specified window features, determining a specified action corresponding to the specified window features according to a preset behavior processing rule; Execute the specified action.
6. The method according to claim 1, characterized in that When the target user behavior targeting the window is monitored, before obtaining the target window information of the window, the method further includes: Set a hook monitoring function corresponding to the target user behavior, and monitor the user behavior based on the hook monitoring function.
7. The method according to claim 1, characterized in that The type of the window feature is at least one of the process name to which the window belongs, the window class name, the window title, and the command line of the process to which the window belongs.
8. A user behavior tracking device, characterized in that: The device comprises: An information tracking module, configured to obtain target window features of a window when a target user behavior targeting a window is detected; A behavior judgment module, configured to judge whether the target window features include specified window features; The action execution module is configured to execute a specified action corresponding to the specified window feature if the target window feature includes the specified window feature.
9. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the method according to any one of claims 1 to 7.
10. A terminal, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the program.