User behavior data collection method, device, equipment and storage medium
By introducing a throttle on the client side and intercepting and executing some events according to the type of user behavior events, the problem of high power consumption and data duplication in user behavior data collection under the buried point mechanism is solved, and more efficient data collection and storage are achieved.
Patent Information
- Application Number
- CN202210573496.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-25
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-05-25
AI Technical Summary
In the existing technology, when user behavior data is collected through the tracking mechanism, frequent requests from the client lead to high power consumption, and a large amount of duplicate data is collected, which wastes storage resources on the server side.
Introducing a throttle on the client side, through event containers and event interceptors, obtains the interception mode according to the type of user behavior events, intercepts and executes some user behavior events, and collects and sends corresponding user behavior data.
It reduces the number of data collection times, reduces power consumption, reduces data duplication, and improves the efficiency and accuracy of data collection.
Smart Images

Figure CN115002575B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for collecting user behavior data. Background Art
[0002] With the development of the information age, collecting user behavior data and completing user portrait analysis through big data has become more and more widely used. The embedding mechanism is one of the main methods for collecting user behavior data.
[0003] At present, in the method of collecting user behavior data through the tracking mechanism, the data collected by the client is uploaded to the server for processing. However, the frequent requests of users on the application will frequently trigger the tracking mechanism, which will obviously consume more power. In addition, since the tracking mechanism aims to collect more and more comprehensive user behavior data as much as possible, a large amount of duplicate data will be collected, thereby wasting a lot of server storage resources. Summary of the invention
[0004] The present application provides a user behavior data collection method, device, equipment and storage medium, which reduces power consumption in the process of collecting user behavior data and reduces data duplication.
[0005] The first aspect of the present application provides a method for collecting user behavior data, comprising:
[0006] Obtain M first user behavior events, where M is an integer;
[0007] Acquire a first event interception mode of the first user behavior event according to the event type of the first user behavior event;
[0008] According to the first event interception mode, executing N first user behavior events among the M first user behavior events, where N is an integer less than or equal to M;
[0009] Collecting user behavior data of the N first user behavior events;
[0010] The user behavior data is sent to the server.
[0011] A second aspect of the present application provides a user behavior data collection device, comprising:
[0012] A first acquisition module, used to acquire M first user behavior events, where M is an integer;
[0013] A second acquisition module, configured to acquire a first event interception mode of the first user behavior event according to an event type of the first user behavior event;
[0014] an execution module, configured to execute N first user behavior events among the M first user behavior events according to the first event interception mode, wherein N is an integer less than or equal to M;
[0015] A collection module, used to collect user behavior data of the N first user behavior events;
[0016] The sending module is used to send the user behavior data to the server.
[0017] The third aspect of the present application provides an electronic device, which includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in any method of the first aspect of the present application.
[0018] The fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement part or all of the steps described in any method of the first aspect of the present application.
[0019] It can be seen that through the user behavior data collection method, device, equipment and storage medium proposed in the present application, the client obtains one or more first user behavior events, and obtains the first event interception mode according to the event type of the first user behavior event. According to the first event interception mode, some of the first user behavior events in one or more first user behavior events are executed. The user behavior data of the part of the first user behavior events is collected and sent to the server. In this way, when user behavior events of the same type are more frequent, the client only executes some of the user behavior events, and collects the user behavior data of the part of the user behavior events, and sends them to the server for analysis. On the one hand, by reducing the number of data collection times, power consumption is reduced. On the other hand, for user behavior events of the same type, only user behavior data of some of the user behavior events are collected, which reduces data duplication. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 A schematic diagram of the structure of a user behavior data collection system provided in an embodiment of the present application;
[0022] Figure 2A flowchart of a method for collecting user behavior data provided in an embodiment of the present application;
[0023] Figure 3 A flowchart of another method for collecting user behavior data provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of a user behavior data collection device provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of the electronic device structure of the hardware operating environment involved in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The user behavior data collection method, device, equipment and storage medium provided in the embodiments of the present application reduce power consumption in the process of collecting user behavior data and reduce data duplication.
[0027] Below, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
[0028] The "at least one" involved in the embodiments of the present application refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0029] And, unless otherwise stated, the ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects. For example, the first information and the second information are only for distinguishing different information, and do not represent the difference in content, priority, order of transmission or importance of the two types of information. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0031] The following is a detailed description of the embodiments of the present application.
[0032] See first Figure 1 , Figure 1 This is a schematic diagram of the structure of a user behavior data collection system provided in an embodiment of the present application. Figure 1 As shown, the user behavior data collection system 100 includes a client 101 and a server 102. The client 101 establishes a communication connection with the server 102.
[0033] In the user behavior data collection system 100 provided in the embodiment of the present application, first, a throttle is introduced in the client 101, and the throttle includes an event container and an event interceptor. Among them, the client (Client) is also called the user end, and the more commonly used user ends include web browsers used for the World Wide Web, email clients when sending and receiving emails, and client software for instant messaging. The event container is used to place user behavior events of the same type for easy interception. The event interceptor is used to intercept user behavior events.
[0034] Specifically, the client 101 obtains M first user behavior events, where M is an integer. The first user behavior event may be, for example, a button click, a list slide, or a foreground and background switch. A user may trigger multiple repeated actions for the same operation within a certain period of time, that is, the same type of user behavior events may be triggered multiple times within a certain period of time.
[0035] The client 101 obtains the first event interception mode of the first user behavior event according to the event type of the first user behavior event. Specifically, user behavior events of the same type correspond to the same event container, and each event container has a corresponding event interception mode, including a first mode and a second mode. The correspondence between the preset event type and the event container is obtained, and according to the correspondence, the first event container corresponding to the event type of the first user behavior event is determined, and the first event interception mode corresponding to the first event container is obtained.
[0036] The client 101 executes N first user behavior events among the M first user behavior events according to the first event interception mode, where N is an integer less than or equal to M. Specifically, the M first user behavior events are placed in a first event container, and the client intercepts the events in the first event container according to the first event interception mode, and the client 101 executes the first user behavior events that are not intercepted.
[0037] The client 101 collects user behavior data of N first user behavior events. Specifically, the client 101 may collect the user behavior data of the N first user behavior events through a tracking mechanism.
[0038] Finally, the client 101 sends the collected user behavior data to the server 102. The server 102 analyzes the user portrait based on the user behavior data sent by the client 101.
[0039] It can be seen that in the user behavior data collection system provided in the embodiment of the present application, when the same type of user behavior events are frequent, the client only executes part of the user behavior events, collects the user behavior data of the part of the user behavior events, and sends it to the server for analysis. On the one hand, by reducing the number of data collection times, power consumption is reduced. On the other hand, for the same type of user behavior events, only the user behavior data of part of the user behavior events is collected, which reduces the data duplication.
[0040] See also Figure 2 , Figure 2 A flowchart of a method for collecting user behavior data provided in an embodiment of the present application is shown below. Figure 2 As shown, a user behavior data collection method provided by an embodiment of the present application may include:
[0041] S201. Obtain M first user behavior events, where M is an integer.
[0042] First, a throttle is introduced in the client, which includes an event container and an event interceptor. The client includes web browsers used for the World Wide Web, email clients for sending and receiving emails, and client software for instant messaging. The event container is used to place user behavior events of the same type for easy interception. The event interceptor is used to intercept user behavior events.
[0043] Specifically, the client obtains M first user behavior events, where M is an integer. The first user behavior event may be, for example, a button click, a list slide, or a foreground and background switch. A user may trigger multiple repeated actions for the same operation within a certain period of time, that is, the same type of user behavior events are triggered multiple times within a certain period of time. The client obtains one or more first user behavior events of the same type.
[0044] Optionally, after acquiring M first user behavior events, the client acquires the first user corresponding to the first user behavior event and identifies whether the first user is an illegal user. If the first user is an illegal user, user behavior data of the first user behavior event is not collected.
[0045] Specifically, dynamic control can be implemented for specific groups of people. For risk control users, as much behavioral data as possible should be collected to analyze user portraits. For illegal users, as little or no data should be collected as possible, as the data of illegal users is not needed in big data analysis.
[0046] S202: Acquire a first event interception mode of the first user behavior event according to the event type of the first user behavior event.
[0047] Optionally, according to the event type of the first user behavior event, the method for obtaining the first event interception mode of the first user behavior event may be: obtaining the correspondence between the preset event type and the event container; determining the first event container corresponding to the event type of the first user behavior event according to the correspondence between the event type and the event container; and obtaining the first event interception mode corresponding to the first event container.
[0048] Specifically, user behavior events of the same type correspond to the same event container, and each event container has a corresponding event interception mode, including a first mode and a second mode. First, obtain the correspondence between the preset event type and the event container. Then determine the event type of the first user behavior event, such as a button click, a list slide, or a foreground and background switch. Then, based on the correspondence between the preset event type and the event container, determine the first event container corresponding to the event type of the first user behavior event. The first event container is used to place one or more first user behavior events. Finally, obtain the first event interception mode corresponding to the first event container. The first event interception mode is the first mode or the second mode.
[0049] In a possible implementation, different types of user behavior events may correspond to different event containers, and the event interception modes corresponding to different event containers may be the same or different.
[0050] S203. Execute N first user behavior events among the M first user behavior events according to the first event interception mode, where N is an integer less than or equal to M.
[0051] Optionally, according to the first event interception mode, the method for executing N first user behavior events out of M first user behavior events may be: placing the M first user behavior events into a first event container; intercepting the first user behavior events in the first event container according to the first event interception mode; and executing N first user behavior events that have not been intercepted out of the M first user behavior events.
[0052] Specifically, after determining the first event container, M first user behavior events are placed in the first event container, and user behavior events of the same type are placed in the same event container, so as to facilitate interception of user behavior events in the container. The client determines which user behavior events can be executed and which user behavior events need to be intercepted according to the first event interception mode. The first user behavior events in the first event container are intercepted by the event interceptor, and the client executes the N first user behavior events that are not intercepted.
[0053] In a possible implementation, N is less than M, indicating that (MN) events out of the M first user behavior events are intercepted, and finally the client only executes the N first user behavior events.
[0054] In another possible implementation, N is equal to M, indicating that there are no intercepted events among the M first user behavior events, and finally the client executes all the first user behavior events.
[0055] Further optionally, according to the first event interception mode, the method for intercepting the first user behavior event in the first event container may be: obtaining the trigger time of each first user behavior event among M first user behavior events; when the first event interception mode is the first mode, determining i first user behavior events whose trigger time is within a preset interception period according to the trigger time of each first user behavior event, where i is an integer less than or equal to M; intercepting j first user behavior events among the i first user behavior events, where j is an integer less than i.
[0056] Specifically, the first event interception mode is the first mode, which means that within the preset interception period, only j user behavior events of the same type are allowed to be executed, and other repeated events will be intercepted. After exceeding the preset interception period, the next preset interception period will be entered. For example, j is 1, and the preset interception period is 5s, which means that only one first user behavior event is allowed to be executed within 5s. If 200 first user behavior events are obtained within 10s, after being intercepted by the event interceptor, only one execution within 5s is allowed. After exceeding 5s, it will be executed again within the next 5s, which means that the first user behavior event is finally executed twice within 10s.
[0057] Further optionally, according to the first event interception mode, the method for intercepting the first user behavior event in the first event container may be: obtaining the triggering time of each first user behavior event among M first user behavior events; when the first event interception mode is the second mode, if there are no other first user behavior events within the preset time period after the triggering time of the kth first user behavior event among the M first user behavior events, then the kth first user behavior event is delayed for execution after the preset time period, where k is an integer less than or equal to M; if there are other first user behavior events, then the kth first user behavior event is delayed to be executed after the next preset time period, until there are no other first user behavior events in the next preset time period, and other first user behavior events within each preset time period of the delay of the kth first user behavior event are intercepted.
[0058] Specifically, the first event interception mode is the second mode, which means that the user behavior event will be executed only if there are no repeated user behavior events of the same type within the preset time period. If repeated events of the same type occur, the user behavior event will be delayed until the next preset time period. If there are repeated events of the same type, the execution of the user behavior event will be delayed indefinitely until there are no repeated events of the same type within the next preset time period, and all other events within the delayed preset time period will be intercepted. For example, the preset time period is 2s, and the execution of the first user behavior event is delayed for 2s. If there are no other repeated events of the same type within these 2s, the first user behavior event will be executed. Otherwise, the execution of the first user behavior event will continue to be delayed for 2s until there are no repeated events of the same type within 2s.
[0059] S204: Collect user behavior data of the N first user behavior events.
[0060] Optionally, the client collects user behavior data of the N first user behavior events through a tracking mechanism.
[0061] In a possible implementation, before collecting user behavior data of N first user behavior events, the client also obtains a second user behavior event; based on the event type of the first user behavior event, a first collection priority of the first user behavior event is obtained, and based on the event type of the second user behavior event, a second collection priority of the second user behavior event is obtained; if the first collection priority is higher than the second collection priority, user behavior data of the first user behavior event is collected first, and if the second collection priority is higher than the first collection priority, user behavior data of the second user behavior event is collected first.
[0062] Specifically, the collection priorities corresponding to different types of user behavior events may be different. For more important user behavior data, the corresponding collection priority is higher. In this way, more important user behavior data can be collected first, and the user behavior data collected in the end is more accurate.
[0063] S205: Send the user behavior data to the server.
[0064] Specifically, the client sends the collected user behavior data to the server, and the server analyzes the user portrait based on the user behavior data.
[0065] It can be seen that through the user behavior data collection method provided in the embodiment of the present application, the client obtains one or more first user behavior events, and obtains the first event interception mode according to the event type of the first user behavior event. According to the first event interception mode, some of the first user behavior events in the one or more first user behavior events are executed. The user behavior data of the part of the first user behavior events is collected and sent to the server. In this way, when user behavior events of the same type are more frequent, the client only executes some of the user behavior events, and collects the user behavior data of the part of the user behavior events, and sends them to the server for analysis. On the one hand, by reducing the number of data collection times, power consumption is reduced. On the other hand, for user behavior events of the same type, only user behavior data of some of the user behavior events are collected, which reduces data duplication.
[0066] See also Figure 3 , Figure 3 A flowchart of another method for collecting user behavior data provided by an embodiment of the present application. Figure 3 As shown, another user behavior data collection method provided by the embodiment of the present application may include:
[0067] S301. The client obtains M first user behavior events, where M is an integer.
[0068] First, a throttle is introduced in the client, which includes an event container and an event interceptor. The event container is used to place user behavior events of the same type for easy interception. The event interceptor is used to intercept user behavior events.
[0069] Specifically, the client obtains M first user behavior events, where M is an integer. The first user behavior event may be, for example, a button click, a list slide, or a foreground and background switch. A user may trigger multiple repeated actions for the same operation within a certain period of time, that is, the same type of user behavior events are triggered multiple times within a certain period of time. The client obtains one or more first user behavior events of the same type.
[0070] Optionally, after acquiring M first user behavior events, the client acquires the first user corresponding to the first user behavior event and identifies whether the first user is an illegal user. If the first user is an illegal user, user behavior data of the first user behavior event is not collected.
[0071] Specifically, dynamic control can be implemented for specific groups of people. For risk control users, as much behavioral data as possible should be collected to analyze user portraits. For illegal users, as little or no data should be collected as possible, as the data of illegal users is not needed in big data analysis.
[0072] S302: The client determines a first event container corresponding to the first user behavior event according to the event type of the first user behavior event.
[0073] Optionally, the method for the client to determine the first event container corresponding to the first user behavior event based on the event type of the first user behavior event may be: obtaining the correspondence between the preset event type and the event container; and determining the first event container corresponding to the event type of the first user behavior event based on the correspondence between the event type and the event container.
[0074] Specifically, first obtain the correspondence between the preset event type and the event container. Then determine the event type of the first user behavior event, such as a button click, a list slide, or a foreground and background switch. Then, based on the correspondence between the preset event type and the event container, determine the first event container corresponding to the event type of the first user behavior event. The first event container is used to place one or more first user behavior events.
[0075] In a possible implementation, different types of user behavior events may correspond to different event containers.
[0076] In a possible implementation, the interception priorities of different event containers may be different. For example, for more important user behavior data, a higher interception priority is set for the corresponding event container, so that the event interception in the event container can be processed first, so that the corresponding user behavior data can be collected first, and the user behavior data collected in the end is more accurate.
[0077] S303: The client obtains a first event interception mode corresponding to the first event container.
[0078] Specifically, the same type of user behavior events correspond to the same event container, and each event container has a corresponding event interception mode, including a first mode and a second mode. The client obtains the first event interception mode corresponding to the first event container, and the first event interception mode is the first mode or the second mode.
[0079] In a possible implementation, the event interception modes corresponding to different event containers may be the same or different.
[0080] S304: The client puts M first user behavior events into a first event container.
[0081] Specifically, after determining the first event container, the M first user behavior events are placed in the first event container. Placing the same type of user behavior events in the same event container facilitates interception of the user behavior events in the container.
[0082] For example, multiple button click events triggered at multiple time points are placed in the first event container, multiple list sliding events operated at multiple time points are placed in the second event container, and multiple foreground and background switching events operated at multiple time points are placed in the third event container. Placing events of the same type into the same event container can facilitate interception of events of the same type.
[0083] S305: The client intercepts the first user behavior event in the first event container according to the first event interception mode.
[0084] Specifically, the client determines which part of the user behavior event can be executed and which part of the user behavior event needs to be intercepted according to the first event interception mode, and intercepts the first user behavior event in the first event container through the event interceptor.
[0085] In a possible implementation, according to the first event interception mode, the method for intercepting the first user behavior event in the first event container may be: obtaining the triggering time of each first user behavior event among M first user behavior events; when the first event interception mode is the first mode, determining i first user behavior events whose triggering time is within a preset interception period according to the triggering time of each first user behavior event, where i is an integer less than or equal to M; intercepting j first user behavior events among the i first user behavior events, where j is an integer less than i.
[0086] Specifically, the first event interception mode is the first mode, which means that within the preset interception period, only j user behavior events of the same type are allowed to be executed, and other repeated events will be intercepted. After exceeding the preset interception period, the next preset interception period will be entered. For example, j is 1, and the preset interception period is 5s, which means that only one first user behavior event is allowed to be executed within 5s. If 200 first user behavior events are obtained within 10s, after being intercepted by the event interceptor, only one execution within 5s is allowed. After exceeding 5s, it will be executed again within the next 5s, which means that the first user behavior event is finally executed twice within 10s.
[0087] In a possible implementation, according to the first event interception mode, the method for intercepting the first user behavior event in the first event container may be: obtaining the triggering time of each first user behavior event among M first user behavior events; when the first event interception mode is the second mode, if there are no other first user behavior events within a preset time period after the triggering time of the kth first user behavior event among the M first user behavior events, then the kth first user behavior event is delayed for execution after a preset time period, where k is an integer less than or equal to M; if there are other first user behavior events, then the kth first user behavior event is delayed for execution until the next preset time period, until there are no other first user behavior events within the next preset time period, and intercept other first user behavior events within each preset time period of the delay of the kth first user behavior event.
[0088] Specifically, the first event interception mode is the second mode, which means that the user behavior event will be executed only if there are no repeated user behavior events of the same type within the preset time period. If repeated events of the same type occur, the user behavior event will be delayed until the next preset time period. If there are repeated events of the same type, the execution of the user behavior event will be delayed indefinitely until there are no repeated events of the same type within the next preset time period, and all other events within the delayed preset time period will be intercepted. For example, the preset time period is 2s, and the execution of the first user behavior event is delayed for 2s. If there are no other repeated events of the same type within these 2s, the first user behavior event will be executed. Otherwise, the execution of the first user behavior event will continue to be delayed for 2s until there are no repeated events of the same type within 2s.
[0089] For example, there are a large number of high-density embedded events in the homepage list of applications (APPs) on terminal devices such as mobile phones. After the throttle is applied, when the button is clicked, the swipe is repeated quickly, and the front and back ends are frequently switched on the homepage list of the APP, the throttle will add the repeated events to the corresponding event container, set each type of event to only execute once within 1 second, and the redundant repeated events will be intercepted. In this way, duplicate data is eliminated, and the collected user behavior data is more reasonable.
[0090] For example, when clicking on a list on an APP, the phone needs to perform tracking, network requests, page jumps, interface rendering, business logic processing, and phone hardware assistance such as Bluetooth, positioning, and recording, which will cause a large amount of power consumption. If the user clicks on the list 5 times in 1 second, after the throttle is applied, the operation of clicking on the list can only be performed once in 1 second, which greatly reduces power consumption.
[0091] S306: The client executes N first user behavior events that are not intercepted among the M first user behavior events.
[0092] In a possible implementation, N is less than M, indicating that (MN) events out of the M first user behavior events are intercepted, and finally the client only executes the N first user behavior events.
[0093] In another possible implementation, N is equal to M, indicating that there are no intercepted events among the M first user behavior events, and finally the client executes all the first user behavior events.
[0094] S307: The client collects user behavior data of N first user behavior events.
[0095] In a possible implementation, the client collects user behavior data of the N first user behavior events through a tracking mechanism.
[0096] In one possible implementation, for low-frequency user behavior events, a larger preset interception period or preset time period is set, so that the user behavior event is executed once at a larger time interval, which is conducive to saving power consumption. For high-frequency user behavior events, a smaller preset interception period or preset time period is set, so that the user behavior event is executed once at a smaller time interval, which increases the collection frequency and thus improves the accuracy of data collection. For example, a list sliding event will cause high-frequency event processing. For the accuracy of data collection, a smaller preset interception period or preset time period is set. For another example, a larger preset interception period or preset time period is set for a button click operation, which can prevent repeated button clicks. For example, repeated clicks on a jump button may result in repeated jumps.
[0097] For example, for text search in the search box, without affecting the user experience, setting a time interval limit for requesting the backend interface can reduce the number of interface calls and reduce server pressure. Specifically, in the traditional search box, a backend interface is requested once each character is entered. After the throttle is applied, the backend interface will be requested only when the time interval between input characters exceeds the set time interval limit (for example, 1.5s).
[0098] In a possible implementation, before collecting user behavior data of N first user behavior events, the client also obtains a second user behavior event; based on the event type of the first user behavior event, a first collection priority of the first user behavior event is obtained, and based on the event type of the second user behavior event, a second collection priority of the second user behavior event is obtained; if the first collection priority is higher than the second collection priority, user behavior data of the first user behavior event is collected first, and if the second collection priority is higher than the first collection priority, user behavior data of the second user behavior event is collected first.
[0099] Specifically, the collection priorities corresponding to different types of user behavior events may be different. For more important user behavior data, the corresponding collection priority is higher. In this way, more important user behavior data can be collected first, and the user behavior data collected in the end is more accurate.
[0100] S308: The client sends the user behavior data to the server.
[0101] S309. The server analyzes the user portrait based on the user behavior data.
[0102] It can be seen that through the user behavior data collection method provided by the embodiment of the present application, when the same type of user behavior events are frequent, the client only executes part of the user behavior events, and collects the user behavior data of the part of the user behavior events, and sends it to the server for analysis. On the one hand, by reducing the number of data collection times, power consumption is reduced. On the other hand, for the same type of user behavior events, only the user behavior data of part of the user behavior events is collected, which reduces the data duplication.
[0103] See also Figure 4 , Figure 4 A schematic diagram of a user behavior data collection device provided in an embodiment of the present application. Figure 4 As shown, a user behavior data collection device provided in an embodiment of the present application may include:
[0104] The first acquisition module 401 is used to acquire M first user behavior events, where M is an integer.
[0105] The second acquisition module 402 is used to acquire a first event interception mode of the first user behavior event according to the event type of the first user behavior event.
[0106] The execution module 403 is used to execute N first user behavior events among the M first user behavior events according to the first event interception mode, where N is an integer less than or equal to M.
[0107] The collection module 404 is used to collect the user behavior data of the N first user behavior events.
[0108] The sending module 405 is used to send the user behavior data to the server.
[0109] The specific implementation of the user behavior data collection device in the embodiment of the present application can be referred to the various embodiments of the user behavior data collection method mentioned above, which will not be described in detail here.
[0110] See also Figure 5 , Figure 5 Schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiment of the present application. Figure 5 As shown, the electronic device of the hardware operating environment involved in the embodiment of the present application may include:
[0111] Processor 501, such as CPU.
[0112] Memory 502, optionally, the memory may be a high-speed RAM memory, or a stable memory, such as a disk memory.
[0113] The communication interface 503 is used to realize the connection and communication between the processor 501 and the memory 502 .
[0114] Those skilled in the art will understand that Figure 5 The structure of the electronic device shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0115] like Figure 5 As shown, the memory 502 may include an operating system, a network communication module, and a user behavior data collection program. The operating system is a program that manages and controls the hardware and software resources of the electronic device, and supports the operation of the user behavior data collection program and other software or programs. The network communication module is used to realize communication between the components inside the memory 502, and communication with other hardware and software in the electronic device.
[0116] exist Figure 5 In the electronic device shown, the processor 501 is used to execute the user behavior data collection program stored in the memory 502 to implement the following steps:
[0117] Obtain M first user behavior events, where M is an integer;
[0118] Acquire a first event interception mode of the first user behavior event according to the event type of the first user behavior event;
[0119] According to the first event interception mode, executing N first user behavior events among the M first user behavior events, where N is an integer less than or equal to M;
[0120] Collecting user behavior data of the N first user behavior events;
[0121] The user behavior data is sent to the server.
[0122] The specific implementation of the electronic device in the embodiments of the present application can be found in the various embodiments of the above-mentioned user behavior data collection method, which will not be described in detail here.
[0123] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0124] Obtain M first user behavior events, where M is an integer;
[0125] Acquire a first event interception mode of the first user behavior event according to the event type of the first user behavior event;
[0126] According to the first event interception mode, executing N first user behavior events among the M first user behavior events, where N is an integer less than or equal to M;
[0127] Collecting user behavior data of the N first user behavior events;
[0128] The user behavior data is sent to the server.
[0129] The specific implementation of the computer-readable storage medium in the embodiments of the present application can be found in the various embodiments of the above-mentioned user behavior data collection method, which will not be described in detail here.
[0130] It should be understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but this implementation should not be considered to be beyond the scope of the present application.
[0131] Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application. In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0132] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units 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 units, which can be electrical, mechanical or other forms.
[0133] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0134] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0135] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0136] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A user behavior data collection method, characterized in that: include: Obtain M first user behavior events, where M is an integer; According to the event type of the first user behavior event, obtaining a first event interception mode of the first user behavior event includes: obtaining a correspondence between a preset event type and an event container; determining a first event container corresponding to the event type of the first user behavior event according to the correspondence between the event type and the event container; and obtaining the first event interception mode corresponding to the first event container; According to the first event interception mode, executing N first user behavior events that have not been intercepted among the M first user behavior events, where N is an integer less than or equal to M, including: placing the M first user behavior events into the first event container; according to the first event interception mode, intercepting the first user behavior events in the first event container; executing N first user behavior events that have not been intercepted among the M first user behavior events; Collecting user behavior data of the N first user behavior events; The user behavior data is sent to the server.
2. The method according to claim 1, characterized in that The step of intercepting the first user behavior event in the first event container according to the first event interception mode includes: Obtaining a triggering time of each first user behavior event among the M first user behavior events; When the first event interception mode is the first mode, according to the triggering time of each first user behavior event, i first user behavior events whose triggering time is within a preset interception period are determined, where i is an integer less than or equal to M; Intercept j first user behavior events among the i first user behavior events, where j is an integer less than i.
3. The method according to claim 1, characterized in that The step of intercepting the first user behavior event in the first event container according to the first event interception mode includes: Obtaining a triggering time of each first user behavior event among the M first user behavior events; When the first event interception mode is the second mode, if there is no other first user behavior event within a preset time period after the triggering time of the kth first user behavior event among the M first user behavior events, the kth first user behavior event is delayed for execution after the preset time period, where k is an integer less than or equal to M; If there are other first user behavior events, the kth first user behavior event will be delayed to be executed after the next preset time period until there are no other first user behavior events in the next preset time period, and other first user behavior events in each preset time period delayed by the kth first user behavior event will be intercepted.
4. The method according to claim 1, characterized in that: Before collecting the user behavior data of the N first user behavior events, the method further includes: Obtain a second user behavior event; According to the event type of the first user behavior event, obtaining a first collection priority of the first user behavior event, and according to the event type of the second user behavior event, obtaining a second collection priority of the second user behavior event; If the first collection priority is higher than the second collection priority, the user behavior data of the first user behavior event is collected first; if the second collection priority is higher than the first collection priority, the user behavior data of the second user behavior event is collected first.
5. The method according to claim 1 or 4, characterized in that: After acquiring the M first user behavior events, the method further includes: Obtaining a first user corresponding to the first user behavior event; Identifying whether the first user is an illegal user; If the first user is an illegal user, the user behavior data of the first user behavior event is not collected.
6. A user behavior data collection device, the device being used to execute the method according to any one of claims 1 to 5, characterized in that: include: A first acquisition module, used to acquire M first user behavior events, where M is an integer; A second acquisition module, configured to acquire a first event interception mode of the first user behavior event according to an event type of the first user behavior event; an execution module, configured to execute N first user behavior events among the M first user behavior events according to the first event interception mode, wherein N is an integer less than or equal to M; A collection module, used to collect user behavior data of the N first user behavior events; The sending module is used to send the user behavior data to the server.
7. An electronic device, characterized in that: The electronic device includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for executing the steps in any one of the methods of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 5.
