Data processing method and device, equipment and storage medium

By extracting the structural and attribute information of nodes in the social network graph, fusing it into a fusion vector, and dividing community based on similarity, the problem of low community division accuracy caused by ignoring node differences in the existing technology is solved, and a higher community division accuracy is achieved.

CN119884498APending Publication Date: 2025-04-25MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311379450.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-23
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the process of community division of social network graphs, the existing technology ignores the differences in the attributes and social relationships of the nodes themselves, resulting in low accuracy of community division, especially when the sparseness of nodes or edges is different.

Method used

By generating the graph structure of the social network, determining the node sequence, extracting the structural vector and attribute vector of the node, fusing the two to obtain the fusion vector, and community division is performed based on the similarity of the fusion vector.

Benefits of technology

It improves the accuracy of community division, avoids the impact of the sparseness of nodes or edges on community division, takes into account the differences in the structure and attributes of nodes, and reduces the error of community division.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884498A_ABST
    Figure CN119884498A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, equipment and a storage medium. The method comprises the following steps: generating a graph structure of a social network, determining a node sequence of the graph structure, determining a structure vector in the graph structure based on the node sequence, and coding attribute information of nodes in the graph structure to obtain an attribute vector of the nodes; performing fusion processing on the structure vector of the node and the attribute vector of the node to obtain a fusion vector of the node; and determining the similarity among the fusion vectors of the plurality of nodes, and performing community division on the graph structure based on the similarity among the fusion vectors of the plurality of nodes to obtain a community division result of the social network. According to the method and the device, community division can be effectively carried out on social networks with different sparse degrees, and the accuracy of community division is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to artificial intelligence technology, and in particular to a data processing method, device, equipment and storage medium. Background Art

[0002] In some business scenarios, the system needs to classify customers or users to analyze the behavioral rules of different types of users, so as to guide consumption, recommend information and other business operations according to the preferences or habits of different types of users. For user classification, all users and social relationships between users are usually mapped to nodes and edges between nodes, so as to construct a social network graph, and then different communities are mined from the social network graph to classify users.

[0003] When dividing communities in social network graphs, only the topological structure of nodes in the social network graph is considered as the basis for community division, ignoring the possible differences in user attributes and social relationships between users. However, the data of social network graphs is high-dimensional, and the sparsity of nodes or edges may be different. The sparsity problem of social networks will affect community division, resulting in low accuracy of the final divided communities. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, device, electronic device, and computer-readable storage medium to improve the accuracy of community division.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present application provides a data processing method, the method comprising:

[0007] Generate a graph structure of a social network, wherein the graph structure includes nodes and edges, the nodes are used to represent objects from the social network, the edges are used to connect two nodes, and the objects represented by the two nodes connected by the edge have a social relationship;

[0008] Determining a node sequence of the graph structure, determining a structure vector of the node in the graph structure based on the node sequence, and encoding attribute information of the node in the graph structure to obtain an attribute vector of the node;

[0009] For each of the nodes, a structural vector of the node is fused with an attribute vector of the node to obtain a fusion vector of the node;

[0010] The similarities between the fusion vectors of the nodes in the graph structure are determined, and based on the similarities between the fusion vectors of the nodes, the graph structure is divided into communities to obtain a community division result of the social network.

[0011] The present application provides a data processing device, including:

[0012] A generating module, configured to generate a graph structure of a social network, wherein the graph structure includes nodes and edges, wherein the nodes are used to represent objects from the social network, and the edges are used to connect two nodes, and the objects represented by the two nodes connected by the edges have a social relationship;

[0013] A determination module, configured to determine a node sequence of the graph structure, determine a structure vector of the node in the graph structure based on the node sequence, and encode the attribute information of the node in the graph structure to obtain an attribute vector of the node;

[0014] A fusion module, for each of the nodes, fuses the structure vector of the node with the attribute vector of the node to obtain a fusion vector of the node;

[0015] The partitioning module determines the similarity between the fusion vectors of the nodes in the graph structure, and performs community partitioning on the graph structure based on the similarity between the fusion vectors of the nodes to obtain a community partitioning result of the social network.

[0016] An embodiment of the present application provides an electronic device, including:

[0017] Memory for storing computer executable instructions or computer programs;

[0018] The processor is used to implement the data processing method provided in the embodiment of the present application when executing the computer executable instructions or computer programs stored in the memory.

[0019] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions or a computer program for implementing the data processing method provided in the embodiment of the present application when executed by a processor.

[0020] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, the data processing method provided in the embodiment of the present application is implemented.

[0021] The embodiments of the present application have the following beneficial effects:

[0022] Through the embodiment of the present application, the graph structure of the social network is generated based on the objects of the social network and the social relationships between the objects, and then the node sequence in the graph structure is determined. Since the node sequence represents the connection relationship between multiple nodes, and the structural vector of the node is determined according to the node sequence, the structural vector of multiple nodes can effectively represent the topological structure of the social network. Next, the attribute information of the node is integrated into the process of constructing the node vector, so that the final node fusion vector can reflect the attribute differences between different nodes, solving the problem of ignoring the node differences when dividing the community. Finally, the community is divided based on the similarity between the node fusion vectors, so that the community division process focuses on the similarity between nodes on the basis of the topological structure of the social network, without considering the sparsity of nodes or edges, eliminating the attribute differences between nodes caused by the sparsity of nodes or edges, and then avoiding the community division error caused by the different sparsity of nodes or edges, thereby improving the accuracy of community division. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1A is a schematic diagram of the architecture of a data processing system 100 provided in an embodiment of the present application;

[0024] Figure 1B It is a schematic diagram of the process operation of the data processing method provided in the embodiment of the present application;

[0025] Figure 2 It is a structural diagram of a server provided in an embodiment of the present application;

[0026] Figure 3A-3G It is a flowchart of a data processing method provided in an embodiment of the present application;

[0027] Figure 4 is a schematic diagram of a community discovery method provided in an embodiment of the present application;

[0028] Figure 5A It is one of the distribution diagrams of different local densities of nodes provided in the embodiment of the present application;

[0029] Figure 5B This is the second distribution diagram of different local densities of nodes provided in the embodiment of the present application;

[0030] Figure 5C This is the third distribution diagram of different local densities of nodes provided in the embodiment of the present application;

[0031] Figure 5D This is the fourth distribution diagram of different local densities of nodes provided in the embodiment of the present application;

[0032] Fig. 6A is a distribution diagram of local density and relative distance of nodes provided in an embodiment of the present application;

[0033] Figure 6B is a distribution diagram of node center values ​​provided in an embodiment of the present application;

[0034] Figure 7 It is a structural diagram of the lawyer relationship network data set provided in the embodiment of the present application;

[0035] Fig. 8A It is a comparison chart of MNI indicators of different node vectors provided in the embodiment of the present application;

[0036] Figure 8B It is a comparison chart of F1-score indicators of different node vectors provided in the embodiment of the present application;

[0037] Fig.9A This is a comparison chart of NMI indicators of different node vector similarities under the BGLL algorithm provided in the embodiment of the present application;

[0038] Fig. 9B This is a comparison chart of NMI indicators of different node vector similarities under the K-medoids algorithm provided in the embodiment of the present application;

[0039] Fig. 9C This is a comparison chart of the F1-score index of different node vector similarities under the BGLL algorithm provided in the embodiment of the present application;

[0040] Fig.9D This is a comparison chart of the F1-score index of different node vector similarities under the K-medoids algorithm provided in the embodiment of the present application;

[0041] Fig. 10A This is a comparison chart of NMI indicators of community division of different node vector similarities under various data sets provided in an embodiment of the present application;

[0042] Fig. 10B It is a comparison chart of the F1-score indicators of community division under different similarities in each data set provided in the embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0044] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0045] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0046] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0047] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0048] 1) BGLL algorithm is a fast hierarchical community discovery algorithm based on the greedy idea. It consists of two stages, which are repeated and iterated until the modularity of the network community division no longer increases. In the first stage, communities are merged, each node is regarded as a community, and the neighbor communities that should be merged are determined based on the modularity increment maximization standard. In the second stage, all communities discovered in the first stage are re-regarded as nodes to build a new network, and the first stage is iteratively performed on the new network. When the modularity no longer increases, the iteration ends and the community approximation of the optimal division of the network is obtained.

[0049] 2) K-medoids algorithm is a center point clustering algorithm that uses experimental iterative calculations to repeatedly optimize clustering results. First, a set of center objects are selected from the data set, and then the remaining objects are assigned to the closest center objects. Then the center objects are updated and adjusted and the above process is iterated until all center objects are fixed and no longer change, and the iteration ends to obtain the optimal solution for clustering.

[0050] 3) Normalized Mutual Information (NMI), an experimental evaluation index, is often used in clustering experiments to measure the similarity between two clustering results (usually comparing the clustering results with the true labels). Similarly, in classification experiments, it can also be used to measure the similarity between the classification results and the true results, with a value range of 0 to 1.

[0051] The embodiments of the present application provide a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can effectively divide social networks with different degrees of sparsity into communities and improve the accuracy of community division.

[0052] The following describes exemplary applications of the electronic device provided in the embodiments of the present application. The electronic device provided in the embodiments of the present application can be implemented as various types of user terminals such as laptop computers, tablet computers, desktop computers, set-top boxes, mobile devices (for example, mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), smart phones, smart speakers, smart watches, smart televisions, and vehicle-mounted terminals, and can also be implemented as servers.

[0053] See also Figure 1A , Figure 1A It is a schematic diagram of the architecture of the data processing system 100 provided in an embodiment of the present application. The terminal 400 is connected to the server 200 via the network 300. The network 300 may be a wide area network or a local area network, or a combination of the two.

[0054] The terminal 400 runs some data processing programs (Application, APP) for various business scenarios. For example, it can be an instant messaging APP, a reading APP, a video APP, a game APP, or other software programs. When the user (or other artificial intelligence program) uploads data related to the business scenario at the terminal 400 and initiates a data processing request, and then sends it to the server 200 through the network 300, the server 200 responds to the data processing request initiated by the user at the terminal 400, and obtains the data related to the business scenario, from which the social network is mined, and the graph structure of the social network is generated based on the objects included in the social network and the social relationships between the objects. Then determine the node sequence of the graph structure, determine the structure vector of the node in the graph structure based on the node sequence, and encode the attribute information of the node in the graph structure to obtain the attribute vector of the node. Next, the structure vector and the attribute vector of the node are fused to obtain the fusion vector, and finally, according to the similarity between the fusion vectors of multiple nodes in the graph structure, the graph structure is divided into communities to obtain the community division results of the social network. And the community division result is returned as the data processing result of the business scenario data through the network 300 and displayed in the terminal 400, and the user can see the data processing result of the business scenario data in the terminal 400.

[0055] For example, the terminal can be a commodity shopping system, in which various commodity trading programs are running. The user can upload the customer transaction data of a certain type of commodity to the server and initiate a data processing request at the same time. After the server obtains the customer transaction data, it mines a social network composed of multiple customers, and maps each customer as an object of the social network and maps it to a node, and the social relationship between customers is mapped to an edge to generate a graph structure of the social network. Next, the structural vector and attribute vector of each node in the graph structure are extracted and fused, and then the graph structure is divided into communities based on the similarity between the node vectors obtained by the fusion, that is, the customers in the social network are classified, and finally the community division results are presented to the user. Through the community division results, the user can find out which type of customer is more interested in this type of commodity and is more likely to consume it, so that the user can guide consumption or recommend commodity advertisements for this type of customer in a targeted manner to meet business needs.

[0056] In some embodiments, Figure 1A The server 200 shown in the figure can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms. Figure 1A The terminal 400 shown in the figure can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0057] The embodiments of the present application can be implemented with the help of artificial intelligence (AI) technology, which is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.

[0058] Taking the server provided in the embodiment of the present application as an example, for example, a server cluster can be deployed in the cloud, thereby opening up artificial intelligence cloud services (AI as a Service, AIaaS) to users or developers. The AIaaS platform will split several common AI services and provide independent or packaged services in the cloud. This service model is similar to opening an AI theme mall, and all users or developers can access one or more artificial intelligence services provided by the AIaaS platform through an application programming interface.

[0059] For example, the server in the cloud is encapsulated with the program of the data processing method provided by the embodiment of the present application. The user calls the data processing service in the cloud service through the terminal (the terminal runs an APP, such as an instant messaging APP, a reading APP, etc.) so that the server deployed in the cloud calls the program of the encapsulated data processing method. After the terminal uploads the data related to the business scenario and initiates a data processing request, the server responds to the data processing request initiated by the user at the terminal, and obtains the data related to the business scenario, from which the social network is mined, and the graph structure of the social network is generated based on the objects included in the social network and the social relations between the objects. Then determine the node sequence of the graph structure, determine the structure vector of the node in the graph structure based on the node sequence, and encode the attribute information of the node in the graph structure to obtain the attribute vector of the node. Next, the structure vector and the attribute vector of the node are fused to obtain the fusion vector, and finally, according to the similarity between the fusion vectors of multiple nodes in the graph structure, the graph structure is divided into communities to obtain the community division result of the social network. And the community division result is returned as the processing result of the business scenario data and displayed in the terminal for user browsing.

[0060] Next, an exemplary application when the device is implemented as a terminal will be described, see Figure 1B , Figure 1B It is a flow chart of the data processing method provided by the embodiment of the present application. The user directly uploads the business scenario data and initiates a data processing request at the terminal. The terminal responds to the data processing request initiated by the user, directly obtains the business scenario data, mines the social network, and generates the graph structure of the social network based on the objects included in the social network and the social relationships between the objects. Then determine the node sequence of the graph structure, determine the structure vector of the node in the graph structure based on the node sequence, and encode the node attribute information of the node in the graph structure to obtain the attribute vector of the node. Next, the structure vector and attribute vector of the node are fused to obtain the node fusion vector. Finally, according to the similarity between the fusion vectors of multiple nodes in the graph structure, the graph structure is divided into communities to obtain the community division results of the social network. And the community division results are directly displayed in the terminal as the processing results of the business scenario data, and the user can see the processing results of the business scenario data in the terminal.

[0061] See also Figure 2 , Figure 2 is a schematic diagram of the structure of the server 200 provided in an embodiment of the present application, Figure 2 The terminal 400 shown includes: at least one processor 410, a memory 450, and at least one network interface 420. The various components in the terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .

[0062] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0063] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0064] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0065] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0066] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0067] A network communication module 452, used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;

[0068] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 The data processing device 453 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: a generation module 4531, a determination module 4532, a fusion module 4533, and a division module 4534. These modules are logical, so they can be arbitrarily combined or further divided according to the functions implemented. The functions of each module will be explained below.

[0069] In some embodiments, the terminal or server can implement the data processing method provided in the embodiment of the present application by running various computer executable instructions or computer programs. For example, computer executable instructions can be commands, machine instructions or software instructions at the microprogram level. The computer program can be a native program or software module in the operating system; it can be a local (Native) application (APPlication, APP), that is, a program that needs to be installed in the operating system to run, such as a live broadcast APP or an instant messaging APP; it can also be a small program that can be embedded in any APP, that is, a program that can be run only by downloading it to a browser environment. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.

[0070] The data processing method provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server 200 provided in the embodiment of the present application.

[0071] See also Figure 3A , Figure 3A is a flow chart of a data processing method provided in an embodiment of the present application, comprising Figure 1A The server 200 shown is the execution entity, which will be combined with Figure 3A The steps shown are explained.

[0072] In step 101, a graph structure of a social network is generated.

[0073] For some business scenarios, such as a commodity trading platform or an advertising recommendation system, it is necessary to analyze the information data or transaction data of users or customers to explore the consumption behavior characteristics or browsing behavior characteristics of users, and then classify users according to their social relationships. Targeted business strategies can be made for different categories of users to guide user consumption or business recommendations.

[0074] In some embodiments, social relationships between users, such as friendships or teams, can be established based on information data or transaction data of users or customers. Each user in the social network is regarded as an object, and each object is mapped to a node. In this case, the node is used to represent objects from the social network. When there is a social relationship between two objects (users), the social relationship is mapped to an edge between the two nodes, that is, there is a social relationship between the objects represented by the two nodes connected by the edge. Finally, a graph structure of the social network is generated based on multiple nodes and multiple edges.

[0075] In step 102, a node sequence of a graph structure is determined, a structural vector of a node in the graph structure is determined based on the node sequence, and attribute information of the node in the graph structure is encoded to obtain an attribute vector of the node.

[0076] In some embodiments, after the graph structure of the social network is generated, the node sequence of the graph structure is determined, the structural vector of the node in the graph structure is determined based on the node sequence, and the attribute information of the node in the graph structure is encoded to obtain the attribute vector of the node. Specifically, first, for the graph structure, multiple node sequences need to be determined from the graph structure. The node sequence can be obtained by performing a walk process on the nodes in the graph structure. First, an initial walk node is determined, and then the nodes in the graph structure are walked and traversed along the edges starting from the initial walk node. The number of walks can be preset according to the size of the social network. A walk process is performed according to the initial node sequence, and the initial walk node and the nodes passed by the walk process can be used as a node sequence. Each time a walk process is performed, a different node can be selected as the starting walk node, and a different node sequence can be obtained.

[0077] In some embodiments, Figure 3A The “determining the node sequence of the graph structure” in step 102 shown can be implemented by the following step 1021A or step 1022A.

[0078] In step 1021A, if the edges in the graph structure are unweighted, random walk processing is performed on the nodes in the graph structure along the edges to obtain a node sequence of the graph structure.

[0079] Before determining the node sequence of the graph structure, it is necessary to determine whether the edges of the graph structure are assigned weights. When the edges in the graph structure are unweighted, the nodes in the graph structure are randomly walked along the edges to obtain the node sequence of the graph structure. Because all the edges in the graph structure are unweighted, the walking path of each walking process is random and passes through a walking node, thereby obtaining the node sequence of the graph structure. Among them, the specific process of the walking process is as follows: arbitrarily select a node from the graph structure as the starting walking node, start from the starting walking node and randomly walk along the edge of the graph structure for N steps, pass through N walking nodes in turn, and sort the starting walking node and the N walking nodes passed in the order of walking to obtain a node sequence, where N is an integer greater than or equal to 1.

[0080] When the graph structure is an unweighted graph structure, it means that all the edges in the graph structure have no weight values. A node is randomly selected from the graph structure as the starting walk node, and then N steps of random walk along the edge are started from the starting walk node. Specifically, multiple adjacent edges connected to the starting walk node are first determined. Since it is an unweighted graph structure, each edge is the same as the walk path. One edge can be randomly selected from these adjacent edges as the walk path, and then another node of this edge is reached through the walk path. Starting from another node, continue to determine multiple adjacent edges connected to it, and then randomly select an edge from these adjacent edges as the path for the next walk, and then repeat the above process for N steps. When N steps of walking reach a certain node, it is determined that this node has no adjacent edges connected to it, which means that the walk has reached the end point and the walk ends.

[0081] After the above walking process, each walk can pass through N walking nodes in sequence, and then the starting walking node and the N walking nodes passed in sequence are sorted according to the order of walking to obtain a corresponding node sequence.

[0082] In step 1022A, if the edges in the graph structure are weighted graph structures, random walk processing is performed on the nodes in the graph structure along the edges based on the weights of the edges in the graph structure to obtain a node sequence of the graph structure.

[0083] When the edges in the graph structure are weighted, the nodes in the graph structure are randomly walked along the edges based on the weights of the edges in the graph structure to obtain a node sequence of the graph structure. Because all the edges in the graph structure are weighted, the walking path of each walking process is determined by the weight of the edge. Similarly, each walking process passes through a walking node, thereby obtaining a node sequence of the graph structure. Among them, the specific process of walking processing is as follows: If the graph structure is a graph structure with weights, then any node in the graph structure is selected as the starting walking node, and based on the weights of the edges in the graph structure, walk M steps along the edges of the graph structure starting from the starting walking node, and pass through M walking nodes in turn, and sort the starting walking node and the M walking nodes passed in the order of walking to obtain a node sequence, where M is an integer greater than or equal to 1.

[0084] When the graph structure is a graph structure with weights, it means that all edges in the graph structure are assigned weight values. At the beginning of the walk process, a node is randomly selected from the graph structure as the starting walk node, and then M steps are walked along the edges in the graph structure starting from the starting walk node. Specifically, multiple adjacent edges connected to the starting walk node are first determined, and then the weight value corresponding to each adjacent edge is determined, and the transition probability corresponding to each adjacent edge is determined according to the weight value of each adjacent edge. Next, the walking path can be determined according to the transition probability of each adjacent edge, that is, the target adjacent edge is determined from multiple adjacent edges as the walking path according to the transition probability, and the other node connected to the target adjacent edge is used as the first walking node, and the first walking process is completed. Then starting from the first walking node, the walking node obtained in the M-1th walking process is used as the starting walking node of the Mth step walking process, and the Mth walking node is determined according to the weights corresponding to the adjacent edges connected to the starting walking node, and the walking is terminated at this time, where M is an integer greater than or equal to 1.

[0085] After the above walking process, each walk passes through M walking nodes in sequence, and then the starting walking node and the M walking nodes passed are sorted according to the order of walking to obtain the corresponding node sequence.

[0086] In some embodiments, see Figure 3B , Figure 3A In step 102 shown, "determining the structural vector of the node in the graph structure based on the node sequence" can be implemented by following steps 1021B to 1022B, which are described in detail below.

[0087] In step 1021B, a target node sequence including the first node is obtained from the node sequence in the graph structure.

[0088] For each node in the node sequence, in order to extract the structural features of the node, the node sequence needs to be preprocessed. At this time, for each node in the graph structure, a target node sequence including the first node is determined from the node sequence of the graph structure, where the first node is any node in the graph structure. Considering that there are multiple node sequences of the graph structure obtained by the walk processing, each node sequence may only include some nodes in the graph structure, so if the structural features of the first node are to be extracted, it is necessary to determine the target node sequence including the first node from the node sequence, and then process the target node sequence to obtain the structural features of the first node.

[0089] In step 1022B, the initial vector of the first node is trained based on the adjacent nodes of the first node in the target node sequence to obtain the structural vector of the first node.

[0090] In some embodiments, see Figure 3C , Figure 3B The shown step 1022B can be implemented by following the steps 10221B to 10224B, which are described in detail below.

[0091] In step 10221B, adjacent node prediction processing is performed based on the initial vector of the first node in the target node sequence to obtain the prediction probability of the adjacent nodes of the first node.

[0092] After determining the target node sequence including the first node from the node sequence of the graph structure, the initial vector of the first node is trained based on the adjacent nodes of the first node in the target node sequence to obtain the structural vector of the first node. Specifically, firstly, the adjacent node prediction processing is performed based on the initial vector of the first node in the target node sequence to obtain the prediction probability of the adjacent nodes of the first node. However, before the prediction processing, the target node sequence needs to be preprocessed, for example, the target node sequence can be embedded or encoded to obtain the initial vector representation of each node in the target node sequence. Among them, the embedding processing can be implemented by calling the community mining model, treating the node sequence as a text sequence, and each node of the node sequence as each word of the text sequence, and then the node sequence is embedded similar to the text sequence, such as Embedding. The encoding processing can be implemented by calling the word vector model, for example, it can be one-hot encoding, or calling the text encoder to perform text-like processing. This method can eventually obtain the initial vector of each node.

[0093] After determining the initial vector of each node, the adjacent nodes prediction process can be performed based on the initial vector of the first node in the target node sequence to obtain the predicted probability of the adjacent nodes of the first node. Specifically, considering that the structural features of the first node are to be extracted, the features of the adjacent nodes of the first node also need to be determined, that is, the adjacent nodes of the first node are predicted based on the target node sequence. First, for the first node in the target node sequence, it is necessary to determine the K adjacent nodes of the first node in the target node sequence. For example, in the target node sequence, determine the first node in front of the K adjacent nodes. Nodes and back nodes. When the target node sequence has only one node, it means that this node has no adjacent nodes, and K is 0. After determining the K adjacent nodes of the first node, the language model (such as the embedding layer neural network) embeds the K adjacent nodes during the training process to obtain the embedded feature vectors of the adjacent nodes, which are then merged with the initial vector of the first node, and the language model (such as the fully connected layer neural network) is called to learn the merged fusion vector.

[0094] In the language model prediction process, the neighboring nodes of the first node are unknown and need to be predicted. Therefore, the language model is used to predict the neighboring nodes of the initial vector of the first node, and the prediction probability of the neighboring nodes of the first node is obtained to achieve the prediction of the neighboring nodes of the first node.

[0095] In step 10222B, the error between the predicted probability and the labeled probability is determined.

[0096] After determining the predicted probabilities of the adjacent nodes of the first node, the predicted probabilities are compared with the labeled probabilities of the adjacent nodes (and the true labels of the adjacent nodes) to determine the error between the predicted probabilities and the labeled probabilities. It should be noted that in the embodiment of the present application, when the language model is trained, this error can be used as the loss value of the language model training, and the prediction process directly compares the predicted probability with the labeled probability to determine the effect of the model prediction.

[0097] In step 10223B, if the error is not in a minimized convergence state, the initial vector is updated to obtain an updated initial vector.

[0098] In some embodiments, the error between the predicted probability and the marked probability is continuously updated as the language model is trained, and finally tends to be minimized and converged. If the error is not in a minimized convergence state, the initial vector is updated to obtain an updated initial vector. During the language model training process, the accuracy of predicting the adjacent nodes of the first node is constantly changing, and the error between the predicted probability and the marked probability will also change. At this time, the initial vector of the first node is also constantly updated.

[0099] In step 10224B, if the error is in a minimized convergence state, the current initial vector is used as the structural vector of the first node.

[0100] During the language model training process, the error between the predicted probability and the marked probability continues to converge. If the error is in a minimized convergence state, the current initial vector is used as the structural vector of the first node. When the error between the predicted probability and the marked probability of the neighboring node is minimized, it means that the error between the predicted probability and the marked probability is minimized at this time, which means that the prediction accuracy of the neighboring nodes of the first node is the highest, so that the structural features of the first node and the neighboring nodes of the first node become fixed. At this time, the initial vector of the first node can be updated, that is, when the error is minimized, the initial vector of the first node corresponding to the current predicted probability is used as the structural feature vector of the first node. This structural feature vector contains the structural features of the first node and the neighboring nodes of the first node.

[0101] In some embodiments, considering that the basic information and behavior habits of each user are different, the attributes of each node in the graph structure are different. In addition, there are different social relationships between different users, such as teacher-student relationships, friend relationships, or kinship relationships, so each edge in the graph structure will also be different. The difference between nodes and edges will lead to different sparsity of the structure graph. For example, some users have rich social relationships, which makes the edges connected to some nodes in the graph structure dense, while some users have relatively simple and scarce social relationships, which makes the edges connected to some nodes in the graph structure sparse, and even isolated nodes appear, which are connected to other nodes without any edges. So for each node in the graph structure, after determining the structural vector of the node. Considering the sparse problem of nodes and edges in the graph structure, when constructing the node vector, it is necessary not only to consider the structural characteristics of the node, but also to consider the attribute characteristics of the node, that is, the attributes of the node itself, corresponding to the objects of the social network, such as users, such as the user's age, gender, hobbies, etc. By preprocessing these attribute features of the object (corresponding to the nodes of the graph structure), for example, each attribute feature is mapped to a 0-1 vector through one-hot encoding (One-hot), as the attribute feature vectors of these nodes. It should be noted that the processing of attribute features can also call other feature extraction models, such as a word vector model to extract attribute features, which is not limited in the embodiments of the present application.

[0102] Continue to see Figure 3A In step 103, the structure vector of the node is fused with the attribute vector of the node to obtain a fusion vector of the node.

[0103] According to the above, when constructing a node vector, it is necessary to consider not only the structural characteristics of the node, but also the attribute characteristics of the node itself. Therefore, for each node in the graph structure, after determining the structural vector and attribute vector of the node, the structural vector of the node and the attribute vector of the node can be fused to obtain the fusion vector of the node to more accurately represent the characteristics of the node.

[0104] However, before fusing the structural features and attribute features of each node, considering that the structural vector and the attribute vector may belong to different feature vector dimensions, they cannot be directly fused. Therefore, it is necessary to unify the dimensions of the structural vector and the attribute vector of the node to obtain the transformed structural vector and the transformed attribute vector, so that the feature vector dimensions of the structural vector and the attribute vector are consistent, so as to facilitate fusion. The process of dimension unification can be implemented by calling a layer of neural network, inputting the structural vector and the attribute vector of each node into the neural network, and using the weight value or weight matrix in the neural network to perform linear transformation on the structural vector and the attribute vector, respectively, so as to obtain the transformed structural vector and the transformed attribute vector. At this time, the feature vector dimensions of the structural vector and the attribute vector of each node are consistent.

[0105] Next, for each node, the transformed structure vector of the node and the transformed attribute vector of the node are fused to obtain the fusion feature of the node. The fusion process can be to directly perform vector-based physical splicing on the transformed structure vector and the transformed attribute vector to obtain the fusion vector of the node. The fusion process can also be to add the transformed structure vector and the transformed attribute vector to obtain the fusion vector of the node, that is, to add the vector values ​​corresponding to the structure vector and the attribute vector to obtain the corresponding vector value of the fusion vector, and the dimension of the fused vector remains unchanged.

[0106] In step 104, the similarity between the fusion vectors of the nodes in the graph structure is determined, and based on the similarity between the fusion vectors of the nodes, the graph structure is divided into communities to obtain a community division result of the social network.

[0107] In some embodiments, after determining the fusion vector of each node in the graph structure, the nodes in the graph structure can be classified, that is, the objects (users) in the social network can be divided. The idea of ​​division is to classify nodes with similar features into one category, that is, they belong to the same community, so it is necessary to determine the feature similarity between each node, that is, determine the similarity between the fusion vectors of the nodes in the graph structure, and divide the graph structure based on the similarity between the fusion vectors of the nodes to obtain the community division result of the social network.

[0108] In some embodiments, see Figure 3D, Figure 3A The step 104 shown can be implemented by following the steps 1041 to 1042, which are described in detail below.

[0109] In step 1041 , the weight value of the edge is updated based on the similarity between the fusion vectors of the nodes.

[0110] For the edges in the graph structure, since each edge connects two vertices, corresponding to the social network, it means that the two objects on the social network have a social relationship, and the two objects (users) with a social relationship may have a large similarity in their corresponding features, so they are more likely to be classified into the same community. Therefore, for each edge in the graph structure, it is necessary to determine the similarity between the fusion vectors of the two nodes connected by the edge, and update the weight value of the edge based on the similarity between the fusion vectors of the nodes.

[0111] First, determine the similarity between the fusion vectors of the nodes and represent each node in the graph structure as V i , the corresponding node fusion vector is expressed as Then the node vector set is expressed as In the embodiment of the present application, the similarity between node vectors is used to measure the similarity between node vectors. For example, the similarity between node i and node j can be recorded as S NI (i,j), the specific calculation formula is as follows:

[0112]

[0113] In the above formula (1), i and j are any two nodes on the social network graph, d represents the dimension of the fusion vector, is the node vector of node i.

[0114] In some embodiments, the graph structure may be an unweighted graph, that is, all edges are not assigned edge weights, or each edge is assigned a uniform initialization weight and a default weight value. For example, if two nodes are connected by an edge, the edge may be assigned an initialization weight value of 1. If there is no edge connection between the two nodes, the default weight value is 0. In the embodiment of the present application, for each edge in the graph structure, the weight value of the edge is updated by the fused connection similarity between the two nodes connected by each edge. In other words, the weight value of each edge represents the fused vector similarity between the two nodes connected by this edge.

[0115] In step 1042, based on the updated weight values ​​of the edges, the graph structure is divided into communities to obtain a community division result of the social network.

[0116] After updating the edge weights based on the similarity between the fusion vectors of the nodes, the graph structure is divided into communities based on the updated edge weights to obtain the community division results of the social network, thereby achieving community division of the social network.

[0117] In some embodiments, see Figure 3E , Figure 3D The step 1042 shown can be implemented by following the steps 10421 to 10424, which are described in detail below.

[0118] In step 10421, the nodes in the graph structure are allocated to obtain P pending communities.

[0119] In some embodiments, after the weight of each edge in the graph structure is updated, the nodes of the graph structure can be classified based on the weights of these edges, that is, the graph structure can be divided into communities to obtain the community division results of the social network.

[0120] In the initial process of community division, for each node in the graph structure, the nodes in the graph structure are allocated to obtain P pending communities, where a pending community includes at least one node, and P is an integer greater than 1. Specifically, the allocation process can be to add each node in the graph structure to a pending community, that is, each node is regarded as a pending community, and each pending community has only one node, so P pending communities can be obtained.

[0121] In step 10422, Q pairwise merging methods of the P pending communities are obtained, and based on the updated weight values ​​of the edges, the change value of the weighted modularity of the graph structure under each pairwise merging method is determined.

[0122] After the nodes in the graph structure are distributed and processed to obtain P pending communities, Q ways of merging the P pending communities are obtained, and based on the updated weight values ​​of the edges, the change value of the weighted modularity of the graph structure under each way of merging is determined. Specifically, after obtaining P pending communities according to the graph structure, Q ways of merging the P pending communities are first obtained, and any one of the pending communities is added to another pending community for merging, that is, any two pending communities are merged. New pending communities are obtained by merging the pending communities in pairs, and different new pending communities can be obtained each time the two-by-two mergers are performed. Thus, any two pending communities among the P pending communities are merged in pairs to obtain Q ways of merging in pairs, where Q is an integer greater than 1.

[0123] For example, the graph structure has four communities, namely community 1, community 2, community 3, and community 4. Community 2 and community 3 are selected for merging to obtain a pairwise merging method, or community 1 and community 3 are merged to obtain another pairwise merging method. Thus, a total of 6 pairwise merging methods are obtained.

[0124] After obtaining Q pairwise merging methods for P pending communities, the next step is to determine the change in weighted modularity of the graph structure under each pairwise merging method based on the updated weight values ​​of the edges. Because each time a pairwise merging method is used to merge the pending communities, the pending communities in the graph structure will change. At this time, the updated weight values ​​of the edges can be used to calculate the weighted modularity of the graph structure under each pairwise merging method and determine the change in weighted modularity.

[0125] In some embodiments, see Figure 3F , Figure 3E In step 10422, "based on the updated weight values ​​of the edges, determining the change value of the weighted modularity of the graph structure under each pairwise merging method" can be achieved by following the steps 104221 to 104224, which are described in detail below.

[0126] In step 104221, based on the updated weight values ​​of the edges, a first weighted modularity of the graph structure including the P pending communities is determined.

[0127] After determining the updated weight value of each edge in the graph structure, the first weighted modularity of the graph structure including the P pending communities can be determined based on the updated weight value of the edge, which is described in detail below.

[0128] In some embodiments, referring to FIG. G, Figure 3F Step 104221 shown in can be implemented by following steps 1042211 to 1042216, which are described in detail below.

[0129] In step 1042211, a first sum of weight values ​​of all edges in the graph structure is determined.

[0130] Following the above embodiment, for a graph structure including P pending communities, it is necessary to calculate the weighted modularity of the graph structure at this time, wherein the weighted modularity can represent the sparsity of the graph structure. First, the weight values ​​of all edges in the graph structure are counted. Then, the weight values ​​of all edges are added up to determine the first sum of the weight values ​​of all edges in the graph structure.

[0131] In step 1042212, for each of the P undetermined communities, a second sum of weight values ​​of all edges in the undetermined community and a third sum of weight values ​​of edges connected to all nodes in the undetermined community are determined.

[0132] In some embodiments, for each of the P pending communities, a second sum of weight values ​​of all edges in the pending community and a third sum of weight values ​​of edges connected to all nodes in the pending community are determined. Specifically, for each of the P pending communities, the weight value of each edge in the pending community may be counted, and then the weight values ​​of all edges may be summed to obtain a second sum of weight values ​​of all edges in the second pending community.

[0133] In addition, considering that there may be edge vectors for nodes in a pending community, some nodes in the community may be connected to nodes outside the pending community by edges. In this case, the edges connected to the nodes in the pending community can be determined outside the pending community, that is, the edges connected to all nodes in the pending community can be determined. Finally, the weight values ​​of these edges are added up as the third sum of the weight values ​​of the edges connected to all nodes in the pending community.

[0134] In step 1042213, the ratio of the second sum to the first sum is determined as the edge modularity.

[0135] Continuing from the above embodiment, the ratio of the second sum of the edge weight values ​​in the pending community to the first sum of the edge weights in the graph structure is used as the edge modularity of the current pending community. The edge modularity represents the sparsity of the pending community in the graph structure, that is, the richness of the link relationship between nodes in the corresponding social network graph.

[0136] In step 1042214, the modularity of the node is determined based on the ratio of the third sum to the first sum.

[0137] After calculating the edge module of the pending community, the node modularity of the pending community can be calculated next. Specifically, first determine the ratio of the third sum of the weight values ​​of the edges connected to all nodes in the pending community to the first sum of the weight values ​​of all edges in the graph structure, and use the square of this ratio as the node modularity in the current pending community. The node module represents the sparsity of multiple nodes included in the pending community in the graph structure.

[0138] In step 1042215, the difference between the edge modularity and the node modularity is determined as the weighted modularity of the pending community.

[0139] Following the above embodiment, for each undetermined community in the graph structure, after calculating the edge modularity and node modularity of each undetermined community, the difference between the edge modularity and the node modularity is used as the weighted modularity of each undetermined community, and thus the weighted modularity of each undetermined community in the graph structure can be determined.

[0140] For example, in a certain graph structure, there are 14 nodes numbered 0, 1, 2, ..., 13, among which the four nodes numbered 0, 1, 2, 3 are combined into pending community 1, the five nodes numbered 4, 5, 6, 7, 8 are combined into pending community 2, and the five nodes numbered 9, 10, 11, 12, 13 are combined into pending community 3. At this time, the first sum of the weight values ​​of all edges in the entire graph structure is 46. For pending community 1, the second sum of the weight values ​​of the edges in pending community 1 is 11, and the third sum of the weight values ​​of the edges connected to all nodes in pending community 1 is 15. At this time, the ratio of the second sum 11 to the first sum 46 is calculated as the edge modularity of pending community 1. Then calculate the ratio of the third sum 15 to the first sum 46 Then the square of the ratio is used as the node modularity of the undetermined community 1 Finally, the edge modularity of the pending community 1 Node Modularity The difference between

[0141] In step 1042216, the weighted modularity of the P pending communities is summed to obtain the weighted modularity of the graph structure.

[0142] Following the above embodiment, after the weighted modularity of each undetermined community in the graph structure is determined, the weighted modularities of the P undetermined communities are summed to obtain a first weighted modularity of the graph structure.

[0143] Following the above example, the weighted modularity of the undetermined community 1 is calculated as Then, for the pending community 2, the second sum of the weight values ​​of the edges in the pending community 1 is 19, and the third sum of the weight values ​​of the edges connected to all nodes in the pending community 2 is 22. At this time, the ratio of the second sum 19 to the first sum 46 is calculated as the edge modularity of the pending community 1. Then calculate the ratio of the third sum 22 to the first sum 46 is Then the square of the ratio is used as the node modularity of the undetermined community 1 Finally, the edge modularity of the pending community 1 Node Modularity The difference between Similarly, for the pending community 3, the second sum of the weight values ​​of the edges in the pending community 3 is 16, and the third sum of the weight values ​​of the edges connected to all nodes in the pending community 2 is 20. At this time, the ratio of the second sum 16 to the first sum 46 is calculated as the edge modularity of the pending community 3. Then calculate the ratio of the third sum 20 to the first sum 46 is Then the square of the ratio is used as the node modularity of the undetermined community 1 Finally, the edge modularity of the pending community 3 Node Modularity The difference between Therefore, after calculating the weighted modularity of the three pending communities in the graph structure, the sum of the weighted modularity of pending community 1, pending community 2, and pending community 3 is determined to be It is approximately equal to 0.479, and the sum of 0.479 is used as the weighted modularity of the initial graph structure.

[0144] Continue to see Figure 3F In step 104222, the P pending communities are merged based on Q pairwise merging methods to obtain Q merging results.

[0145] In some embodiments, after Q pairwise merging methods of P pending communities are determined, the P pending communities are merged based on the Q pairwise merging methods to obtain Q merging results, wherein the Q merging results correspond one-to-one to the Q pairwise merging methods, and the merging results include P-1 pending communities.

[0146] After determining Q ways of merging two by two of the P pending communities, each merging way is used to merge the P pending communities to obtain a merging result, wherein the merging process specifically includes adding any one of the pending communities to another pending community for merging, that is, merging any two pending communities to obtain P-1 new pending communities. Thus, Q ways of merging two by two can obtain Q merging results.

[0147] In step 104223, a second weighted modularity of the graph structure including P-1 pending communities is determined.

[0148] Following the above embodiment, Q merging results can be obtained according to Q pairwise merging methods, each merging result can obtain new P-1 pending communities, and then the second weighted modularity of the graph structure including the P-1 pending communities can be determined, wherein the method for calculating the second weighted modularity is the same as Figure 3F Step 104221 shown is similar and will not be repeated here.

[0149] In step 104224, a change value between the second weighted modularity and the first weighted modularity is determined.

[0150] Following the above embodiment, under the merging result of each pairwise merging method, new P-1 pending communities can be obtained. Therefore, under Q pairwise merging methods, P-1 pending communities in Q ways can be obtained, that is, Q second weighted modularity can be obtained. At this time, the change value between the second weighted modularity and the first weighted modularity can be determined. In the embodiment of the present application, the difference between the first weighted modularity and the second weighted modularity is used as the change value of the first weighted modularity and the second weighted modularity. Since there are Q second weighted modularities, the corresponding Q change values ​​can be obtained.

[0151] Continue to see Figure 3E In step 10423, if at least one change value is greater than the change value threshold, the P pending communities are merged based on the pairwise merging method corresponding to the largest change value to obtain P-1 pending communities after merging.

[0152] After determining the change value of the weighted modularity of the graph structure under each pairwise merging method according to Q pairwise merging methods, it can be determined whether the Q change values ​​are greater than the change value threshold. If at least one change value is greater than the change value threshold, the P pending communities are merged based on the pairwise merging method corresponding to the largest change value to obtain the merged P-1 pending communities. Considering that in each pairwise merging process, it is necessary to ensure that the change value of the weighted modularity of the graph structure after pairwise merging of the pending communities is the largest, a change value threshold can be set. If the difference (change value) between the weighted modularity of the graph structure before merging (the first weighted modularity) and the weighted module (the second weighted module) after pairwise merging of the pending communities in the graph structure is greater than the change value threshold, it means that the division of the pending communities is effective. At this time, the P pending communities are merged using the pairwise merging method corresponding to the largest change value to obtain the merged P-1 pending communities. These P-1 pending communities can be used as the community division result of the social network corresponding to the graph structure.

[0153] For example, the graph structure has 4 communities (i.e., P is equal to 4) including community 1, community 2, community 3, and community 4, and a total of 6 ways of merging two by two are obtained. Three new pending communities can be obtained in each way of merging two by two. And in each way of merging two by two, the change value of the weighted modularity of the graph structure is greater than the change value threshold, then the way of merging two by two corresponding to the maximum change value is determined. For example, if community 2 and community 3 are merged two by two, the change value of the weighted modularity of the graph structure is the largest, then community 2 and community 3 are merged two by two to obtain 3 (i.e., P-1 is equal to 3) pending communities after merging. These three pending communities can be used as the community division results of the social network corresponding to the graph structure.

[0154] In step 10424, if all the change values ​​are not greater than the change value threshold, the P pending communities are taken as the community division results.

[0155] In some embodiments, according to Q pairwise merging methods, the change value of the weighted modularity of the graph structure under each pairwise merging method can be determined, and then it is determined whether the Q change values ​​are greater than the change value threshold. If all the change values ​​are not greater than the change value threshold, the P pending communities are used as the community division results. Because if all the Q change values ​​are not greater than the change value threshold, it means that the merging of the pending communities at this time has no practical significance, and the effect of community division is not obvious. At this time, there is no need to merge the P pending communities, and the P pending communities are directly used as the community division results of the social network corresponding to the graph structure.

[0156] In some embodiments, community division can also be performed by the following method, as follows: first, at least one node is arbitrarily determined from the graph structure as a central node, and each central node is added to a pending community, and then the following processing is iteratively performed: for each remaining node in the graph structure, the remaining node is added to the pending community corresponding to the central node with the largest similarity, and multiple new pending communities and a new graph structure are obtained, wherein the remaining nodes are nodes other than the central node in the graph structure. Next, for each current node in the new pending community, the sum of the similarities between the current node and other nodes is determined, wherein the other nodes are nodes other than the current node in the new pending community, and then the current node corresponding to the maximum sum is determined as the new central node of the new pending community. In the iterative process, the iteration ends until the new central node no longer changes in the new pending community. Finally, the pending community at the end of the iteration is determined as a community in the graph structure, and each community is used as the community division result of the social network.

[0157] In some embodiments, overlapping communities can also be divided by some methods, as follows: First, for each node in the graph structure, the local density of each node is determined, and based on the similarity between the fusion vectors of the nodes, the relative distance between the nodes is determined, wherein the relative clustering is negatively correlated with the similarity. Next, multiple central nodes are determined from the graph structure by local density and relative distance, and each central node is added to a pending community. Next, for each remaining node in the graph structure, the degree of belonging of the remaining node relative to the pending community corresponding to the central node is determined, wherein the remaining nodes are nodes other than the central node in the graph structure; if the ratio of the degree of belonging of the remaining node relative to the corresponding central nodes of any two pending communities is greater than the preset degree of belonging threshold, the remaining node is added to the two pending communities respectively, and the remaining node is the node of the two overlapping communities. When each remaining node in the graph structure is added to the pending community, the pending community is determined as a community, and each community is used as the community division result of the social network.

[0158] In some embodiments, when performing overlapping community division, multiple central nodes can be determined from the graph structure by the following method, specifically: for each node in the graph structure, when the local density of the node is greater than a preset local density threshold and the relative distance is greater than a preset relative distance threshold, the node is directly determined as the central node of the pending community. When at least one of the local density and relative distance of the node is less than the corresponding threshold, the local density of the node is normalized to obtain the target local density corresponding to the node, and the relative distance of the node is normalized to obtain the target relative distance corresponding to the node, and then the product of the target local density and the target relative distance is determined as the central value of the node, and the nodes are sorted in ascending order according to the central value from small to large, and then the pending central node is determined from the ascending sorting result. For each pending central node, the local density average value of multiple neighboring nodes of the pending central node is determined, and the pending central node whose local density average value is not less than the average value threshold is determined as the central node of the pending community, wherein the neighboring node is a node directly connected to the pending central node by an edge.

[0159] In some embodiments, when performing overlapping community division, the degree of belonging of the remaining nodes relative to the pending community corresponding to the central node can be determined by the following method, as follows: First, for each remaining node in the graph structure, multiple neighbor nodes of the remaining node are determined, wherein the local density of the neighbor nodes is greater than the local density of the remaining nodes. Then, for each neighbor node, the similarity between the remaining node and the neighbor node is determined, and the sum of the similarities is calculated. When the neighbor node is the central node of the pending community, the ratio of the similarity to the sum is determined as the degree of belonging of the remaining node relative to the neighbor node. When the neighbor node is not the central node of the pending community, the attribution value of the remaining node relative to the neighbor node is determined to be zero. Finally, the sum of the attribution values ​​of the remaining node relative to each neighbor node is used as the degree of belonging of the remaining node relative to the pending community corresponding to the central node.

[0160] In some embodiments, the process of dividing the graph structure into communities can be implemented by calling a community mining model. By collecting data samples of social networks in a large number of application scenarios, the community mining model is trained for community division.

[0161] In the specific training process of the community mining model, the data samples of the social network of the target application scenario are first obtained, and the graph structure samples of the social network of the target application scenario are generated based on the data samples, wherein the graph structure samples include multiple nodes and multiple edges, and the nodes are used to represent the objects from the data samples, and the edges are used to connect two nodes, and the objects represented by the two nodes connected by the edges have social relations. Then the graph structure samples are forward propagated in the community mining model to obtain the community division results of the social network of the target application scenario. The specific process of forward propagation is: the graph structure samples are processed along the edges to obtain multiple node sequences of the graph structure samples, and then the neural network layer in the community mining model is called through the node sequence to train the initial vector of each node to obtain the structure vector of each node in the graph structure sample, and the encoder of the community mining model is called to encode the attribute information of each node in the graph structure sample to obtain the attribute vector of each node. Next, for each node of the graph structure sample, the structure vector of the node is fused with the attribute vector of the node to obtain the fusion vector of the node. Then, the similarity between the fusion vectors of multiple nodes in the graph structure sample is determined, and based on the similarity between the fusion vectors of multiple nodes, the graph structure sample is divided into communities. The community division result is then compared with the actual division result of the social network in the target application scenario, and the difference (error) between the community division result and the actual division result is used to construct the loss value of the community mining model. Finally, the loss value is used to perform back propagation in the community mining model to update the parameters of the community mining model.

[0162] When the loss value of the community mining model no longer decreases and changes after each round of iteration, or the training process has reached the number of training iterations, the training ends. The community mining model obtained at this time can be used to perform community segmentation of social networks in any target application scenario.

[0163] Through the embodiment of the present application, when objects in a social network are classified, the link relationship between objects is used to construct the graph structure of the social network. Then, considering that the sparsity of the nodes and edges of the graph structure is different, and the attribute characteristics of each node are different, the node sequence is obtained by walking processing, and the structural connection of the node is extracted based on the node sequence. At the same time, the attribute characteristics of the node are encoded, and the attribute characteristics of the node are extracted. Then, the structural characteristics and attribute characteristics of the node are fused to obtain the fusion connection of the node as the final vector representation of the node. Next, the similarity between the fusion vectors is determined to characterize the link relationship between the nodes, that is, the similarity of the fusion vectors between the nodes is used as the weight of the edge between the nodes, and finally the graph structure is divided into communities based on the weights. This avoids the impact of the sparsity of the graph structure on the community division, and at the same time, considering the structure of the node and the differences between the nodes, the community division error is reduced and the accuracy of the community division is improved.

[0164] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.

[0165] With the expansion of the Internet and the emergence of a large number of social networking sites, social networks have become an extremely important part of Internet applications. The interaction of users on the Internet will generate a large amount of network data. By constructing a social network graph for analysis, the hidden information in these network data can be mined, which can be used to analyze the behavior of social network users and provide personalized services to users. Specifically, the network data information is abstracted into a complex relationship network of nodes and edges, which is a complex social network. Generally speaking, complex social networks often contain an important feature, namely community structure. If the nodes in the network can be divided into non-intersecting or overlapping node sets, so that the number of edges in a set exceeds the number of edges between any two sets, it can be said that the network has a community structure. If there is an intersection between communities in a social network because of some nodes, it means that there is an overlap between the communities. This intersection is called an overlapping community. The nodes in the intersection are overlapping nodes in the social network, that is, the node can belong to multiple communities.

[0166] In the related art, when performing community mining on the social network graph of network data, the different attributes of each node in the graph are not taken into account. In addition, the different attributes of each node in the social network also make the relationship between each node different, making the node sparsity of the social network graph relatively large, that is, some nodes in the graph are relatively dense, and the number of undirected edges connecting the nodes is large, while some nodes in the graph are small and the number of undirected edges is small. The related art ignores the node differences and the sparsity of the social network graph, so the community division effect obtained by community mining is poor and the accuracy is low.

[0167] Based on the above scenario, this application embodiment provides a community discovery method. Figure 4 , Figure 4 This is a schematic diagram of a community discovery method provided in an embodiment of the present application. When a social network graph is input for community division, an improved deep walk algorithm is used to obtain a node sequence from the input social network through a Romdom Walk as the input of a language model. After training and learning, a vector representation of each node is obtained, i.e., a structural vector of the node. Next, the vector obtained by unifying the node attribute information is combined with the structural vector to obtain a node vector. The similarity between the combined node vectors is calculated to obtain the node intimacy in the social network. Finally, the node intimacy is used for community discovery to verify the effectiveness and accuracy of the method.

[0168] The following will be combined Figure 4To specifically describe the detailed process of the community discovery method provided by the embodiment of the present application. Assume that there is an unweighted network with n nodes that do not contain attributes, represented by G = (V, E), and a weighted network is represented by G = (V, E, W). Where V = {v1, v2, ... v n} represents the node set in the network, E represents the edge set, W represents the edge weight, the number of nodes in the network is n = |V|, and the number of edges is m = |E|. Given a social network graph with node attributes represented by G = (V, E, W), F(v i )={f k (v i )} represents a node attribute vector set. Here, W represents the edge weight in the social network, which can be a pre-assigned initialization weight. The edge weight can be updated later according to the node intimacy obtained by the method in this application to verify the social network effect.

[0169] First, the improved Deepwalk algorithm is used to obtain the node sequence of the input social network graph through (RomdomWalk). The random walk in the Deepwalk algorithm starts from a specific node in the network graph and randomly selects a path from the edge connected to the node for walking. Each step of the walk starts from the current node and then repeats the process. In the weighted network graph, suppose the node v in the network is i The random walk of It means that there exists Until the subsequent The nodes added during each step of the walk are from nodes v i The random walk in the Deepwalk algorithm in the embodiment of the present application is no longer a random walk for weighted networks, but a transition probability matrix is ​​obtained according to the weights, expressed as P ij , and then according to the transition probability from node v i Nodes are extracted from the connected nodes and added to the walk sequence. The length of the random walk is not fixed. In the embodiment of the present application, the walk process is set to a fixed maximum step length, that is, a truncated random walk. Among them, the calculation of the transition probability matrix P ij The method is as follows:

[0170]

[0171] In the above formula (2), i and j represent any two nodes in the social network graph, w(i) represents the sum of the edge weights containing node i, and w ij It represents the weight between node i and node j. If there is no edge connecting node i and node j, then w ijThe value of is 0, where w(i) is calculated as follows:

[0172]

[0173] In the above formula (3), n represents the number of nodes in the social network, w ik It represents the weight between node i and node k.

[0174] Continue to see Figure 4 , through the deep walk algorithm in the embodiment of the present application, multiple node sequences of the social network graph are obtained, such as Figure 4 As shown in "1→5→11→6→17, 34→29→3→4→2...". For the obtained node sequence, the Word2vec model can be used to encode the node sequence, wherein the Word2vec model is a word vector model that can represent the text sequence in the form of a numerical vector. Considering that the regularity of the appearance of network nodes in the random walk sequence and the regularity of the appearance of words in the sentence all obey the power-law distribution characteristics, the SkipGram model in Word2vec is used in the embodiment of the present application to encode the node sequence in the social network graph to obtain the feature vector corresponding to the node sequence. After using some short sequences of nodes obtained by random walk, the optimization method designed in the Skip Gram algorithm model is used to learn and train to obtain the vector representation of the node, wherein the input of the SkipGram algorithm model is the social network graph G, which can be an unweighted network "G=(V, E)" or a weighted network "G=(V, E, W)", the window size is set to w, the vector dimension is represented as d, the number of paths starting from the node is γ, the length of the walk path is t, and finally the node vector matrix Φ∈R is output. |V| *d.

[0175] The steps of the SkipGram algorithm model are:

[0176] 1. Randomly initialize Φ;

[0177] 2. Walk along the path starting from the node, iterate steps 2.1 and 2.2 until the number of paths walked reaches γ, then stop iterating;

[0178] 2.1. Randomly sort the nodes V passed during the walk, that is, execute the function Sheffle(V);

[0179] 2.2. For each node V after random sorting i , iteratively execute steps 2.2.1 and 2.2.2;

[0180] 2.2.1. Determine whether the input social network graph G is a weighted network: If the input social network graph G is an unweighted network graph "G = (V, E)", execute the function RandomWalk (G, V i , t), we get If the input social network graph G is a weighted network graph "G = (V, E, W)", execute the function weighted_Random Walk (G, V i , t), we get

[0181] 2.2.2. Node sequence obtained in step 2.2.1 The function SkipGram(Φ, w);

[0182] 3. Output the final node vector matrix Φ∈R |V| *d.

[0183] Continue to see Figure 4 In some embodiments, in order to facilitate the fusion of node attribute information and network structure information, it is necessary to unify the node attribute information in the social network graph to obtain a unified node attribute feature vector representation. Therefore, the embodiment of the present application adopts a general node attribute encoding method, namely one-hot encoding, to encode the attribute information of the nodes in the social network graph, thereby obtaining a continuous feature vector matrix, namely the attribute vector of the node.

[0184] For example, suppose the attribute value of the gender attribute of a user in a social network is {male, female}. First, the attribute feature is integer-encoded, that is, 0 represents male and 1 represents female. Then, it is represented by a vector. The first element of the vector is 0, indicating that the user's gender is male, and the second element is 1, indicating that the user's gender is female. This method is used to one-hot encode all discrete node attribute features in the social network, and finally the attribute feature vector is obtained.

[0185] In some embodiments, after the attribute attributes of the node are uniformly represented to obtain the attribute vector, the obtained attribute feature vector and the node structure vector based on the topological structure are concatenated as the final representation vector of the node, that is, the node vector (equivalent to the fusion vector above), which is expressed as Then the node vector set is expressed as In the embodiment of the present application, the similarity between node vectors is used to measure the similarity between node vectors of nodes, as the node intimacy (NI) between the corresponding nodes. For example, the node intimacy between node i and node j can be recorded as S NI(i,j), the specific calculation formula is as follows:

[0186]

[0187] In the above formula (4), i and j are any two nodes on the social network graph, d represents the vector dimension, is the node vector of node i.

[0188] In some embodiments, if the object represented by the node in the social network graph is relatively abstract and the attribute information cannot be extracted, that is, the attribute vector of the node is 0, the structure vector of the node can be directly used as the node vector to represent the intimacy between the nodes.

[0189] like Figure 4 As shown in the figure, after the node structure vector and attribute vector are combined to obtain the node vector, the similarity between the node vectors is determined to characterize the node intimacy between the nodes. The node intimacy can be used in some community discovery algorithms, such as the BGLL algorithm, the K-medoids algorithm, etc., to perform community mining in social networks to obtain different community division results.

[0190] In some embodiments, in order to verify the validity and accuracy of node intimacy, community division can be performed based on node intimacy, and then node intimacy can be evaluated based on the community division result. Node intimacy can usually be used in community discovery algorithms in two ways: constructing edge weights and constructing similarity matrices, which are described in detail below.

[0191] The first is the method of constructing edge weights. Considering that the weight of an edge between any two nodes can usually be used to reflect the similarity or intimacy between nodes, the node intimacy can be converted into the weight of the edge in the network by weighting the edges in the network, that is, the size of the weight is used to reflect the size of the intimacy between nodes. Then, community division is performed based on the weighted network, and the effectiveness and accuracy of the node intimacy are evaluated based on the division results.

[0192] Let the edge weight between node i and node j be w ij The construction idea is: when the social network is an unweighted network, the intimacy between two nodes is used to represent the weight of two nodes connected by an edge in the social network. When the social network is a weighted network, the intimacy between two nodes is used to update the initial weights between nodes in the social network, so as to reconstruct the weighted network. In the social network graph, A(i,j) can be used to represent the adjacency matrix of two nodes in the network, which is used to represent whether there is an edge between node i and node j. If so, A(i,j)=1, if not, A(i,j)=0. The initial weight between two nodes without edge connection can also be directly defaulted to 0, so the weight w ij The expression of is shown in the following formula:

[0193]

[0194] In the above formula (5), S NI (i, j) represents the similarity between the node vectors of node i and node j, that is, the node intimacy.

[0195] According to the constructed weighted network, the weighted network is used in the BGLL algorithm to mine the community. The BGLL algorithm divides the weighted network into communities by measuring the weighted modularity of the weighted network. The algorithm process mainly includes two stages. In the first stage, a community is assigned to each node in the weighted network. Therefore, after the initial assignment, the number of communities is the same as the number of nodes in the network. Next, the weighted modularity of each node is calculated after joining the communities to which its neighboring nodes belong, and the weighted modularity growth before and after joining is determined. Then the node is added to the community to which the neighboring node with the largest weighted modularity growth belongs. At this time, it is necessary to ensure that the growth value of the weighted modularity is positive. If the growth value of the weighted modularity is negative, the community of the node does not change. Finally, the above operation is repeated for all nodes in the weighted network until no node in the weighted network changes. At this time, all communities in the weighted network have been determined and fixed, which means that the community has been divided and the iteration process ends.

[0196] In the second stage of the BGLL algorithm, a new network is rebuilt based on the community structure obtained in the first stage, and all nodes in the network represent different communities. Next, the sum of the edge weights between nodes in different communities is used as the weight between any nodes in the new network, and then the first stage is repeated. The first and second stages are repeated until all communities have not changed, and finally the community division result of the network is obtained.

[0197] In some embodiments, after each node joins the community to which each of its neighboring nodes belongs, it is necessary to calculate the weighted modularity of the weighted network graph at this time and determine the weighted modularity growth before and after joining, where the weighted modularity can be expressed as Q w , the specific calculation formula is as follows:

[0198]

[0199] In the above formula (6), i and j are any two nodes in the weighted network. represents the sum of the weights of all edges in the weighted network, V represents the node set of the weighted network, represents the sum of the weights of all edges connected to node i, Γ represents the set of all edges connected to node i, c i and c iRepresents the community belongingness of node i and node j respectively. When node i and node j belong to the same community, c i =c i , then δ(c i ,c i ) function has a value of 1 if nodes i and j do not belong to the same community. i ≠c i , then δ(c i ,c i ) function has a value of 0.

[0200] In some embodiments, node intimacy can be used in a community discovery algorithm by constructing a similarity matrix. By calculating the intimacy between any nodes in the network, an n×n similarity matrix is ​​obtained and used in the K-medoids algorithm. The main idea of ​​the K-medoids algorithm is to select the point with the maximum sum of similarities with the remaining nodes in the community as the community center, and then assign communities to the remaining nodes.

[0201] The specific process of using the K-medoids algorithm for community discovery is as follows: First, randomly select K nodes from the network as the initial center points. Next, place all remaining nodes in the community where the center point with the greatest similarity to the initial center point is located. Then, reselect the center point in each community and use the node with the largest sum of similarities with other nodes in the community as the new center point. Finally, iterate and sequentially execute the above steps for all remaining nodes in the network until the center node of each community no longer changes. At this time, all communities in the network have been determined and fixed, which means that the community has been divided and the iteration process ends.

[0202] In some embodiments, the distance metric in the density clustering algorithm is calculated by the node intimacy between nodes in the social network graph, which can also be used for the division of overlapping communities. First, the distance between nodes is calculated based on the node intimacy, and then the node degree and the local clustering coefficient (LCC) are introduced to measure the local density of each node, and the relative distance of each node is calculated. Then, the point with large local density and relatively long distance is selected as the core point of the community, that is, the community center point. Finally, the remaining nodes are allocated according to the degree of belonging of the remaining nodes to obtain the overlapping community division.

[0203] The following will introduce the division process of overlapping communities in detail. First, it is necessary to calculate the local density ρ of each node in the network. In the density peak clustering algorithm, the local density of a node refers to the number of nodes near the node within the cutoff distance. However, in the network topology, nodes do not exist independently, but there is a certain connection, that is, the edge in the network. If there is a direct edge between two nodes, it means that the two nodes have a closer connection, while an indirect connection means that the connection is weaker. Therefore, in the network, it is impossible to simply calculate the local density of a node based on the number of nodes around it.

[0204] For example, see FIG. 5A to FIG. 5D , Figure 5A is one of the distribution diagrams of different local densities of nodes provided in the embodiment of the present application, Figure 5B This is the second distribution diagram of different local densities of nodes provided in the embodiment of the present application. Figure 5C This is the third distribution diagram of different local densities of nodes provided in the embodiment of the present application. Figure 5D This is the fourth distribution diagram of different local densities of nodes provided in the embodiment of the present application. Figure 5A and Figure 5D As shown, FIG. 5A to FIG. 5D The neighbor nodes of node A are node B, node C, and node D, and the number of neighbor nodes is 3. However, it can be seen that Figure 5A The local density of node A in Figure 5D The local density of the midpoint A should be large. Figure 5B and Figure 5C There are also differences in the local density of nodes, but the differences are not significant. Therefore, when calculating the node density, not only the number of neighboring nodes of the node should be considered, but also the density of connections around the node should be considered. In the embodiment of the present application, the local density of the node is calculated by introducing the node locality and the local clustering coefficient. Here, the local density of node i is expressed as ρ i The specific calculation formula is as follows:

[0205]

[0206] In the above formula (7), k i represents the degree of node i, that is, the number of edges directly connected to node i, j and h represent any two neighboring nodes of node i, respectively. j,h a jh a ij a ih a ji a hi Represents the local clustering coefficient of all neighboring nodes j and h of node i.

[0207] For example, according to the above formula (7), the local density of node A in different structure network graphs can be calculated, thus Figure 5AThe local density of node A in the network diagram is 3+(2×3)÷(3×2)=4. Figure 5B The local density of node A in the network diagram is 3+(2×2)÷(3×2)≈3.67, Figure 5C The local density of node A in the network graph is 3+(2×1)÷(3×2)≈3.33, Figure 5D The local density of node A in the network graph is 3+(2×0)÷(3×2)=3.

[0208] Next, the relative distance δ between nodes in the network graph is calculated. Generally, the more similar the nodes are in a social network, the greater the similarity is, which means the closer the distance between the two nodes is. The node intimacy between nodes can be used to represent node similarity. Therefore, in the embodiment of the present application, the relative distance between nodes is calculated based on the node intimacy. In the network graph G, the relative distance between node i and node j can be expressed as d ij The specific calculation method is as follows:

[0209]

[0210] In the above formula (8), S NI (i, j) represents the similarity between the node vectors of node i and node j, that is, the node intimacy, and ε represents a fixed preset distance parameter.

[0211] According to formula (8), if node i is the point with the maximum local density, the relative distance δ of node i is i is the distance d between node j, which is closest to node i, and node i ij , accordingly, if node i is the point with the maximum non-local density, the relative distance δ of node i is i is the distance d between node i and node j, which has a higher local density than node i and is closest to node i ij .

[0212] In some embodiments, after determining the local density ρ and relative distance δ of each node in the network graph, the next step is to find the community center in the network graph. In the embodiment of the present application, the cluster center, that is, the community center, is determined by the local density and relative distance of each node. The local density and relative distance of each node are mapped to the decision graph, and the decision graph is used to characterize the distribution of the local density and relative distance of the node. The decision graph of a certain network graph can be found in Fig. 6A , Fig. 6A is a distribution diagram of the local density and relative distance of nodes provided in the embodiment of the present application. Fig. 6A As shown in the figure, the local density and relative distance of most nodes are close, but the local density and relative distance of some nodes are very large. Correspondingly, the center values ​​of these nodes are also very large. For details, see Figure 6B, Figure 6B is a distribution diagram of the node center value provided in the embodiment of the present application, such as Figure 6B As shown in the figure, since the local density and relative distance of most nodes are close, the center values ​​of these nodes will also become close, but the local density and relative distance of individual nodes will be very large, resulting in the center values ​​of these nodes becoming large. However, in the actual network graph, the size of some communities varies greatly, resulting in the density of individual community centers being relatively small, and such points are not prominent in the graph. Therefore, there may be two different situations, one in which both the local density and relative distance are large, and the other in which one is relatively large and the other is relatively small.

[0213] In order to more accurately select the center point of the community, the following steps are taken in the embodiment of the present application to select the center point of the community. The specific steps are as follows:

[0214] Step 1: Directly select the points with significantly larger local density ρ and relative distance δ from the decision graph as the community center points.

[0215] Step 2: When one of the local density and relative distance of a node is relatively large and the other is relatively small, the center value λ of the node is determined by calculating the center value λ, where the center value λ is the product of the local density ρ and the relative distance δ. However, when calculating the center value λ, the local density ρ and the relative distance δ of the node need to be normalized respectively to ensure that the local density ρ and the relative distance δ are in the same value range. The normalized calculation formula of the local density ρ is as follows:

[0216]

[0217] Accordingly, the normalized calculation formula of the relative distance δ is as follows:

[0218]

[0219] In the above formulas (9) and (10), ρ i * represents the local density ρ of node i i The normalized result, δ i * Represents the relative distance δ of node i i The normalized result of , max and min represent the maximum value function and the minimum value function respectively.

[0220] Next, calculate the center value of the node. The calculation formula is as follows:

[0221] λ i =ρ i * ×δ i *(11)

[0222] After determining the center value of each node in the network diagram, all the center values ​​are then sorted in ascending order. It can be seen that the node center value changes from small to large. The larger the center value, the greater the possibility that node i will become the center point. There are differences in the size of the center value between the center point and the non-center point. The center value that may be selected as the center is larger, while the center values ​​of the non-center nodes are mostly low, and the size of the center value fluctuates little, and the change is very slow. In the embodiment of the present application, a larger center value is selected as the center point to be added to the center point list, that is, the center point ranked later in the ascending order is added to the center point list.

[0223] Step 3: For each center point in the center point list, calculate the average local density of the center point's neighboring nodes, and filter out the center nodes with a local density smaller than the average local density of the neighboring nodes from the center list.

[0224] In the above step 3, it is considered that in the density peak clustering algorithm, clusters are non-overlapping clusters. In the process of community discovery, there are often overlapping nodes in the network, and overlapping nodes are generally located at the edge of the community. Therefore, its relative distance from the nearest node with higher local density is large, and if the overlapping node belongs to multiple communities, it may have a higher local density, and it is easy to be selected as a center point into the center list. The neighbor nodes of the overlapping nodes will be closer to a community and have a closer connection. Therefore, the local density of the neighbor nodes is relatively larger than that of the overlapping nodes. In order to make the obtained center point not include overlapping nodes, it is necessary to compare the average local density of the neighbor nodes and delete the nodes with less than the average local density of the neighbor nodes from the center list.

[0225] In some embodiments, the center point of the community determined from the network graph is added to the center point list, and the remaining nodes in the network graph need to be divided into overlapping communities. In the density peak clustering algorithm, the remaining sample points are allocated to the cluster with the closest distance and a local density greater than that of the current center point. This method makes each remaining sample point belong to only one cluster. Therefore, the overlapping allocation method of the remaining nodes in the embodiment of the present application can continue to refer to the following step 4.

[0226] Step 4: Assume that the number of community center points in the center point list is m, and set the label for each community as c = {c1, c2, ..., c m}.

[0227] Step 5: Calculate the degree p of the remaining nodes i relative to each community center point i,c , where the degree of belonging is expressed as The value range is [0, 1]. The greater the degree of belonging of the remaining nodes to a community, the easier it is for the remaining nodes to be assigned to the community.

[0228] For example, the community label corresponding to the center point 3 is c2, then except The value of is 1, and the rest are 0, that is, p 3,c ={0,1,0,…,0}.

[0229] In the embodiment of the present application, the degree of belonging to the community to which the center point belongs is set to 1, and the degree of belonging to other communities to which the center point belongs is set to 0. Next, the degree of belonging to the remaining nodes is calculated, and the calculation formula is as follows:

[0230]

[0231] In the above formula (12), S NI (i, j) represents the similarity between a remaining node i and its neighbor node j, that is, the node intimacy between node i and node j. Neigh represents a node set consisting of N neighbor nodes with a larger local density than the remaining node i.

[0232] According to the above formula (12), when calculating the node belongingness, on the one hand, the similarity between node i and N neighboring nodes with a greater local density than node i is considered, and on the other hand, the belongingness of the N neighboring nodes is considered. According to formula 11, the greater the similarity between a neighbor node j and i, and the greater the belongingness of node j to a certain community, the greater the belongingness of node i to the community.

[0233] Step 6: After determining the degree of belonging of each remaining node i, perform overlapping allocation on each remaining node i. Assume that a remaining node i belongs to c r The degree of belonging to the community is related to the t The community's belongingness ratio is greater than the threshold σ, that is, Then node i is assigned to community c at the same time r and community c t That is, the remaining node i belongs to community c r and c t The degree of belonging is not much different, that is, node i is an overlapping node of two communities, and belongs to community c. r Also belongs to community c t .

[0234] Through the above steps, each remaining node in the network graph can be assigned to a community. When all nodes in the network are assigned to one or more communities, the division of overlapping communities is completed. So far, the embodiment of the present application calculates the distance metric in the density clustering algorithm through the node intimacy between nodes in the social network graph, and the entire process of overlapping community division is introduced.

[0235] In order to verify the effect of using the node intimacy between nodes in the network graph to discover communities or divide overlapping communities in the embodiments of the present application, the data set and the preprocessing process are first introduced by using relevant social data sets and multiple comparison models for comparison experiments.

[0236] The dataset uses a lawyer relationship network dataset, which is a network structure diagram constructed based on the cooperative relationship between members of a law firm. Figure 7 As shown, Figure 7 is a structural diagram of the lawyer relationship network data set provided in the embodiment of this application, such as Figure 7 As shown in the figure, the network structure diagram includes 71 lawyers (nodes) in total. The connection relationship of the nodes in the network represents the working relationship and friendship relationship between the 71 lawyers. In the network structure diagram, the node attribute information of the lawyer (node) includes characteristic attributes such as lawyer status, gender, office, internship location, and graduation school. The attribute information of some nodes is shown in Table 1 below:

[0237] Table 1

[0238]

[0239] In the above Table 1, all feature attribute data are preprocessed, and each feature attribute data is mapped to a digital code, as shown in Table 1, mapped to 1, 2, and 3. Considering that all feature attributes of the node are categorical attributes, the node attribute information in the network is uniformly represented by one-hot encoding, that is, the categorical attributes are represented by binary vectors, thereby obtaining a continuous vector representation, that is, the attribute vector of the node. The results of the unified representation of some attributes are shown in Table 2 below:

[0240] Table 2

[0241]

[0242] In order to conduct comparative experiments, the embodiment of the present application collects public data sets of Karate Club Network (Karate) and Dolphin Relationship Network (Dolphin), which only contain network topology information. Therefore, comparative experiments on these two data sets can verify the accuracy and advantages of the node intimacy representation method based on network structure information. The specific information description of the data set can be shown in Table 3:

[0243] Table 3

[0244]

[0245] Next, the experimental method and evaluation indicators of the comparative experiment in the embodiment of the present application are introduced. Specifically, the experiment uses a lawyer relationship network dataset, a karate club network, and a dolphin relationship network. Through the community discovery method provided in the embodiment of the present application, the node vector of each node in the network diagram is first obtained, and the similarity between the node vectors is calculated to obtain the node intimacy in the social network. Finally, the node intimacy is used in community discovery algorithms such as the BGLL algorithm and the K-medoids algorithm or for overlapping community division. It should be noted that different node similarities will be used in the comparative experiment of the embodiment of the present application to compare with the node intimacy to verify the effectiveness of using node intimacy for community discovery. Among them, the methods of different node similarities used in the comparative experiment of the embodiment of the present application are as follows:

[0246] (1) Adjacency Similarity

[0247] Adjacency similarity is a method that uses the connection information of nodes in the network to represent the similarity between nodes. That is, if there is an edge between two nodes in the network, the similarity is 1, otherwise the similarity is 0. This method is the simplest method to represent similarity, and the calculation formula is as follows:

[0248] Adjacency(i,j)=A(i,j) (13)

[0249] In the above formula (13), A represents the adjacency matrix of the network, and A(i, j) indicates whether there is an edge connection between node i and node j. If there is an edge connection, A(i, j) takes the value of 1, and if not, A(i, j) takes the value of 0. Wherein, A represents the adjacency matrix of the network.

[0250] (2) Jaccard Similarity

[0251] Jaccard similarity is mainly used to calculate the similarity between neighbor node sets of nodes in the network. The specific calculation formula is as follows:

[0252]

[0253] In the above formula (14), Γ i and Γ j Represent the neighbor node sets adjacent to node i and node j respectively, |Γ i ∩Γ j | represents the number of common neighbor nodes between two nodes, |Γ i ∪Γ j |Represents the total number of neighbor nodes between two nodes.

[0254] (3) Cosine similarity

[0255] Cosine similarity is often used to indicate the similarity between two vectors. It is a simple and very commonly used similarity calculation method. The calculation formula is as follows:

[0256]

[0257] In the above formula (15), and Represent the feature vector representation of node i and node j respectively.

[0258] (4) Simple matching coefficient

[0259] Simple Matching Coefficient (SMC) is a method used to calculate attribute similarity. It obtains the attribute similarity between nodes by counting the number of attributes with the same attribute value for each attribute of the nodes in the network. Check all the attributes of the nodes. If any two nodes have the same attribute value on a certain attribute, then add 1 to the similarity between the two nodes. The calculation formula is as follows:

[0260]

[0261]

[0262] In the above formula (16), M represents the total number of attributes with the same attribute value for each attribute of the nodes in the network, and s m (i, j) represents the attribute similarity between node i and node j. In the above formula (17), F m (i) represents the attribute value of node i on attribute m, and correspondingly, F m (j) represents the attribute value of node j on attribute m.

[0263] The evaluation indicators set in the comparative experiment of the embodiment of the present application are NMI and F1-score, wherein F1-score is a comprehensive evaluation indicator, which is determined by two indicators, precision and recall, which are defined as follows:

[0264]

[0265]

[0266]

[0267]

[0268] In the above formula (18) and formula (19), T = {T1, T2, ... T n} represents the actual community division result set, T r is the node set of the rth real community, C={C1,C2,…C n} represents the community set divided by the algorithm, C k The community set is divided by the kth algorithm. In formula (21), R represents the total number of real communities, |T r | represents the number of elements in the set, and |V| represents the number of nodes in the network.

[0269] According to the information contained in the Lazega lawyer relationship network dataset, node intimacy (similarity between node vectors) can be obtained in three ways. The first is a structural vector based on the network topology relationship (expressed as NI1), the second is based on the node attribute information vector (expressed as NI2), and the third is the node vector after combining the network topology structure and node attribute information in the embodiment of the present application (expressed as NI3). According to these different node intimacy (NI), edge weights and similarity matrices are constructed respectively, and then used as inputs of the BGLL algorithm and the K-medoids algorithm respectively to obtain the community division results of the Lazega lawyer relationship network. The evaluation indicators corresponding to the final division can be found in Fig. 8A and Figure 8B ,in, Fig. 8A is a comparison chart of MNI indicators of different node vectors provided in the embodiment of the present application, Figure 8B It is a comparison chart of the F1-score indicators of different node vectors provided in the embodiments of the present application.

[0270] according to Fig. 8A and Figure 8B It can be seen that the vector representation of node intimacy based on three different information can obtain different community discovery results, and in some cases the differences between the three results are very large. For example, the community discovery results based on NI3 perform better in both NMI and F1-score evaluation indicators, and the community discovery results based on NI1 can also obtain better divisions, while the community discovery results based on NI2 are slightly worse, but they are all worse than the community discovery results based on NI3. This shows that the node structure vector based on the network topology plays a greater role in community division, which can significantly improve the results of community division, while the node attribute information vector plays a smaller role in community division. This also shows that the node intimacy that integrates the structure vector and the attribute vector in the embodiment of the present application can obtain better community division results and improve the accuracy of community division.

[0271] Next, we verify the impact of the similarity between node vectors on the community division results. Based on the lawyer relationship network dataset, different similarities (node ​​intimacy (NI), adjacency similarity, Jaccard similarity, cosine similarity and simple matching coefficient in the embodiment of this application) are used to perform community discovery respectively, that is, they are applied to the K-medoids algorithm and the BGLL algorithm for comparison, and finally the evaluation index corresponding to the community division is obtained. Among them, based on the NMI evaluation index, on the basis of the BGLL algorithm and the K-medoids algorithm, the community division effects of different similarities can be seen in Fig.9A and Fig. 9B Based on the F1-score evaluation index, the community division effects of different similarities based on the BGLL algorithm and the K-medoids algorithm can be seen in Fig. 9C and Fig.9D .in, Fig.9A is a comparison chart of NMI indicators of different node vector similarities under the BGLL algorithm provided in the embodiment of the present application, Fig. 9B is a comparison chart of NMI indicators of different node vector similarities under the K-medoids algorithm provided in the embodiment of the present application, Fig. 9C is a comparison chart of the F1-score index of different node vector similarities under the BGLL algorithm provided in the embodiment of the present application, Fig.9D It is a comparison chart of the F1-score index of different node vector similarities under the K-medoids algorithm provided in the embodiment of the present application.

[0272] from Fig.9A , Fig. 9B , Fig. 9C as well as Fig.9D It can be seen that the community discovery algorithm based on node intimacy (NI) in the embodiment of the present application basically obtains the optimal NMI and F1-score. When compared with other commonly used optimal evaluation indicators of similarity, based on the K-mediods community discovery algorithm, the division results based on node intimacy (NI) in the embodiment of the present application are more obvious than the division results based on other similarities, because the input of the K-mediods algorithm is the node similarity matrix. Therefore, it is more prominent that the node intimacy representation method based on network representation learning can better obtain the similarity of nodes in the network, thereby obtaining more accurate community discovery results. Therefore, it is also verified that the community discovery based on node intimacy provided in the embodiment of the present application can further improve the community division effect.

[0273] Finally, we verify the generalization of the community discovery method provided in the embodiment of the present application, that is, verify and compare the differences in the community division results obtained by the community discovery method under different data sets. Therefore, the community discovery method provided in the embodiment of the present application is applied to the lawyer relationship network data set, the karate club network, and the dolphin relationship network data set respectively. Then, based on the similarities of different node vectors, the community discovery method provided in the embodiment of the present application is verified, and finally the evaluation index corresponding to the community division situation is obtained. Based on the NMI evaluation index, the community division effects of different node vector similarities in the three data sets can be seen in Fig. 10A , Fig. 10A is a comparison chart of the NMI indicators of community division of different node vector similarities under various data sets provided in the embodiment of the present application. Based on the F1-score evaluation index, the community division effects of different node vector similarities in three data sets can be seen in Fig. 10B , Fig. 10B This is a comparison chart of the F1-score indicators of community divisions under different similarities in each data set provided in the embodiment of the present application.

[0274] from Fig. 10A as well as Fig. 10B It can be seen that under different real network data sets, the community division results based on node intimacy (NI) in the embodiments of the present application have obtained better NMI indicators and F1-score indicators. In addition, the community division method based on node intimacy (NI) in the embodiments of the present application has good performance on different data sets and has a certain generalization. In addition, this also shows that in the embodiments of the present application, the vector representation similarity based on network representation learning can well reflect the node intimacy between nodes. After applying it to the community discovery algorithm, better community division results can be obtained compared to other node vector construction and similarity methods.

[0275] The following further describes an exemplary structure of the data processing device 453 provided in the embodiment of the present application implemented as a software module. In some embodiments, for example Figure 2As shown, the software modules stored in the data processing device 453 of the memory 450 may include: a generation module 4531, which is used to generate a graph structure of a social network, wherein the graph structure includes nodes and edges, the nodes are used to represent objects from the social network, the edges are used to connect two nodes, and the objects represented by the two nodes connected by the edge have a social relationship; a determination module 4532, which is used to determine the node sequence of the graph structure, determine the structure vector of the node in the graph structure based on the node sequence, and encode the attribute information of the node in the graph structure to obtain the attribute vector of the node; a fusion module 4533, which is used to fuse the structure vector of the node with the attribute vector of the node to obtain the fusion vector of the node; a division module 4535, which is used to determine the similarity between the fusion vectors of the nodes in the graph structure, and divide the graph structure into communities based on the similarity between the fusion vectors of the nodes to obtain the community division result of the social network.

[0276] In some embodiments, the determination module 4532 is also used to, if the edges in the graph structure are unweighted graph structures, perform random walk processing on the nodes in the graph structure along the edges to obtain a node sequence of the graph structure; if the edges in the graph structure are weighted graph structures, perform random walk processing on the nodes in the graph structure along the edges based on the weights of the edges in the graph structure to obtain a node sequence of the graph structure.

[0277] In some embodiments, the determination module 4532 is also used to arbitrarily select a node from the graph structure as the starting wandering node, randomly wander along the edge of the graph structure for N steps starting from the starting wandering node, pass through N wandering nodes in sequence, and sort the starting wandering node and the N wandering nodes passed through in order of wandering to obtain a node sequence, where N is an integer greater than or equal to 1; arbitrarily select a node from the graph structure as the starting wandering node, based on the weight of the edge in the graph structure, start from the starting wandering node, and perform M steps of wandering along the edge of the graph structure based on the weight of the graph structure, pass through M wandering nodes in sequence, and sort the starting wandering node and the M wandering nodes passed through in order of wandering to obtain a node sequence, where M is an integer greater than or equal to 1.

[0278] In some embodiments, the determination module 4532 is also used to obtain a target node sequence including a first node from a node sequence of a graph structure, wherein the first node is any node in the graph structure; and train an initial vector of the first node based on adjacent nodes of the first node in the target node sequence to obtain a structural vector of the first node.

[0279] In some embodiments, the determination module 4532 is also used to perform adjacent node prediction processing based on the initial vector of the first node in the target node sequence to obtain the prediction probability of the adjacent nodes corresponding to the first node; determine the error between the prediction probability and the marking probability; if the error is not in a minimized convergence state, update the initial vector to obtain an updated initial vector; if the error is in a minimized convergence state, use the current initial vector as the structural vector of the first node.

[0280] In some embodiments, the fusion module 4534 is also used to perform dimensionality unification processing on the node's structural vector and the node's attribute vector to obtain a transformed structural vector and a transformed attribute vector; and to perform fusion processing on the node's transformed structural vector and the node's transformed attribute vector to obtain a fusion vector of the node.

[0281] In some embodiments, the partitioning module 4535 is further used to update the weight value of the edge based on the similarity between the fusion vectors of the nodes; based on the updated weight value of the edge, perform community partitioning on the graph structure to obtain the community partitioning result of the social network.

[0282] In some embodiments, the partitioning module 4535 is further used to allocate nodes in the graph structure to obtain P pending communities, where the pending community includes at least one node, and P is an integer greater than 1; obtain Q pairwise merging methods of the P pending communities, and determine the change value of the weighted modularity of the graph structure under each pairwise merging method based on the updated weight value of the edge, where Q is an integer greater than 1; if at least one change value is greater than a change value threshold, merge the P pending communities based on the pairwise merging method corresponding to the largest change value to obtain merged P-1 pending communities; if all change values ​​are not greater than the change value threshold, take the P pending communities as the community partition result.

[0283] In some embodiments, the partitioning module 4535 is further used to determine a first weighted modularity of a graph structure including P pending communities based on the updated weight values ​​of the edges; merge the P pending communities based on Q pairwise merging methods to obtain Q merging results, wherein the Q merging results correspond one-to-one to the Q pairwise merging methods, and the merging results include P-1 pending communities; determine a second weighted modularity of the graph structure including the P-1 pending communities; and determine a change value between the second weighted modularity and the first weighted modularity.

[0284] In some embodiments, the partitioning module 4535 is also used to determine a first sum of the weight values ​​of all edges in the graph structure; for each of the P pending communities, determine a second sum of the weight values ​​of all edges in the pending community and a third sum of the weight values ​​of the edges connected to all nodes in the pending community; determine the ratio of the second sum to the first sum as the edge modularity; determine the node modularity based on the ratio of the second sum to the first sum; determine the difference between the edge modularity and the node modularity as the weighted modularity of the pending community; and sum the weighted modularities of the P pending communities to obtain the first weighted modularity of the graph structure.

[0285] In some embodiments, the partitioning module 4535 is also used to obtain data samples of the social network of the target application scenario, and generate a graph structure sample of the social network of the target application scenario based on the data sample; forward propagate the graph structure sample in the community mining model to obtain the community partition result of the social network of the target application scenario, and construct the loss value of the community mining model based on the difference between the community partition result of the social network of the target application scenario and the actual partition result; and perform back propagation in the community mining model based on the loss value to update the parameters of the community mining model.

[0286] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the data processing method described above in the embodiment of the present application.

[0287] The present application embodiment provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the data processing method provided by the present application embodiment, for example, Figure 3A and Figure 3G The data processing method is shown.

[0288] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0289] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0290] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0291] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0292] In summary, through the embodiments of the present application, when objects in a social network are classified, the link relationship between objects is used to construct the graph structure of the social network. Then, considering that the sparsity of the nodes and edges of the graph structure is different, and the attribute characteristics of each node are different, the node sequence is obtained by walking processing, and the structural connection of the node is extracted based on the node sequence. At the same time, the attribute characteristics of the node are encoded, and the attribute characteristics of the node are extracted. Then, the structural characteristics and attribute characteristics of the node are fused to obtain the fusion connection of the node as the final vector representation of the node. Next, the similarity between the fused vectors is determined to characterize the link relationship between the nodes, that is, the similarity of the fused vectors between the nodes is used as the weight of the edge between the nodes, and finally the graph structure is divided into communities based on the weights. This avoids the impact of the sparsity of the graph structure on the community division, and at the same time, considering the structure of the node and the differences between the nodes, the community division error is reduced and the accuracy of the community division is improved.

[0293] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A data processing method, characterized in that: The method comprises: Generate a graph structure of a social network, wherein the graph structure includes nodes and edges, the nodes are used to represent objects from the social network, the edges are used to connect two nodes, and the objects represented by the two nodes connected by the edge have a social relationship; Determining a node sequence of the graph structure, determining a structure vector of the node in the graph structure based on the node sequence, and encoding attribute information of the node in the graph structure to obtain an attribute vector of the node; Fusing the structure vector of the node with the attribute vector of the node to obtain a fusion vector of the node; The similarities between the fusion vectors of the nodes in the graph structure are determined, and based on the similarities between the fusion vectors of the nodes, the graph structure is divided into communities to obtain a community division result of the social network.

2. The method according to claim 1, characterized in that The determining of the node sequence of the graph structure comprises: If the edge in the graph structure is weightless, performing random walk processing on the nodes in the graph structure along the edge to obtain a node sequence of the graph structure; If the edges in the graph structure are weighted, random walk processing is performed on the nodes in the graph structure along the edges based on the weights of the edges in the graph structure to obtain a node sequence of the graph structure.

3. The method according to claim 2, characterized in that The performing random walk processing on the nodes in the graph structure along the edge to obtain the node sequence of the graph structure includes: arbitrarily selecting a node from the graph structure as a starting walk node, starting from the starting walk node and randomly walking along the edge of the graph structure for N steps, passing through N walk nodes in sequence, and sorting the starting walk node and the N walk nodes passed in order of walking to obtain the node sequence, wherein N is an integer greater than or equal to 1; The performing random walk processing on the nodes in the graph structure along the edges based on the weights of the edges to obtain a node sequence of the graph structure includes: A node is randomly selected from the graph structure as a starting walking node, and based on the weight of the edge in the graph structure, M steps are walked along the edge of the graph structure starting from the starting walking node, and M walking nodes are passed in sequence, and the starting walking node and the M walking nodes passed are sorted in the order of walking to obtain the node sequence, where M is an integer greater than or equal to 1.

4. The method according to claim 1, characterized in that: The determining the structure vector of the node in the graph structure based on the node sequence includes: Acquire a target node sequence including a first node from a node sequence of the graph structure, wherein the first node is any node in the graph structure; The initial vector of the first node is trained based on adjacent nodes of the first node in the target node sequence to obtain a structural vector of the first node.

5. The method according to claim 4, characterized in that The training of the initial vector of the first node based on the adjacent nodes of the first node in the target node sequence to obtain the structural vector of the first node includes: Performing adjacent node prediction processing based on the initial vector of the first node in the target node sequence to obtain prediction probabilities of adjacent nodes of the first node; determining an error between the predicted probability and the labeled probability; If the error is not in a minimized convergence state, updating the initial vector to obtain an updated initial vector; If the error is in the minimization convergence state, the current initial vector is used as the structure vector of the first node.

6. The method according to claim 1, characterized in that The fusing the structure vector of the node with the attribute vector of the node to obtain the fusion vector of the node includes: Performing dimension unification processing on the structure vector of the node and the attribute vector of the node to obtain a transformed structure vector and a transformed attribute vector; The transformed structure vector of the node and the transformed attribute vector of the node are fused to obtain a fused vector of the node.

7. The method according to claim 1, characterized in that The performing community division on the graph structure based on the similarity between the fusion vectors of the nodes to obtain the community division result of the social network includes: Updating the weight value of the edge based on the similarity between the fusion vectors of the nodes; Based on the updated weight values ​​of the edges, the graph structure is divided into communities to obtain a community division result of the social network.

8. The method according to claim 7, characterized in that The performing community division on the graph structure based on the updated weight value of the edge to obtain the community division result of the social network includes: Performing allocation processing on the nodes in the graph structure to obtain P pending communities, wherein the pending community includes at least one of the nodes, and P is an integer greater than 1; Obtain Q pairwise merging methods of the P pending communities, and determine, based on the updated weight values ​​of the edges, a change value of the weighted modularity of the graph structure under each pairwise merging method, where Q is an integer greater than 1; If at least one of the change values ​​is greater than the change value threshold, the P pending communities are merged based on the pairwise merging method corresponding to the largest change value to obtain merged P-1 pending communities; If all the change values ​​are not greater than the change value threshold, the P pending communities are taken as the community division results.

9. The method according to claim 8, characterized in that The step of determining the change value of the weighted modularity of the graph structure in each pairwise merging mode based on the updated weight value of the edge includes: Determining a first weighted modularity of a graph structure including the P pending communities based on the updated weight values ​​of the edges; Merging the P pending communities based on Q pairwise merging methods to obtain Q merging results, wherein the Q merging results correspond to the Q pairwise merging methods one by one, and the merging results include P-1 pending communities; Determining a second weighted modularity of the graph structure including the P-1 undetermined communities; A change value between the second weighted modularity and the first weighted modularity is determined.

10. The method according to claim 9, characterized in that The determining, based on the updated weight values ​​of the edges, a first weighted modularity of the graph structure including the P to-be-determined communities comprises: Determining a first sum of weight values ​​of all edges in the graph structure; For each of the P pending communities, Determining a second sum of weight values ​​of all edges in the to-be-determined community and a third sum of weight values ​​of edges connected to all nodes in the to-be-determined community; Determining a ratio of the second sum to the first sum as edge modularity; Determining a node modularity based on a ratio of the third sum to the first sum; Determine the difference between the edge modularity and the node modularity as the weighted modularity of the undetermined community; The weighted modularity of the P pending communities is summed to obtain a first weighted modularity of the graph structure.

11. The method according to claims 1-10, characterized in that The data processing method is implemented by calling a community mining model, and the method further includes: Acquire a data sample of a social network of a target application scenario, and generate a graph structure sample of the social network of the target application scenario based on the data sample; Forward propagating the graph structure sample in the community mining model to obtain a community division result of the social network of the target application scenario, and constructing a loss value of the community mining model based on the difference between the community division result of the social network of the target application scenario and a true division result; Back propagation is performed in the community mining model based on the loss value to update parameters of the community mining model.

12. A data processing device, characterized in that: The device comprises: A generating module, configured to generate a graph structure of a social network, wherein the graph structure includes nodes and edges, wherein the nodes are used to represent objects from the social network, and the edges are used to connect two nodes, and the objects represented by the two nodes connected by the edges have a social relationship; A determination module, configured to determine a node sequence of the graph structure, determine a structure vector of the node in the graph structure based on the node sequence, and encode the attribute information of the node in the graph structure to obtain an attribute vector of the node; A fusion module, for each of the nodes, fuses the structure vector of the node with the attribute vector of the node to obtain a fusion vector of the node; The partitioning module determines the similarity between the fusion vectors of the nodes in the graph structure, and performs community partitioning on the graph structure based on the similarity between the fusion vectors of the nodes to obtain a community partitioning result of the social network.

13. An electronic device, characterized in that: The electronic device comprises: Memory for storing computer executable instructions or computer programs; A processor, configured to implement the data processing method according to any one of claims 1 to 11 when executing the computer executable instructions or computer programs stored in the memory.

14. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the data processing method according to any one of claims 1 to 11 is implemented.

Citation Information

Cited By

  • Data fusion method and electronic equipment

    CN120744822A

  • Contextualized directional information delivery method and system based on real-time position of patient

    CN121603869A