User behavior data processing method, device, equipment and storage medium
By constructing user behavior trajectory trees, the problem of extracting high value information from a large number of user behavior data is solved, and comprehensive analysis and efficient inquiries of data are realized.
Patent Information
- Application Number
- CN202010523803.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-10
- Publication Date
- 2025-01-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
How to extract high-value information from a large number of user behavior data, given that each user has different usage habits and huge data.
By constructing the user behavior trajectory tree, obtain the buried point identification of the start page and the user staying time, generate behavioral information, and build a user behavior tree based on the behavior log of each user to achieve data analysis and query.
A comprehensive and accurate analysis of user behavior data has been achieved, the efficiency of data query is improved, and high value information can be extracted.
Smart Images

Figure CN111679963B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method, device, equipment and storage medium for processing user behavior data. Background Art
[0002] At present, with the popularity of various applications on the client, the number of user registrations for applications is gradually increasing. The number of user registrations for an excellent application can even reach hundreds of millions. For the same application, each user has different usage habits. The data composed of user behavior logs is extremely large, and how to find high-value information from a large amount of data will be a problem we need to solve. Summary of the invention
[0003] The embodiments of the present invention provide a method, apparatus, device and storage medium for processing user behavior data, which achieve the purpose of analyzing and querying user behavior data by constructing a user behavior trajectory tree.
[0004] A method for processing user behavior data, comprising:
[0005] Obtain all valid page embedding points of the embedding point identifier of the start page, and generate behavior information according to the embedding point identifier and the stay time;
[0006] Obtaining all the behavior information of each user, and generating a corresponding user behavior log according to all the behavior information of each user;
[0007] A user behavior trajectory tree is constructed according to the embedding point identifier of the start page and the user behavior log of each of the users.
[0008] A device for processing user behavior data, comprising:
[0009] The first acquisition module is used to acquire all valid page embedding points of the embedding point identifier of the start page, and generate behavior information according to the embedding point identifier and the stay time;
[0010] A second acquisition module is used to acquire all the behavior information of each user and generate a corresponding user behavior log according to all the behavior information of each user;
[0011] A tree building module is used to build a user behavior trajectory tree according to the embedding point identifier of the start page and the user behavior log of each user.
[0012] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for processing user behavior data when executing the computer-readable instructions.
[0013] A computer-readable storage medium stores computer-readable instructions, which implement the above-mentioned method for processing user behavior data when executed by a processor.
[0014] The method, device, equipment and storage medium for processing user behavior data provided by the present invention obtain all valid page embedding points of the embedding point identifier of the start page, generate behavior information according to the embedding point identifier and the stay time, and then generate a corresponding user behavior log according to all the behavior information of each user, and construct a user behavior track tree according to the embedding point identifier of the start page and the user behavior log of each user. By constructing the user behavior track tree, the present invention is conducive to comprehensive and accurate analysis of user behavior data, and is conducive to improving the query efficiency of user behavior data. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0016] Figure 1 is a schematic diagram of an application environment of a method for processing user behavior data in one embodiment of the present invention;
[0017] Figure 2 is a flow chart of a method for processing user behavior data in one embodiment of the present invention;
[0018] Figure 3 is a flow chart of a method for processing user behavior data in another embodiment of the present invention;
[0019] Figure 4 is a flowchart of step S30 of the method for processing user behavior data in one embodiment of the present invention;
[0020] Figure 5 is a flowchart of step S301 of a method for processing user behavior data in one embodiment of the present invention;
[0021] Figure 6 is a flowchart of step S302 of the method for processing user behavior data in one embodiment of the present invention;
[0022] Figure 7 is a flowchart of step S40 of a method for processing user behavior data in another embodiment of the present invention;
[0023] Figure 8is a principle block diagram of a device for processing user behavior data in one embodiment of the present invention;
[0024] Fig. 9 is a principle block diagram of a device for processing user behavior data in another embodiment of the present invention;
[0025] Fig.10 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] The method for processing user behavior data provided by the present invention can be applied in the following aspects: Figure 1 In an application environment, a client communicates with a server via a network. The client includes but is not limited to various personal computers, laptops, smart phones, and tablet computers. The server can be implemented as an independent server or a server cluster consisting of multiple servers.
[0028] In one embodiment, if Figure 2 As shown, a method for processing user behavior data is provided, and the method is applied in Figure 1 The server in the example is used to illustrate the following steps:
[0029] S10, obtaining all valid page embedding points of the embedding point identifier of the start page, and generating behavior information according to the embedding point identifier and the stay duration.
[0030] The start page is the main page of the application, and one or more start pages can be set according to the needs; the effective page embedding point is obtained by embedding data from the pages generated after the start page and the user-defined page; the behavior information is a field consisting of the embedding point identifier, the stay time and the first connector. Preferably, the first connector is a colon.
[0031] Specifically, all valid page embedding points of any start page embedding point identifier are obtained, and the embedding point identifier and the dwell time are connected using a preset first connector to generate behavior information, and the behavior information is sorted in chronological order. For example, if the embedding point identifier is pv200 and the dwell time is 10 seconds, the generated behavior information is pv200:10.
[0032] S20, obtaining all the behavior information of each user, and generating a corresponding user behavior log according to all the behavior information of each user.
[0033] The user behavior log is a long field consisting of the behavior information and a second connector. Preferably, the second connector is a comma.
[0034] Specifically, all the behavior information of each user under the tracking point identification is obtained, and the behavior information is processed into columns and rows and connected with the second connector in turn to generate a user behavior log. That is, the behavior information can be converted into a user behavior log separated by commas. Exemplarily, if all the behavior information of a user is pv200:10, pv201:11, pv400:12, then the user behavior log after the above behavior information conversion can be pv200:10, pv201:11, pv400:12.
[0035] S30, constructing a user behavior trajectory tree according to the embedding point identifier of the start page and the user behavior log of each of the users.
[0036] Specifically, the embedding point identifier of the start page is used as a tree node for constructing a user behavior trajectory tree, and the user behavior log of each user is grouped to obtain multiple sub-data sets, and then the behavior trajectory subtrees are constructed in parallel based on the multiple sub-data sets, and all the behavior trajectory subtrees are merged to obtain the user behavior trajectory tree. Among them, the multiple sub-data sets are two or more sub-data sets, and each sub-data set contains all user behavior logs of users of the same category. Preferably, the user behavior trajectory tree is a ternary tree.
[0037] To sum up, this embodiment obtains all the behavior information of each user under the page identifier of the start page, generates a user behavior log, and constructs a user behavior trajectory tree based on the embedding point identifier of the start page and the user behavior log, which is conducive to comprehensive and accurate analysis of user behavior data and to improving the query efficiency of user behavior data.
[0038] In one embodiment, if Figure 3 As shown, after step S30, the following steps are included:
[0039] S40, receiving a traversal instruction, and obtaining an output set from the user behavior trajectory tree according to the traversal instruction.
[0040] Among them, the traversal instruction includes the traversal initial node and the corresponding traversal point identifier.
[0041] Specifically, the user behavior trajectory tree is traversed in depth first according to the traversal instruction, and the child nodes at several levels in the user behavior trajectory tree are output. If the traversal point identification of the initial node is the start page traversal point identification, the node data of the first number (preferably 20) of child nodes are obtained, and the output set is generated according to the node data of the first number of child nodes. If the traversal point identification of the initial node is not the start page traversal point identification, the node data of the second number (preferably 6) of child nodes are obtained, and the output set is generated according to the node data of the second number of child nodes. The number of people in each child node in the output set reaches the preset number threshold.
[0042] S50, writing the output set into a preset database corresponding to the server.
[0043] Preferably, the preset database is HBases, which is a distributed, column-oriented open source database.
[0044] S60, receiving a query instruction sent by a client, and sending the output set in the preset database to the client for display.
[0045] The client may include a mobile terminal and a PC terminal. In this embodiment, the output set in the preset database is sent to the terminal for display, which can achieve the purpose of visual presentation of user behavior trajectories, facilitate users to make optimized product decisions based on the data displayed on the client, and thus improve user stickiness and user experience.
[0046] In one embodiment, if Figure 4 As shown, the step S30 specifically includes the following steps:
[0047] S301, grouping the user behavior log of each of the users to obtain two or more sub-data sets, and constructing behavior trajectory subtrees in parallel according to the sub-data sets.
[0048] As a preference, Figure 5 As shown, step S301 includes the following steps:
[0049] S3011, checking whether the sub-dataset is empty.
[0050] S3012: when the sub-dataset is empty, output an empty behavior trajectory subtree.
[0051] S3013, when the sub-data set is not empty, read the user behavior log in the sub-data set, parse the user behavior log to obtain a set of behavior information, and set a tree node and corresponding node data according to the set of behavior information. Preferably, the node data includes a point identification, number of people, length of stay, root node, level, and sub-node set.
[0052] S3014: construct the behavior trajectory subtree according to all the tree nodes and the corresponding node data.
[0053] Specifically, when the sub-dataset is not empty, the user behavior logs in the sub-dataset are read in turn, and the user behavior logs are parsed to obtain a set of the behavior information. At this time, if it is the first user behavior log, the root node is set, and the node data corresponding to the root node is set to: the tracking point identifier is the identifier of the start page, the number of people is 0, the stay time is 0, the level is 0, the parent node is empty, and the child node set is 0; if it is not the first user behavior log, the behavior information is parsed to obtain the tracking point identifier and the stay time, and the tree node and the corresponding node data are set according to the tracking point identifier and the stay time until the group of behavior information is traversed, and the next line of user behavior log in the data set is read for parsing to obtain a corresponding set of behavior information, and the tree node and the corresponding node data are set according to the group of behavior information until all user behavior logs in the data set are traversed and read, and then a behavior trajectory subtree is generated according to all the tree nodes and the corresponding node data.
[0054] Among them, setting the tree node and the corresponding node data according to the burying point identifier and the stay time includes the following steps: if it is the first behavior information, the number of people in the root node is increased by 1, and the stay time is increased by the currently parsed stay time; if it is not the first behavior information, the currently parsed burying point identifier is the same as the burying point identifier of the current tree node, then the stay time of the current tree node is increased by the currently parsed stay time; if the currently parsed burying point identifier is different from the burying point identifier of the current tree node, then a new tree node is set, and the node data of the new tree node is set to: the burying point identifier is the identifier of the start page; the number of people is 1; the stay time is the parsed stay time, the child node set is empty, the level is the level of the current tree node increased by 1, the parent node is the current node, and the next behavior information is read until the group of behavior information is traversed.
[0055] S302: Merge the behavior track subtrees corresponding to the sub-data sets to generate a user behavior track tree corresponding to the start page.
[0056] As a preference, Figure 6 As shown, step S302 includes the following steps:
[0057] S3021, obtaining a subtree array including the behavior trajectory subtree, and detecting whether the subtree array is empty.
[0058] S3022: When the subtree array is empty, output an empty user behavior trajectory tree.
[0059] S3023: When the subtree array is not empty and the subtree array contains a behavior trajectory subtree, output the first behavior trajectory subtree as the user behavior trajectory tree.
[0060] S3034, when the subtree array contains multiple behavior trajectory subtrees, obtain the first behavior trajectory subtree to construct the user behavior trajectory tree, and traverse the subtree array to obtain other behavior trajectory subtrees, update and set the user behavior trajectory tree according to the other behavior trajectory subtrees, and output the updated user behavior trajectory tree.
[0061] Exemplarily, firstly, a behavior trajectory subtree is taken from the subtree array as the user behavior trajectory tree A, and the i-th behavior trajectory subtree (i=2, 3, ..., n) is taken from the subtree array, and the number of the root node in the user behavior trajectory tree A is updated and set to increase the number of the root node in the i-th behavior trajectory subtree, and the residence time of the root node in the user behavior trajectory tree A is increased by the residence time of the root node in the i-th behavior trajectory subtree; it is detected whether the child nodes (tree nodes other than the root node) of the i-th behavior trajectory subtree are empty, and if the i-th behavior trajectory subtree is empty, If the child node of the trajectory subtree is empty, then output the user behavior trajectory tree A, otherwise traverse the child nodes of the i-th behavior trajectory subtree; take a child node of the child node set, and determine whether the child node is at the same level of the user behavior trajectory tree A. If the child node is at the same level of the user behavior trajectory tree A, then the number of child nodes at the same level of the user behavior trajectory tree A is increased by the number of child nodes, and the length of stay of child nodes at the same level is increased by the length of stay of child nodes, and the next child node of the child node set is taken to perform the same steps. If the child node is not at the same level of the user behavior trajectory tree A, then the parent node of the child node is updated to the tree node of the previous level of the user behavior trajectory tree A, and the child node set of the tree node of the previous level of the user behavior trajectory tree A is increased by the child node, and the updated user behavior trajectory tree A is output.
[0062] In this embodiment, each start page corresponds to a user behavior track tree, and the start page and the user behavior track tree are associated and stored in a preset database corresponding to the server.
[0063] This embodiment generates a user behavior trajectory tree by merging behavior trajectory subtrees, which can remove invalid and repeated tracking pages and save data storage space.
[0064] In one embodiment, if Figure 7 As shown, the step S40 specifically includes the following steps:
[0065] S401, detecting whether the user behavior trajectory tree is empty.
[0066] S402: When the user behavior trajectory tree is empty, output an empty output set.
[0067] S403, when the user behavior trajectory tree is not empty, parse out the traversal initial node contained in the traversal instruction and the corresponding traversal point identifier.
[0068] S404, acquiring node data of a matching child node from the user behavior trajectory tree according to the traversal initial node and the corresponding tracking point identifier, and outputting the output set according to the node data of the child node.
[0069] Specifically, when the root node of the user behavior trajectory tree is determined according to the buried point identification of the traversed initial node, it is detected whether the child node set of the root node is empty. If the child node set of the root node is empty, the output set is output according to the node data of the root node, and the output set contains the node data of the root node; if the child node set of the root node is not empty, the child node set of the current root node is traversed to obtain the node data of the first number of child nodes, and the output set is output according to the node data of the first number of child nodes, and the output set contains the node data of the first number of child nodes. When the child node of the user behavior trajectory tree is determined according to the buried point identification of the traversed initial node, the node data of the child node is obtained, and the user behavior trajectory tree is returned to the previous level, and the child nodes associated with the previous level are further traversed to obtain the node data of the second number of child nodes, and then the output set is output according to the node data of the child node and the node data of the second number of child nodes, and the output set contains the node data of the child node and the node data of the second number of child nodes.
[0070] In one embodiment, if Figure 8 As shown, a user behavior data processing device is provided, and the user behavior data processing device corresponds to the user behavior data processing method in the above embodiment. The user behavior data processing device includes the following modules, and each functional module is described in detail as follows:
[0071] The first acquisition module 110 is used to acquire all valid page embedding points of the embedding point identifier of the start page, and generate behavior information according to the embedding point identifier and the stay time.
[0072] The second acquisition module 120 is used to acquire all the behavior information of each user and generate a corresponding user behavior log according to all the behavior information of each user.
[0073] The tree building module 130 is used to build a user behavior trajectory tree according to the embedding point identifier of the start page and the user behavior log of each of the users.
[0074] In one embodiment, if Fig. 9 As shown, the user behavior data processing device also includes the following modules, and each functional module is described in detail as follows:
[0075] The traversal module 140 is used to receive a traversal instruction and obtain an output set from the user behavior trajectory tree according to the traversal instruction.
[0076] The writing module 150 is used to write the output set into a preset database corresponding to the server.
[0077] The query module 160 is used to receive a query instruction sent by a client, and send the output set in the preset database to the client for display.
[0078] In one embodiment, the tree building module 130 includes the following submodules, and each functional submodule is described in detail as follows:
[0079] The grouping submodule is used to group the user behavior log of each of the users to obtain two or more sub-data sets, and to construct behavior trajectory subtrees in parallel according to the sub-data sets.
[0080] The merging submodule is used to merge the behavior track subtrees corresponding to the sub-data sets to generate a user behavior track tree corresponding to the start page.
[0081] In one embodiment, the grouping submodule specifically includes the following units, and each functional unit is described in detail as follows:
[0082] The first detection unit is used to detect whether the sub-dataset is empty.
[0083] The first output unit is used to output an empty behavior trajectory subtree when the sub-data set is empty.
[0084] The reading unit is used to read the user behavior log in the sub-dataset when the sub-dataset is not empty, parse the user behavior log to obtain a group of the behavior information, and set the tree node and the corresponding node data according to the group of the behavior information.
[0085] A construction unit is used to construct the behavior trajectory subtree according to all the tree nodes and the corresponding node data.
[0086] In one embodiment, the merging submodule includes the following units, and each functional unit is described in detail as follows:
[0087] The second detection unit is used to obtain a subtree array including the behavior trajectory subtree, and detect whether the subtree array is empty.
[0088] The second output unit is used to output an empty user behavior trajectory tree when the subtree array is empty.
[0089] The third output unit is used to output the first behavior trajectory subtree as the user behavior trajectory tree when the subtree array is not empty and the subtree array contains a behavior trajectory subtree.
[0090] The fourth output unit is used to obtain the first behavior trajectory subtree to construct the user behavior trajectory tree when the subtree array contains multiple behavior trajectory subtrees, and traverse the subtree array to obtain other behavior trajectory subtrees, update and set the user behavior trajectory tree according to the other behavior trajectory subtrees, and output the updated user behavior trajectory tree.
[0091] In one embodiment, the traversal module 140 includes the following submodules, and each functional submodule is described in detail as follows:
[0092] The detection submodule is used to detect whether the user behavior trajectory tree is empty.
[0093] The first output submodule is used to output an empty output set when the user behavior trajectory tree is empty.
[0094] The parsing submodule is used to parse out the traversal initial node and the corresponding traversal point identifier contained in the traversal instruction when the user behavior trajectory tree is not empty.
[0095] The second output submodule is used to obtain the node data of the matching child node from the user behavior trajectory tree according to the traversal initial node and the corresponding burial point identifier, and output the output set according to the node data of the child node.
[0096] For the specific definition of the user behavior data processing device, please refer to the definition of the user behavior data processing method above, which will not be repeated here. Each module in the above-mentioned user behavior data processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0097] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer-readable instructions and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. When the computer-readable instructions are executed by the processor, a method for processing user behavior data is implemented.
[0098] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor executes the computer-readable instructions to implement the following steps:
[0099] Obtain all valid page embedding points of the embedding point identifier of the start page, and generate behavior information according to the embedding point identifier and the stay time;
[0100] Obtaining all the behavior information of each user, and generating a corresponding user behavior log according to all the behavior information of each user;
[0101] A user behavior trajectory tree is constructed according to the embedding point identifier of the start page and the user behavior log of each of the users.
[0102] In one embodiment, a computer-readable storage medium is provided, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
[0103] Obtain all valid page embedding points of the embedding point identifier of the start page, and generate behavior information according to the embedding point identifier and the stay time;
[0104] Obtaining all the behavior information of each user, and generating a corresponding user behavior log according to all the behavior information of each user;
[0105] A user behavior trajectory tree is constructed according to the embedding point identifier of the start page and the user behavior log of each of the users.
[0106] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0107] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units or modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units or modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0108] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for processing user behavior data, characterized in that: include: Obtain all valid page embedding points of the embedding point identifier of the start page, and generate behavior information according to the embedding point identifier and the stay time; Obtaining all the behavior information of each user, and generating a corresponding user behavior log according to all the behavior information of each user; Constructing a user behavior track tree according to the embedding point identifier of the start page and the user behavior log of each of the users; After the user behavior track tree is constructed according to the embedding point identifier of the start page and the user behavior log of each user, the method includes: receiving a traversal instruction, and obtaining an output set from the user behavior trajectory tree according to the traversal instruction; Writing the output set into a preset database corresponding to the server; Receiving a query instruction sent by a client, and sending the output set in the preset database to the client for display; The receiving a traversal instruction and obtaining an output set from the user behavior trajectory tree according to the traversal instruction includes: Detecting whether the user behavior trajectory tree is empty; When the user behavior trajectory tree is empty, outputting an empty output set; When the user behavior trajectory tree is not empty, parsing the traversal initial node contained in the traversal instruction and the corresponding traversal point identifier; According to the traversal initial node and the corresponding embedding point identifier, the node data of the matching child node is obtained from the user behavior trajectory tree, and the output set is output according to the node data of the child node.
2. The method for processing user behavior data according to claim 1, characterized in that: The step of constructing a user behavior track tree according to the embedding point identifier of the start page and the user behavior log of each user includes: Grouping the user behavior log of each of the users to obtain two or more sub-data sets, and constructing behavior trajectory subtrees in parallel according to the sub-data sets; The behavior track subtrees corresponding to the sub-data sets are merged to generate a user behavior track tree corresponding to the start page.
3. The method for processing user behavior data according to claim 2, characterized in that: The step of grouping the user behavior log of each user to obtain two or more sub-data sets, and constructing behavior trajectory subtrees in parallel according to the sub-data sets includes: Detecting whether the sub-dataset is empty; When the sub-dataset is empty, outputting an empty behavior trajectory subtree; When the sub-data set is not empty, reading the user behavior log in the sub-data set, parsing the user behavior log to obtain a group of the behavior information, and setting a tree node and corresponding node data according to the group of the behavior information; The behavior trajectory subtree is constructed according to all the tree nodes and the corresponding node data.
4. The method for processing user behavior data according to claim 2, characterized in that: The step of merging the behavior track subtrees corresponding to the sub-data sets to generate a user behavior track tree corresponding to the start page includes: Obtain a subtree array containing the behavior trajectory subtree, and detect whether the subtree array is empty; When the subtree array is empty, outputting an empty user behavior trajectory tree; When the subtree array is not empty and the subtree array contains a behavior trajectory subtree, outputting the first behavior trajectory subtree as the user behavior trajectory tree; When the subtree array contains multiple behavior trajectory subtrees, the first behavior trajectory subtree is obtained to construct the user behavior trajectory tree, and the subtree array is traversed to obtain other behavior trajectory subtrees, and the user behavior trajectory tree is updated and set according to the other behavior trajectory subtrees, and the updated user behavior trajectory tree is output.
5. A device for processing user behavior data, characterized in that: include: A first acquisition module is used to acquire all valid page embedding points of the embedding point identifier of the start page, and generate behavior information according to the embedding point identifier and the stay time; A second acquisition module is used to acquire all the behavior information of each user and generate a corresponding user behavior log according to all the behavior information of each user; A tree building module, used to build a user behavior track tree according to the embedding point identifier of the start page and the user behavior log of each user; A traversal module, used for receiving a traversal instruction, and obtaining an output set from the user behavior trajectory tree according to the traversal instruction; A writing module, used for writing the output set into a preset database corresponding to the server; A query module, used for receiving a query instruction sent by a client, and sending the output set in the preset database to the client for display; The traversal module includes: A detection submodule, used to detect whether the user behavior trajectory tree is empty; A first output submodule, configured to output an empty output set when the user behavior trajectory tree is empty; A parsing submodule, used for parsing the traversal initial node and the corresponding traversal point identifier contained in the traversal instruction when the user behavior trajectory tree is not empty; The second output submodule is used to obtain the node data of the matching child node from the user behavior trajectory tree according to the traversal initial node and the corresponding burial point identifier, and output the output set according to the node data of the child node.
6. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, it implements the method for processing user behavior data as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the method for processing user behavior data as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
User operation track recording method and device, computer equipment and storage medium
CN111259050A