User behavior identification method, device, equipment, storage medium and program product
By optimizing the community network through a community detection algorithm that performs graph reconstruction loops in multiple processes, the disconnection problem caused by the Louvain algorithm is solved, and the accuracy and computational efficiency of user behavior recognition are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2026-04-14
AI Technical Summary
The Louvain community discovered that the algorithm may cause disconnected results in complex network partitioning, affecting the accuracy of user behavior recognition.
The community discovery algorithm is used to perform graph reconstruction loops in multiple processes until the modularity gain in the community network is lower than the gain threshold. The community network is optimized by community merging and sub-community splitting to ensure node connectivity and local optimal allocation.
It improves the segmentation of community networks, enhances the accuracy of user behavior recognition, and improves computational efficiency, especially in large-scale data processing.
Smart Images

Figure CN118673362B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a method, apparatus, device, storage medium, and program product for identifying user behavior. Background Technology
[0002] Community detection is a technique that identifies communities or subnetworks with specific patterns within complex network structures, thereby dividing the complex network and uncovering potential connections between nodes. Community detection has wide applications in big data technology. It can be used to construct complex networks highlighting abnormal behavior based on user transaction and application information, and then analyze and mine this network using community detection to effectively identify and prevent abnormal user behavior.
[0003] In related technologies, the Louvain community detection algorithm can be used to perform modularity gain calculation and graph reconstruction within each process, thereby partitioning complex networks. However, the Louvain community detection algorithm may generate poorly connected or even disconnected communities, affecting the partitioning results of complex networks and thus reducing the accuracy of user behavior identification through complex networks. Summary of the Invention
[0004] Therefore, it is necessary to provide a user behavior identification method, device, equipment, storage medium, and program product that can improve the accuracy of user behavior identification in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a method for identifying user behavior, including:
[0006] Obtain the community network to be processed, which includes multiple nodes and multiple edges. Each node is used to represent the user data of a user to be identified, and each edge is used to represent the association weight information between two nodes.
[0007] The community detection algorithm is used to perform graph reconstruction loops on the community network in multiple processes until the modularity gain between multiple nodes in the community network is lower than the gain threshold, so as to obtain an optimized community network. The community detection algorithm is used to merge multiple nodes in the community network according to multiple edges in the community network, and to split sub-communities according to the connectivity between nodes in the merged community.
[0008] The graph reconstruction loop includes: allocating multiple nodes and edges in the community network corresponding to the current graph reconstruction to multiple processes; in each process, merging the communities of the allocated nodes according to the association weight information corresponding to the allocated edges, and splitting the sub-communities according to the connectivity status between the nodes in the merged community; and obtaining the community network corresponding to the next graph reconstruction based on the merged community and the split sub-communities in each process.
[0009] In one embodiment, the step of merging the communities of the assigned nodes based on the association weight information corresponding to the assigned edges includes:
[0010] Based on the association weight information corresponding to the assigned edges, calculate the modularity gain among the assigned nodes;
[0011] Based on the modularity gain among the assigned nodes, community merging is performed on the assigned nodes.
[0012] In one embodiment, the step of community merging of the assigned nodes based on the modularity gain among the assigned nodes includes:
[0013] If any two target nodes among the allocated nodes have a modularity gain greater than a gain threshold, then the two target nodes are merged into a community.
[0014] In one embodiment, obtaining the community network corresponding to the next graph reconstruction based on the merged community and the split sub-communities in each process includes:
[0015] Based on the merged community and the split sub-communities in each process, determine the node optimization information and adjacent node information of the multiple nodes assigned to each process;
[0016] By exchanging the node optimization information and the neighboring node information at different nodes, the node information and edge information corresponding to the next graph reconstruction are determined.
[0017] Based on the node and edge information corresponding to the next graph reconstruction, the community network corresponding to the next graph reconstruction is obtained.
[0018] In one embodiment, after assigning multiple nodes and multiple edges in the community network corresponding to the current graph reconstruction to multiple processes, the method further includes:
[0019] Based on the multiple edges assigned to each process, determine the associated nodes corresponding to the multiple nodes assigned to each process;
[0020] Each process stores user data for multiple nodes assigned to that process, as well as user data for associated nodes corresponding to the multiple nodes assigned to that process.
[0021] In one embodiment, inferring the user behavior of the user to be identified based on the optimized community network includes:
[0022] Obtain the tag information of identified users;
[0023] Based on the tag information of the identified users and the communities in which the identified users are located in the optimized community network, the user behavior of the user to be identified is inferred.
[0024] Secondly, this application also provides a user behavior recognition device, comprising:
[0025] The acquisition module acquires the community network to be processed, which includes multiple nodes and multiple edges. Each node is used to represent the user data of a user to be identified, and each edge is used to represent the association weight information between two nodes.
[0026] A reconstruction module is used to perform a graph reconstruction loop on the community network in multiple processes using a community detection algorithm until the modularity gain among multiple nodes in the community network is lower than a gain threshold to obtain an optimized community network. The community detection algorithm is used to merge multiple nodes in the community network based on multiple edges in the community network, and to split sub-communities based on the connectivity between nodes in the merged community. The graph reconstruction loop includes: assigning multiple nodes and multiple edges in the community network corresponding to the current graph reconstruction to multiple processes; in each process, merging multiple nodes based on the association weight information corresponding to the assigned multiple edges, and splitting sub-communities based on the connectivity between nodes in the merged community; and obtaining the community network corresponding to the next graph reconstruction based on the merged community and the split sub-communities in each process.
[0027] The inference module is used to infer the user behavior of the user to be identified based on the optimized community network.
[0028] In one embodiment, the reconstruction module is further configured to calculate the modularity gain among the multiple nodes based on the association weight information corresponding to the multiple edges; and to perform community merging on the multiple nodes based on the modularity gain among the multiple nodes.
[0029] In one embodiment, the reconstruction module is further configured to perform community merging on the two target nodes if the modularity gain between any two target nodes among the allocated plurality of nodes is greater than a gain threshold.
[0030] In one embodiment, the reconstruction module is further configured to determine the node optimization information and adjacent node information of multiple nodes allocated to each process based on the merged community and the split sub-communities in each process; determine the node information and edge information corresponding to the next graph reconstruction by exchanging the node optimization information and the adjacent node information in different nodes; and obtain the community network corresponding to the next graph reconstruction based on the node information and edge information corresponding to the next graph reconstruction.
[0031] In one embodiment, the reconstruction module is further configured to determine the associated nodes corresponding to the multiple nodes allocated to each process based on the multiple edges allocated to each process; and to store in each process the user data of the multiple nodes allocated to the process, and the user data of the associated nodes corresponding to the multiple nodes allocated to the process.
[0032] In one embodiment, the inference module is further configured to obtain the tag information of the identified user; and infer the user behavior of the user to be identified based on the tag information of the identified user and the community in which the identified user is located in the optimized community network.
[0033] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-mentioned user behavior recognition method.
[0034] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned method for recognizing user behavior.
[0035] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method for recognizing user behavior.
[0036] The aforementioned user behavior identification method, apparatus, device, storage medium, and program product first acquire a community network to be processed. This community network includes multiple nodes and edges. Each node represents user data of a user to be identified, and each edge represents the association weight information between two nodes. Subsequently, a community detection algorithm is used to perform a graph reconstruction loop on the community network in multiple processes until the modularity gain between multiple nodes in the community network is lower than a gain threshold, resulting in an optimized community network. Specifically, the community detection algorithm merges multiple nodes in the community network based on multiple edges and splits sub-communities based on the connectivity between nodes in the merged community. Finally, the user behavior of the user to be identified is inferred based on the optimized community network. Because the graph reconstruction process in multiple processes not only merges communities based on the association weight information between nodes but also splits sub-communities based on the connectivity between nodes in the merged community, it ensures that the community merging of all nodes is locally optimal while also guaranteeing that all nodes are connected. This improves the partitioning effect of the community network and, consequently, increases the accuracy of user behavior identification using the partitioned community network. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 An application environment diagram for a user behavior recognition method provided in an embodiment of this application;
[0039] Figure 2 A flowchart illustrating a user behavior recognition method provided in an embodiment of this application;
[0040] Figure 3 A flowchart illustrating another user behavior recognition method provided in this application embodiment;
[0041] Figure 4 A flowchart illustrating another user behavior recognition method provided in this application embodiment;
[0042] Figure 5 A structural block diagram of a user behavior recognition device provided in an embodiment of this application;
[0043] Figure 6 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. It should be noted that existing industry solutions such as software, components, and models may be mentioned in the embodiments of this application. These should be considered exemplary and are intended only to illustrate the feasibility of implementing the technical solutions of this application, but do not imply that the applicant has already used or necessarily used such solutions.
[0045] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant regulations. The acquisition, storage, use, and processing of data in the technical solution of this application all comply with the relevant provisions of national laws and regulations.
[0046] The user behavior recognition method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server.
[0047] Terminal 102 can send user data to server 104. After server 104 aggregates multiple user data sets, it can identify user behavior. Server 104 can first obtain the community network to be processed, which includes multiple nodes and multiple edges. Each node represents the user data of a user to be identified, and each edge represents the association weight information between two nodes. Subsequently, server 104 uses a community detection algorithm to perform graph reconstruction loops on the community network in multiple processes until the modularity gain between multiple nodes in the community network is lower than the gain threshold, thus obtaining an optimized community network. The community detection algorithm is used to merge multiple nodes in the community network based on multiple edges, and to split sub-communities based on the connectivity between nodes in the merged community. Finally, server 104 infers the user behavior of the user to be identified based on the optimized community network.
[0048] The graph reconstruction loop includes: allocating multiple nodes and edges in the community network corresponding to the current graph reconstruction to multiple processes; in each process, merging the communities of the allocated nodes according to the association weight information corresponding to the allocated edges, and splitting the sub-communities according to the connectivity between the nodes in the merged community; and obtaining the community network corresponding to the next graph reconstruction based on the merged community and the split sub-communities in each process.
[0049] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0050] In one exemplary embodiment, such as Figure 2 As shown, a method for recognizing user behavior is provided, which can be applied to... Figure 1 Taking the server in the example, the method for identifying this user behavior includes S201-S203:
[0051] S201. Obtain the community network to be processed. The community network includes multiple nodes and multiple edges. Each node is used to represent the user data of a user to be identified, and each edge is used to represent the association weight information between two nodes.
[0052] The aforementioned user data may include the user's own data and the data of the user's associates. For example, user data may include the user's name, user identification, user contact number, the relationship between the user and associates, the names and identification of associates, the user's accounts, and the user's resource transaction information.
[0053] It should be understood that the embodiments of this application do not limit how the community network to be processed is generated. In some embodiments, the server can collect user data from different terminals in real time. Subsequently, the server can convert the collected user data into identifiable user data using a pre-built user model. After the user data conversion is completed, each user's user data can be used as a node in the community network, thereby generating the community network to be processed. Subsequently, the server saves the community network to be processed and retrieves it from a specific storage location when user behavior recognition is required.
[0054] In some embodiments, when generating the community network to be processed, the server can also assign label information and feature vectors to each node in the community network based on user data. For nodes with associations, association weight information between nodes can be generated, that is, edges between nodes can be generated in the community network.
[0055] S202. Using the community detection algorithm, perform graph reconstruction loops on the community network in multiple processes until the modularity gain between multiple nodes in the community network is lower than the gain threshold, so as to obtain the optimized community network.
[0056] In this step, after the server obtains the community network to be processed, it can use the community discovery algorithm to reconstruct the community network multiple times in multiple processes to obtain an optimized community network.
[0057] The community detection algorithm is used to merge multiple nodes in a community network based on multiple edges in the community network, and to split sub-communities based on the connectivity between nodes in the merged community.
[0058] It should be understood that the community detection algorithm in this application can be the Leiden parallel community algorithm. The Leiden parallel community algorithm can reconstruct the community network multiple times in multiple processes to divide the community network. By continuously adjusting the parameters and cross-validating with the test set, the optimal community division can be obtained so as to make subsequent predictions and identifications of user behavior.
[0059] In this application, by employing the Leiden parallel community algorithm, community merging and sub-community splitting are performed during graph reconstruction. This ensures not only locally optimal allocation of all nodes but also connectivity. Furthermore, the Leiden parallel community algorithm is computationally efficient. Compared to related technologies that require visiting all nodes in each iteration, resulting in significant time spent scanning, the Leiden parallel community algorithm in this application only needs to visit nodes whose neighbors have changed after visiting all nodes once, effectively achieving local movement.
[0060] It should be understood that the embodiments of this application do not limit how the community network is reconstructed multiple times in multiple processes. In some embodiments, the server can execute a graph reconstruction loop until the modularity gain between multiple nodes in the community network is lower than the gain threshold.
[0061] The graph reconstruction cycle includes:
[0062] The community network corresponding to the current graph reconstruction is distributed to multiple processes. In each process, the communities of the distributed nodes are merged according to the association weight information corresponding to the distributed edges, and the sub-communities are split according to the connectivity between the nodes in the merged community. Based on the merged community and the split sub-communities in each process, the community network corresponding to the next graph reconstruction is obtained.
[0063] The following section will first explain the process of splitting nodes and edges in each graph reconstruction.
[0064] It should be understood that in each graph reconstruction, since there are multiple processes, the first step is to split the nodes and edges. The server can distribute the nodes and edges of the community network to each process. When distributing nodes and edges, the number of nodes and edges allocated to each process should be as equal as possible, so that the computational cost of each process is likely to be consistent, thereby avoiding the situation where some processes are waiting during graph reconstruction.
[0065] In some embodiments, after allocating multiple nodes and edges in the community network corresponding to the current graph reconstruction to multiple processes, the server can also determine the associated nodes corresponding to the multiple nodes allocated to each process based on the multiple edges allocated to each process. Subsequently, the server stores in each process the user data of the multiple nodes allocated to that process, as well as the user data of the associated nodes corresponding to the multiple nodes allocated to that process.
[0066] For example, after completing the allocation of nodes and edges, the server can further determine the associated nodes of each node. This allows each process to store not only the user data of the nodes it is assigned, but also the user data of the associated nodes of nodes belonging to other processes but also within its own process.
[0067] The following section explains the iterative community partitioning process performed by each process in each graph reconstruction.
[0068] In some embodiments, during each graph reconstruction, the server can calculate the modularity gain between the multiple nodes in each process based on the association weight information corresponding to the multiple edges assigned. Subsequently, the server performs community merging on the multiple nodes assigned in each process based on the modularity gain between the multiple nodes assigned.
[0069] Modularity is a metric used to measure the structure of a community network and to evaluate its performance. Modularity measures the difference between the density of connections between nodes within a community network and the density of connections between nodes within a community network.
[0070] In some embodiments, community merging is performed on the multiple allocated nodes based on the modularity gain among the multiple allocated nodes, including: if there are any two target nodes among the multiple allocated nodes whose modularity gain is greater than a gain threshold, then community merging is performed on the two target nodes.
[0071] For example, in each process, each node in the assigned community network can be treated as a separate community. Then, the modularity gain between the nodes can be calculated. If the modularity gain is greater than a threshold, the node can be moved to a new community to complete the community merging. If the modularity gain is less than or equal to the merging threshold, the node can remain in its original community.
[0072] The aforementioned merging threshold can be set according to the actual situation, for example, it can be set to 0.
[0073] It should be understood that the modularity gain is defined for a single node (community). When a node merges into a community, the modularity of the entire graph needs to be calculated. By comparing the modularity of the entire graph with that before the merge, the modularity gain between the nodes can be obtained.
[0074] For example, the modularity gain can be determined by formula (1).
[0075]
[0076] Where, k i and k inIt is the sum of the association weights of the edges between node i (or node i's community A) and all nodes in community B to which i is to be moved, ∑ tot It is the sum of the association weights of the edges connecting node i (or its community A) and all the nodes or communities assigned to it, where m is the total association weight assigned.
[0077] In some embodiments, after merging the communities of the assigned nodes in each process during each graph reconstruction, sub-communities may also be split to improve the community merging (community partitioning) results.
[0078] For example, regarding the splitting process of sub-communities, we can assume that the community formed after the community merger is P. Then, we define each node in community P as a separate community, and then merge these nodes locally in community P. Independent nodes in P can merge with other communities. Furthermore, a node is only merged into a community if the node and community are well connected in P. After improving the community merging process in community P, community P may split into more smaller communities due to internal node disconnections.
[0079] It should be noted that since the splitting process of sub-communities only takes place within each community, the community number will not change.
[0080] It's important to note that during the phase of improving community merging outcomes, nodes don't necessarily greedily merge with communities, nor do they need to maximize the modularity gain. Instead, a node can merge with any community whose modularity gain has increased, and this merging is randomized; the greater the increase in modularity gain, the more likely the community is to be selected. This randomness in community selection allows for a broader exploration of the community space.
[0081] In some embodiments, after each process merges communities and splits sub-communities during each graph reconstruction, the community network can be consolidated based on the improved partitioning, and the consolidated community network can be initialized based on the unimproved partitioning. It should be noted that after each graph reconstruction forms a new community network, the community numbers can retain their original values.
[0082] In some embodiments, the community merging and sub-community splitting performed by each process in each graph reconstruction can be implemented using the Leiden serial sub-algorithm in the Leiden parallel community algorithm. In each graph reconstruction, the Leiden serial sub-algorithm can be executed once. After execution, the community situation of each process has changed to some extent, and each process can exchange its own node information and neighboring node information.
[0083] For example, after obtaining the community network corresponding to the next graph reconstruction based on the merged community and split sub-communities in each process, the server can determine the node optimization information and neighboring node information of multiple nodes assigned to each process based on the merged community and split sub-communities in each process. Subsequently, the server determines the node information and edge information corresponding to the next graph reconstruction by exchanging the node optimization information and neighboring node information among different nodes. Finally, the server obtains the community network corresponding to the next graph reconstruction based on the node information and edge information corresponding to the next graph reconstruction.
[0084] For example, the server can generate the latest community network based on the latest node and edge information. Similarly, the graph reconstruction loop is repeatedly executed until the modularity gain among multiple nodes in the community network is lower than the gain threshold, thus obtaining the optimized community network.
[0085] It should be noted that the multiple graph reconstructions of the community network in this application can be performed in multiple processes. With the explosive growth of data, single-node processing is no longer sufficient; the limitations of a single hardware device and the excessive time required are intolerable. By performing graph reconstruction of the community network in parallel across multiple processes, when faced with increasing data volumes, it is possible to handle ultra-large-scale community networks and shorten processing time simply by adding an unlimited number of computing nodes.
[0086] S203. Based on the optimized community network, infer the user behavior of the user to be identified.
[0087] In this step, the server uses a community discovery algorithm to reconstruct the community network multiple times in multiple processes to obtain an optimized community network. Based on the optimized community network, the user behavior of the user to be identified can be inferred.
[0088] User behavior can be specifically configured based on actual circumstances, such as fraudulent behavior or harassment behavior.
[0089] It should be understood that the embodiments of this application do not limit how the user behavior of the user to be identified is inferred based on the optimized community network. In some embodiments, the server can obtain the tag information of the identified user. Subsequently, the server infers the user behavior of the user to be identified based on the tag information of the identified user and the community in which the identified user is located in the optimized community network.
[0090] For example, if the aforementioned user behavior constitutes fraud, then the user's identified tag information is a fraud tag. If a large number of users in a community within the optimized community network are labeled as fraudulent, then even users in that community whose tags are not fraudulent can be suspected of engaging in fraudulent behavior. Subsequently, users suspected of engaging in fraudulent behavior can be reported to relevant personnel for further verification, and additional scrutiny can be conducted when handling resource interaction transactions involving users suspected of engaging in fraudulent behavior.
[0091] The user behavior identification method provided in this application first obtains a community network to be processed. The community network includes multiple nodes and multiple edges. Each node represents the user data of a user to be identified, and each edge represents the association weight information between two nodes. Then, a community detection algorithm is used to reconstruct the community network multiple times in multiple processes to obtain an optimized community network. Specifically, the community detection algorithm merges multiple nodes in the community network based on multiple edges and splits sub-communities based on the connectivity between nodes in the merged community. Finally, the user behavior of the user to be identified is inferred based on the optimized community network. Because the graph reconstruction process in multiple processes not only merges communities based on the association weight information between nodes but also splits sub-communities based on the connectivity between nodes in the merged community, it ensures that the community merging of all nodes is locally optimal while also ensuring that all nodes are connected. This improves the partitioning effect of the community network and thus increases the accuracy of user behavior identification using the partitioned community network.
[0092] The following explains how to infer the user behavior of the user to be identified based on the optimized community network. Figure 3 A flowchart illustrating another user behavior recognition method provided in this application embodiment is shown below. Figure 3 As shown, the method for identifying this user behavior includes S301-S304:
[0093] S301, Obtain the community network to be processed.
[0094] The community network consists of multiple nodes and multiple edges. Each node represents the user data of a user to be identified, and each edge represents the association weight information between two nodes.
[0095] S302. Using a community detection algorithm, the community network is reconstructed multiple times in multiple processes to obtain an optimized community network.
[0096] The community detection algorithm is used to merge multiple nodes in a community network based on multiple edges in the community network, and to split sub-communities based on the connectivity between nodes in the merged community.
[0097] S303. Obtain the tag information of the identified user.
[0098] S304. Based on the tag information of the identified users and the communities in which the identified users are located in the optimized community network, infer the user behavior of the user to be identified.
[0099] User behavior can be specifically configured based on actual circumstances, such as fraudulent behavior or harassment behavior.
[0100] For example, if the aforementioned user behavior constitutes fraud, then the user's identified tag information is a fraud tag. If a large number of users in a community within the optimized community network are labeled as fraudulent, then even users in that community whose tags are not fraudulent can be suspected of engaging in fraudulent behavior. Subsequently, users suspected of engaging in fraudulent behavior can be reported to relevant personnel for further verification, and additional scrutiny can be conducted when handling resource interaction transactions involving users suspected of engaging in fraudulent behavior.
[0101] In this application, user behavior identification through an optimized community network can detect potential fraudulent activities at the initial stage, preventing fraud at its source. Furthermore, using the Leiden parallel community detection algorithm to partition the community network allows for grouping individuals with similar behaviors together for focused review, leading to more rigorous business approvals. Moreover, because the parallel algorithm significantly improves computational efficiency, even fraudulent activities that have already occurred can be stopped immediately, mitigating some losses.
[0102] The following section explains how to use the community detection algorithm to reconstruct the graph of the community network multiple times in multiple processes. Figure 4 A flowchart illustrating another user behavior recognition method provided in this application embodiment is shown below. Figure 4 As shown, the method for identifying this user behavior includes S401-S408:
[0103] S401, Obtain the community network to be processed.
[0104] The community network consists of multiple nodes and multiple edges. Each node represents the user data of a user to be identified, and each edge represents the association weight information between two nodes.
[0105] S402. Determine whether the modularity gain among multiple nodes in the community network is lower than the gain threshold.
[0106] If yes, then execute S406; otherwise, execute S403.
[0107] S403. Assign multiple nodes and edges in the community network corresponding to the current graph reconstruction to multiple processes.
[0108] In some embodiments, after allocating multiple nodes and edges in the community network corresponding to the current graph reconstruction to multiple processes, the server may first determine the associated nodes corresponding to the multiple nodes allocated to each process based on the multiple edges allocated to each process. Subsequently, the server stores in each process the user data of the multiple nodes allocated to that process, as well as the user data of the associated nodes corresponding to the multiple nodes allocated to that process.
[0109] S404. In each process, based on the association weight information corresponding to the multiple edges assigned, the multiple nodes assigned are merged into communities, and the sub-communities are split according to the connectivity status between the nodes in the merged community.
[0110] In some embodiments, the server may first calculate the modularity gain among the assigned nodes based on the association weight information corresponding to the assigned edges. Subsequently, the server performs community merging on the assigned nodes based on the modularity gain among the assigned nodes.
[0111] S405. Based on the merged communities and split sub-communities in each process, obtain the community network corresponding to the next graph reconstruction.
[0112] In some embodiments, the server can first determine the node optimization information and neighboring node information of multiple nodes assigned to each process based on the merged community and the split sub-communities in each process. Then, the server can determine the node information and edge information corresponding to the next graph reconstruction by exchanging the node optimization information and neighboring node information among different nodes. Finally, the server can obtain the community network corresponding to the next graph reconstruction based on the node information and edge information corresponding to the next graph reconstruction.
[0113] After S405, execute S402.
[0114] S406. Determine the current community network as the optimized community network.
[0115] S407. Obtain the tag information of the identified user.
[0116] S408. Based on the tag information of the identified users and the communities in which the identified users are located in the optimized community network, infer the user behavior of the user to be identified.
[0117] The user behavior identification method provided in this application first obtains a community network to be processed. The community network includes multiple nodes and multiple edges. Each node represents the user data of a user to be identified, and each edge represents the association weight information between two nodes. Then, a community detection algorithm is used to reconstruct the community network multiple times in multiple processes to obtain an optimized community network. Specifically, the community detection algorithm merges multiple nodes in the community network based on multiple edges and splits sub-communities based on the connectivity between nodes in the merged community. Finally, the user behavior of the user to be identified is inferred based on the optimized community network. Because the graph reconstruction process in multiple processes not only merges communities based on the association weight information between nodes but also splits sub-communities based on the connectivity between nodes in the merged community, it ensures that the community merging of all nodes is locally optimal while also ensuring that all nodes are connected. This improves the partitioning effect of the community network and thus increases the accuracy of user behavior identification using the partitioned community network.
[0118] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0119] Based on the same inventive concept, this application also provides a user behavior recognition device for implementing the user behavior recognition method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations of one or more user behavior recognition device embodiments provided below can be found in the limitations of the user behavior recognition method described above, and will not be repeated here.
[0120] In one exemplary embodiment, such as Figure 5 As shown, a user behavior recognition device 500 is provided, including: an acquisition module 501, a reconstruction module 502, and an inference module 503, wherein:
[0121] The acquisition module 501 acquires the community network to be processed. The community network includes multiple nodes and multiple edges. Each node is used to represent the user data of a user to be identified, and each edge is used to represent the association weight information between two nodes.
[0122] Reconstruction module 502 is used to perform graph reconstruction loops on the community network in multiple processes using a community detection algorithm until the modularity gain among multiple nodes in the community network is lower than the gain threshold, thus obtaining an optimized community network. The community detection algorithm is used to merge multiple nodes in the community network based on multiple edges in the community network, and to split sub-communities based on the connectivity between nodes in the merged community. The graph reconstruction loop includes: assigning multiple nodes and multiple edges in the community network corresponding to the current graph reconstruction to multiple processes; in each process, merging multiple nodes based on the association weight information corresponding to the assigned multiple edges, and splitting sub-communities based on the connectivity between nodes in the merged community; and obtaining the community network corresponding to the next graph reconstruction based on the merged community and the split sub-communities in each process.
[0123] The inference module 503 is used to infer the user behavior of the user to be identified based on the optimized community network.
[0124] In one embodiment, the reconstruction module 502 is further configured to calculate the modularity gain among the multiple nodes based on the association weight information corresponding to the multiple edges; and to perform community merging on the multiple nodes based on the modularity gain among the multiple nodes.
[0125] In one embodiment, the reconstruction module 502 is further configured to perform community merging on two target nodes if the modularity gain between any two target nodes among the allocated nodes is greater than a gain threshold.
[0126] In one embodiment, the reconstruction module 502 is further configured to determine the node optimization information and adjacent node information of multiple nodes allocated to each process based on the merged community and the split sub-communities in each process; determine the node information and edge information corresponding to the next graph reconstruction by exchanging the node optimization information and adjacent node information in different nodes; and obtain the community network corresponding to the next graph reconstruction based on the node information and edge information corresponding to the next graph reconstruction.
[0127] In one embodiment, the reconstruction module 502 is further configured to determine the associated nodes corresponding to the multiple nodes allocated to each process based on the multiple edges allocated to each process; and to store in each process the user data of the multiple nodes allocated to the process, as well as the user data of the associated nodes corresponding to the multiple nodes allocated to the process.
[0128] In one embodiment, the inference module 503 is further configured to obtain the tag information of the identified user; and infer the user behavior of the user to be identified based on the tag information of the identified user and the community in which the identified user is located in the optimized community network.
[0129] Each module in the aforementioned user behavior recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0130] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores user data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for recognizing the aforementioned user behavior.
[0131] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0132] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described user behavior recognition method.
[0133] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the aforementioned method for recognizing user behavior.
[0134] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the aforementioned method for recognizing user behavior.
[0135] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0136] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0137] The above embodiments merely illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application's patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for identifying user behavior, characterized in that, The method includes: Obtain the community network to be processed, which includes multiple nodes and multiple edges. Each node is used to represent the user data of a user to be identified, and each edge is used to represent the association weight information between two nodes. The community detection algorithm is used to perform graph reconstruction loops on the community network in multiple processes until the modularity gain between multiple nodes in the community network is lower than the gain threshold, so as to obtain an optimized community network. The community detection algorithm is used to merge multiple nodes in the community network according to multiple edges in the community network, and to split sub-communities according to the connectivity between nodes in the merged community. Based on the optimized community network, the user behavior of the user to be identified is inferred; The graph reconstruction loop includes: allocating multiple nodes and edges in the community network corresponding to the current graph reconstruction to multiple processes; each process stores the user data of the allocated nodes and the user data of the associated nodes belonging to other processes but also within its own process; each process is allocated an equal number of nodes and edges; in each process, based on the association weight information corresponding to the allocated edges, the allocated nodes are merged into communities; a node can be merged with any community whose modularity gain increases; and sub-communities are split based on the connectivity between nodes in the merged community; nodes whose neighboring nodes have changed are accessed; and the community network corresponding to the next graph reconstruction is obtained based on the merged community and the split sub-communities in each process. The step of merging the communities of the assigned nodes based on the association weight information corresponding to the assigned edges includes: Based on the association weight information corresponding to the assigned multiple edges, the modularity gain among the assigned multiple nodes is calculated. The modularity gain among the multiple nodes is obtained by comparing the modularity of the entire graph with the modularity of the entire graph before merging. Based on the modularity gain among the assigned nodes, community merging is performed on the assigned nodes.
2. The method according to claim 1, characterized in that, The step of merging the communities of the assigned nodes based on the modularity gain among the assigned nodes includes: If any two target nodes among the allocated nodes have a modularity gain greater than a gain threshold, then the two target nodes are merged into a community.
3. The method according to claim 1, characterized in that, The step of obtaining the community network corresponding to the next graph reconstruction based on the merged communities and split sub-communities in each process includes: Based on the merged community and the split sub-communities in each process, determine the node optimization information and adjacent node information of the multiple nodes assigned to each process; By exchanging the node optimization information and the neighboring node information at different nodes, the node information and edge information corresponding to the next graph reconstruction are determined. Based on the node and edge information corresponding to the next graph reconstruction, the community network corresponding to the next graph reconstruction is obtained.
4. The method according to claim 1, characterized in that, After assigning multiple nodes and edges in the community network corresponding to the current graph reconstruction to multiple processes, the method further includes: Based on the multiple edges assigned to each process, determine the associated nodes corresponding to the multiple nodes assigned to each process; Each process stores user data for multiple nodes assigned to that process, as well as user data for associated nodes corresponding to the multiple nodes assigned to that process.
5. The method according to any one of claims 1-4, characterized in that, The step of inferring the user behavior of the user to be identified based on the optimized community network includes: Obtain the tag information of identified users; Based on the tag information of the identified users and the communities in which the identified users are located in the optimized community network, the user behavior of the user to be identified is inferred.
6. A user behavior recognition device, characterized in that, The device includes: The acquisition module acquires the community network to be processed, which includes multiple nodes and multiple edges. Each node is used to represent the user data of a user to be identified, and each edge is used to represent the association weight information between two nodes. The reconstruction module uses a community detection algorithm to perform a graph reconstruction loop on the community network in multiple processes until the modularity gain among multiple nodes in the community network is lower than a gain threshold, thus obtaining an optimized community network. The community detection algorithm merges multiple nodes in the community network based on multiple edges, and splits sub-communities based on the connectivity between nodes in the merged communities. The graph reconstruction loop includes: assigning multiple nodes and edges in the community network corresponding to the current graph reconstruction to multiple processes; each process stores user data of the assigned nodes and user data of associated nodes belonging to other processes but also within its own process, with each process having an equal number of assigned nodes and edges; in each process, merging multiple nodes based on the association weight information corresponding to the assigned edges, allowing a node to merge with any community with increased modularity gain, and splitting sub-communities based on the connectivity between nodes in the merged communities; accessing nodes whose neighboring nodes have changed, and obtaining the community network corresponding to the next graph reconstruction based on the merged communities and split sub-communities in each process. The inference module is used to infer the user behavior of the user to be identified based on the optimized community network. The reconstruction module is further configured to calculate the modularity gain between the multiple nodes based on the association weight information corresponding to the multiple edges, wherein the modularity gain between the multiple nodes is obtained by comparing the modularity of the entire graph with the modularity of the entire graph before merging; and to perform community merging on the multiple nodes based on the modularity gain between the multiple nodes.
7. The apparatus according to claim 6, characterized in that, The reconstruction module is further configured to perform community merging on the two target nodes if the module degree gain between any two target nodes among the allocated multiple nodes is greater than the gain threshold.
8. The apparatus according to claim 6, characterized in that, The reconstruction module is further configured to determine the node optimization information and adjacent node information of multiple nodes allocated to each process based on the merged community and the split sub-communities in each process; determine the node information and edge information corresponding to the next graph reconstruction by exchanging the node optimization information and the adjacent node information in different nodes; and obtain the community network corresponding to the next graph reconstruction based on the node information and edge information corresponding to the next graph reconstruction.
9. The apparatus according to claim 6, characterized in that, The reconstruction module is further configured to determine the associated nodes corresponding to the multiple nodes allocated to each process based on the multiple edges allocated to each process; and to store in each process the user data of the multiple nodes allocated to the process, as well as the user data of the associated nodes corresponding to the multiple nodes allocated to the process.
10. The apparatus according to any one of claims 6-9, characterized in that, The inference module is also used to obtain the tag information of the identified user; and to infer the user behavior of the user to be identified based on the tag information of the identified user and the community in which the identified user is located in the optimized community network.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Gang fraud identification method based on Leiden community discovery algorithm
CN117575782A
Community detection using fast low-cardinality semidefinite programming
US11231914B1