Group query method, device and equipment
Through offline calculation, group prior knowledge and setting supervision data are obtained, the query performance and interpretability problems of group queries are solved, and efficient and accurate group discovery and query results are realized.
Patent Information
- Application Number
- CN202210298537.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-03-25
AI Technical Summary
When conducting group query, the existing technology faces the problems of insufficient query performance and poor interpretability. Especially in multi-node scenarios, the existing methods cannot effectively support efficient query and accurate results display.
Through offline calculation, group prior knowledge in the graph topology data set is obtained, group labels of some nodes are set as supervision data, and tags of the remaining nodes are initialized, group discovery is combined with supervision data, and the results are synchronized to the online storage database to support online query.
It improves the accuracy and interpretability of group queries, shortens query delay, and can efficiently handle multi-node query scenarios to ensure the reliability and efficiency of query results.
Smart Images

Figure CN114610759B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of graph data technology, and in particular to a group query method, device, and equipment. Background Art
[0002] Groups are generally composed of closely connected nodes in a relationship network. For example, in an enterprise graph scenario, equity penetration between enterprise nodes can uncover relationships between controlling shareholders, actual controllers, directors, supervisors, and other senior executives of each enterprise node and each enterprise, thereby discovering enterprise groups with network structures within the enterprise graph. Mining all groups in a complex network to uncover network structures can be used in scenarios such as gang detection and fraud detection. However, with the development of society and the economy, the diversity of nodes in various fields and the massive amount of data are making group relationships increasingly complex.
[0003] Current online graph querying approaches for group queries are limited by graph complexity and query performance, making them inadequate for multi-node group queries and ensuring group interpretability. Offline pre-computation of node connections requires additional storage for these connections. When group queries are performed on a large number of nodes, the large amount of stored data limits the recall rate of the group query, significantly reducing query performance. Summary of the Invention
[0004] One or more embodiments of this specification provide a group query method, apparatus, and device to solve the following technical problem: how to provide a group query method that can improve query performance.
[0005] To solve the above technical problems, one or more embodiments of this specification are implemented as follows:
[0006] One or more embodiments of this specification provide a group query method, including:
[0007] Obtaining node-related data for offline calculation, the offline calculation includes: a priori step, a setting step, and a discovery step;
[0008] In the prior step, a priori knowledge of a group of nodes in the graph topology data set is obtained;
[0009] In the setting step, according to the prior knowledge of the group, the group labels of each of the part of nodes are set as supervision data, and the group labels of each of the remaining nodes are initialized;
[0010] In the discovery step, group discovery is performed in the graph topology data set based on the supervision of the supervision data and the initialized group labels;
[0011] Synchronizing the results of the group discovery to an online storage database;
[0012] If a query data set comprising a plurality of nodes submitted by a user is received, the online storage database is queried for groups to which at least some of the plurality of nodes belong, and the user is responded to according to the query result.
[0013] One or more embodiments of this specification provide a group query device, including:
[0014] Acquisition unit, prior unit, setting unit, discovery unit, synchronization unit, query unit;
[0015] The acquisition unit is used to acquire node-related data for offline calculation, and the offline calculation includes: a priori step, a setting step, and a discovery step;
[0016] The a priori unit is used to obtain group a priori knowledge of a part of nodes in the graph topology data set in the a priori step;
[0017] The setting unit is configured to set, in the setting step, the group labels of each of the part of nodes according to the group prior knowledge as supervision data, and initialize the group labels of the remaining nodes;
[0018] The discovery unit is configured to perform group discovery in the graph topology data set based on the supervision of the supervision data and the initialized group labels in the discovery step;
[0019] The synchronization unit is used to synchronize the result of the group discovery to an online storage database;
[0020] The query unit is configured to, upon receiving a query data set comprising a plurality of nodes submitted by a user, query the online storage database for groups to which at least some of the plurality of nodes belong, and respond to the user according to the query result.
[0021] One or more embodiments of this specification provide a group query device, including:
[0022] at least one processor; and,
[0023] a memory communicatively connected to the at least one processor; wherein,
[0024] The memory stores executable instructions that can be executed by the at least one processor to enable the at least one processor to:
[0025] Obtaining node-related data for offline calculation, the offline calculation includes: a priori step, a setting step, and a discovery step;
[0026] In the prior step, a priori knowledge of a group of nodes in the graph topology data set is obtained;
[0027] In the setting step, according to the prior knowledge of the group, the group labels of each of the part of nodes are set as supervision data, and the group labels of each of the remaining nodes are initialized;
[0028] In the discovery step, group discovery is performed in the graph topology data set based on the supervision of the supervision data and the initialized group labels;
[0029] Synchronizing the results of the group discovery to an online storage database;
[0030] If a query data set comprising a plurality of nodes submitted by a user is received, the online storage database is queried for groups to which at least some of the plurality of nodes belong, and the user is responded to according to the query result.
[0031] The at least one technical solution adopted in one or more embodiments of this specification can achieve the following beneficial effects:
[0032] By performing offline calculations on the relevant data of the nodes, we obtain the prior knowledge of the groups of some nodes, and then use the group labels determined by the prior knowledge as supervisory data for group discovery. This allows us to integrate prior knowledge into the group discovery process, and based on the reliability of prior knowledge, we solve the problem of the current group discovery method, where query results lack interpretability due to weak relationships between nodes, thereby greatly improving the interpretability of the group. The group discovery process based on partial supervisory data also improves the accuracy of the query. In addition, by obtaining the prior knowledge of the group, setting the group labels, and obtaining the results of the group discovery through offline calculations, the time-consuming online group analysis process is all based on offline calculations. Online queries only require simple queries based on the data synchronized with offline calculations to obtain query results, which greatly shortens the query delay and ensures the efficiency of the query. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0034] Figure 1 A schematic diagram of a group query method provided in one or more embodiments of this specification;
[0035] Figure 2 A schematic diagram of query results for an online group query in an application scenario provided by one or more embodiments of this specification;
[0036] Figure 3 A schematic diagram of a group query process based on offline pre-calculated associated parties in an application scenario provided for one or more embodiments of this specification;
[0037] Figure 4 A schematic diagram of group division based on business experience in an application scenario provided for one or more embodiments of this specification;
[0038] Figure 5 A schematic diagram of a user uploading node in an application scenario provided for one or more embodiments of this specification;
[0039] Figure 6 A schematic diagram of a group query result returned in an application scenario provided in one or more embodiments of this specification;
[0040] Figure 7 A schematic diagram of a system framework of a group query method provided for one or more embodiments of this specification;
[0041] Figure 8 A schematic diagram of a group query response provided for one or more embodiments of this specification;
[0042] Figure 9 A schematic diagram of the internal structure of a group query device in an application scenario provided by one or more embodiments of this specification;
[0043] Figure 10 A schematic diagram of the internal structure of a group query device in an application scenario provided for one or more embodiments of this specification. DETAILED DESCRIPTION
[0044] The embodiments of this specification provide a group query method, apparatus, and device.
[0045] In order to help those skilled in the art better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0046] Figure 1A flow chart of a group query method provided for one or more embodiments of this specification. This method can be applied to different business fields, such as: in the financial field, by querying the enterprise group, the relationship between enterprises can be clarified so as to carry out the next step of business development. At the same time, through group query, the group fraud composed of each node in the group can be identified, fraud mining can be realized, and risk control capabilities can be improved; in the e-commerce field, by querying the customer group, the group relationship between each customer can be clarified, thereby realizing business development and unified push of goods; in the industrial field, the classification management of equipment can be realized through the group composed of master and slave nodes, thereby controlling the orderly operation of the group composed of each device. Therefore, this method can be executed by computing equipment (server) in the corresponding field.
[0047] In one or more embodiments of the present invention, the group tag to which the offline computing node belongs is used to synchronize the offline computing node to the online storage database, and the query results are obtained by querying multiple nodes uploaded by the user through the online storage database, thereby shortening the delay in the query process and supporting multi-node queries.
[0048] In one currently achievable approach, online graph query group queries are based on the query interface provided by the graph database. The graph is traversed from a specified node until the input node is encountered or the traversal depth is reached. At this point, node pairs and association details between any two points are obtained. Through methods such as connected component analysis, the group structure of the nodes can be obtained. The query results are as follows: Figure 2 As shown. This method does not require additional storage to process the underlying basic relationship data, but is limited by the complexity of the graph and query performance. This method cannot support queries with more nodes. In practical applications, such as when mobile banking needs to conduct risk assessments on enterprises, a large number of nodes need to be analyzed to avoid the problem of group fraud. In addition, since paths between nodes do not necessarily constitute a group, this method lacks interpretability. In addition, group queries based on offline pre-calculated related parties, such as Figure 3The figure shows a schematic diagram of a group query process based on offline pre-calculation of related parties in an application scenario provided by an embodiment of this specification. As can be seen from the figure, this method can produce a related table in offline pre-calculation, and then import it into online storage. When a query request comes, a node pair is constructed to query the related table, and an undirected graph or a directed graph is constructed based on the returned results to perform real-time group analysis. This method can, to a certain extent, solve the problem that the query performance of online graph queries does not meet the requirements when the distance between nodes is far, but additional storage is required to store related parties. When the number of nodes to be queried exceeds 100, the query performance will drop significantly, and the number of valid node pairs returned by the query will also affect the performance of real-time graph analysis. In actual applications, for example, when it is necessary to analyze the equity penetration situation in an enterprise group, the performance requirements for query performance and real-time graph analysis will be higher. At this time, the method based on offline pre-calculation of related parties cannot meet the query performance requirements. This solution is also committed to solving the problems existing in the above-mentioned method and provides a group query solution that can guarantee query performance.
[0049] Figure 1 The process in may include the following steps:
[0050] S101: Obtain node-related data for offline calculation, wherein the offline calculation includes: a priori step, a setting step, and a discovery step.
[0051] A group is generally composed of nodes that are closely connected in the relationship network, such as Figure 2 As shown, a group is obtained by a query method of group query based on online graph query in an application scenario provided by an embodiment of the present application. When 10 nodes N1-N10 are input, it can be seen from the figure that there is a path between N1 and {N3, N4}, there is a path between N2 and N4, and {N1, N2, N3, N4} are in a connected component, which constitute a group called Group 1. There is a path between N7 and {N5, N6}, there is a path between N5 and N6, and {N5, N6, N7} are in a connected component, which constitute Group 2. There is a path between N8 and N9, which constitute Group 3 in the same connected component, and there is no relationship between N10 and other nodes, which is an isolated point. At present, the query performance is weak when querying groups based on online graph query. When facing the massive node query caused by the rapid development of current science and technology, the query takes a long time, and it is not suitable for group query of multiple nodes.
[0052] In order to improve the efficiency of the query and avoid the problem of being unable to support more node queries based only on online queries, the embodiments of this specification first obtain the relevant data of the node for offline calculation. The way to obtain the relevant data of the node can be obtained in different ways based on the problems that need to be solved in different fields. For example, the relevant data of the node can be obtained based on the historical data determined in the historical query process, and the data disclosed by the enterprise based on the Internet or data acquisition is used as the relevant data of the node. Therefore, here, the specific method of obtaining the relevant data of the node is not specifically limited. It should be noted that the offline calculation includes a priori steps, setting steps, and discovery steps, so as to obtain the group label to which the node belongs through offline pre-calculation. By moving the time-consuming group analysis algorithm to the offline calculation part, the query delay is greatly shortened and the efficiency of the query is improved.
[0053] S102: In the prior step, a priori knowledge of a group of nodes in a graph topology data set is obtained.
[0054] Based on the group query method of online graph query recorded in the above process, it can be seen that the groups determined by this method may not constitute a group because some nodes have paths but the relationship may be weak, which makes the current query results lack interpretability. In order to improve the reliability of group query results, one or more embodiments of this specification can be based on business experience in different application fields, or based on the annotated data returned from online storage databases, etc., to more clearly and simply divide the group label information as group prior knowledge, thereby obtaining a part of the group prior knowledge in the graph data set. For example, Figure 4 The figure shows a schematic diagram of group division based on business experience in an application scenario. In the enterprise graph scenario, the actual controller of the enterprise is mined based on equity penetration. If the actual controller 1 is the actual controlling shareholder of enterprise nodes N1_1 to enterprise nodes N1_m, then the actual controller is the core node of the group and is divided into the same group with enterprise nodes N1_1 to enterprise nodes N1_m and has the same group label.
[0055] S103: In the setting step, according to the prior knowledge of the group, the group labels of each of the nodes are set as supervision data, and the group labels of the remaining nodes are initialized.
[0056] After obtaining the group prior knowledge of a part of the nodes based on the above step S102, since the number of nodes in the graph topology data set is too large, the group prior knowledge can only determine the group labels corresponding to a part of the nodes in the graph topology data set. For example: the group prior knowledge is: subsidiaries in different regions with the same name belong to the same group, then the group prior knowledge can only realize the group division of a part of the enterprise nodes, and cannot divide all the enterprise nodes with other relationships into the group. Since the reliability of the remaining nodes cannot be determined when group queries are only performed on the remaining nodes that are not based on group prior knowledge, the reliability of the query results of the group query is low. Therefore, in order to improve the accuracy of the group query, the method also includes: setting the group labels of a part of the nodes as supervision data through the prior knowledge of the group, and initializing the group labels of the remaining nodes. It should be noted that initializing the group labels of the remaining nodes specifically includes the following steps:
[0057] First, determine whether each remaining node has a group label. If it does not have a group label, obtain the node identifier of the remaining node and use the node identifier of the remaining node as the group label of the remaining node. For example, if the remaining node does not have a group label, if the obtained node identifier is node A, then the group label of the remaining node is recorded as Group A; if the obtained node identifier is node B, then the group label of the remaining node is recorded as Group B.
[0058] S104: In the discovery step, group discovery is performed in the graph topology data set based on the supervision of the supervision data and the initialized group labels.
[0059] To improve the accuracy of group discovery, the group labels of a subset of nodes determined in the previous steps are used as supervisory data to supervise the group discovery algorithm. This supervised data and the initialized group labels are used to perform group discovery within the graph topology dataset. By incorporating this supervised data into the algorithm's iterative optimization process, query performance and effectiveness can be continuously improved.
[0060] S105: Synchronize the group discovery result to an online storage database.
[0061] After the offline calculation based on the above steps S101 - S104 , the query results obtained by the offline calculation are synchronized to the online storage database, so that the online storage database can obtain the group query results based on simple query and clustering.
[0062] S106: If a query data set comprising a plurality of nodes submitted by a user is received, the online storage database is searched for groups to which at least some of the plurality of nodes belong, and the user is responded to according to the query result.
[0063] like Figure 5 As shown, it is a schematic diagram of a user uploading nodes in an application scenario provided by an embodiment of this specification. As can be seen from the figure, the user can manually enter the names of multiple nodes, such as: enter "A Project Management Co., Ltd.", "G Venture Capital Partnership", "C Group Property Insurance Co., Ltd.", etc., and then query in the online storage database whether the input nodes can form a group. Or batch upload multiple nodes based on a template to query the uploaded multiple nodes. If the computing device receives a query data set submitted by the user, it can query at least part of the multiple nodes only through the online storage database, and then respond to the user in a suitable data format based on the query results. As Figure 6 The following is a schematic diagram of the return of a group query in an application scenario, provided by an embodiment of this specification. After responding to the client based on the query results, the results are presented to the user in the form of a graph topology. It should be noted that the query results in at least some of the multiple nodes are obtained because offline pre-calculation periodically obtains data returned from the online storage database. Due to the rapid update speed of node-related data in certain application areas, the update speed of offline pre-calculation may not be able to fully cover the nodes to be queried. Therefore, the groups to which at least some of the nodes belong can be obtained.
[0064] based on Figure 1 This specification also provides some specific implementation plans and extension plans of the method, which will be described below.
[0065] In one or more embodiments of this specification, in order to integrate group prior knowledge into the group discovery process to iteratively optimize the algorithm and continuously improve the effectiveness of group discovery, it is necessary to first determine the group prior knowledge. Therefore, obtaining the group prior knowledge of a portion of nodes in the graph topology data set specifically includes the following steps:
[0066] Obtain the business experience corresponding to each node in the graph topology dataset and the annotated data returned from the online storage database. Then, based on this business experience and annotated data, determine the grouping prior knowledge of a portion of the nodes in the graph topology dataset. For example, the relationships between the heads of various companies in the enterprise graph can be used to determine that companies with the same head are grouped together.
[0067] Because only a portion of the nodes in the offline pre-calculation setup step have corresponding reliable group labels determined based on prior knowledge, the group labels obtained by the remaining nodes after initialization may be a default node label based on the node identifier or a corresponding group label in historical related data. The reliability of the group labels of these remaining nodes is relatively low. Therefore, in order to improve the accuracy of the group information obtained by querying each node in the entire graph topology data set, in one or more embodiments of this specification, supervision data and initialized group labels are required to perform group discovery in the graph topology data set together, specifically including the following steps:
[0068] First, for each designated node in the graph topology dataset, the group labels sent by its neighboring nodes are received. Then, based on the supervision data, the group labels sent by the neighboring nodes are updated. The updated group label of the designated node is sent to the neighboring nodes to decide whether to update their group labels. These steps are iterated until convergence is reached, and nodes with the same group label are grouped together.
[0069] In one or more embodiments of this specification, when performing group discovery in a graph topology data set based on supervision data and initialized group labels, group prior knowledge is integrated into unsupervised group discovery algorithms such as label propagation algorithms or hierarchical clustering.
[0070] For example, in the 0th iteration, the group label label is sent to its neighbor nodes. Then the entire graph topology data set is loaded to calculate the 1st to Sth iterations. The corresponding program is:
[0071] “For i=1:S:”;
[0072] All nodes j in the graph topology data set are calculated synchronously. If the stopping condition is reached during the calculation process, it can be terminated early. The corresponding program of this process is as follows:
[0073] "msgs_j=get_msg_from_neighbors(j)";
[0074] Update the group labels in the neighbor node list corresponding to node j according to the obtained group labels msgs_j of each neighbor node. The corresponding program of this process is as follows:
[0075] "group_j=update_group(msgs_j)";
[0076] The updated group label is obtained by sampling the group label sent by the neighbor node according to probability (the probability determination strategy can be specified in advance) and sent to the neighbor node. The corresponding program of this process is as follows:
[0077] "label=sample(group_j)
[0078] send_msg_to_neighbors(label)".
[0079] Furthermore, since the supervision data is determined based on prior knowledge of the group, for example, the group label of nodes A and B is determined to be group A based on equity penetration. The group label determined based on the prior knowledge of the group is highly reliable, while the group labels of the remaining nodes determined based on initialization have no corresponding support and are less reliable. To ensure the accuracy of the query results, in one or more embodiments of this specification, based on the supervision of the supervision data, the group label of the specified node is updated according to the group labels sent by the neighboring nodes, specifically including the following steps:
[0080] First, determine whether the group labels sent by each neighboring node to the designated node are the same. If they are the same, then update the group label of the designated node. For example, if the group label of designated node A is Group A, and the group labels of neighboring nodes B, C, D, and E are all Group B, then the group label of designated node A is updated to Group B.
[0081] If the group labels of each neighboring node are different, and the group labels sent by the neighboring nodes include a group label belonging to the supervisory data, then due to the high reliability of the supervisory data, there is at least a partial probability that the probability of the specified node belonging to the group label of the supervisory data will be increased. The group label of the specified node needs to be updated based on the selection probability of the group labels sent by each of the neighboring nodes determined according to a predetermined rule. For example, if the selection probability is determined to be 80%, the group label of the specified node can be updated when the probability of the neighboring nodes belonging to the same group label reaches 80%. If a group label belonging to the supervisory data is included in the group label, the selection probability is increased.
[0082] Furthermore, since the supervisory data may contain remaining nodes that are updated as supervisory data based on the group labels in the neighboring nodes during the iteration process, if the current supervisory data is initially obtained based on a node farther away from the node and then updated successively, then the reliability of the supervisory data is low at this time, and even affects the accuracy of the query results. For example: based on the node determined as supervisory data in the above step S103 is node A, that is, node A is the initial supervisory data. After multiple iterations of group discovery, the nodes with supervisory data at this time may be node A->node B->node C->node D...node N, and their depth exceeds the preset threshold, making the supervisory data at this time unreliable or even misplaced. In order to improve the accuracy of the group discovery step and solve the above problems, in one or more embodiments of the present specification, according to the prior knowledge of the group, the group labels of each part of the nodes are set as supervisory data, and the following steps are also included:
[0083] First, set a native tag for the group label of each part of the nodes as the supervision data, and associate the native tag with this part of the nodes. For example, if this part of the nodes is node A, node B, and node C, then the native tag and node A, node B, and node C are identified at this time, so that subsequent calculations can clearly identify the group labels corresponding to these three nodes as native data.
[0084] Furthermore, to improve the accuracy of group discovery and avoid the problem of excessive iteration depth reducing the reliability of supervision data and thus affecting the reliability of group queries, in one or more embodiments of this specification, at least partially increasing the probability of selecting a group label belonging to the supervision data specifically includes the following steps:
[0085] Determine whether the neighbor node corresponding to the group label belonging to the supervision data is associated with a native label. If there is no label, it means that the group label of the corresponding neighbor node belonging to the supervision data is obtained from other nodes after iterative update, and its reliability is unclear. Therefore, it is necessary to determine the update traceability path of the corresponding neighbor node to obtain this group label from a part of the nodes. According to the negative correlation set with the length of the update traceability path, at least the selection probability of the group label is increased. It should be noted that the negative correlation means that the longer the update traceability path, the lower the reliability of the supervision data of the corresponding neighbor node. Then the longer the corresponding update traceability path, the lower the probability of selecting the group label will be. Therefore, there is a negative correlation between the length of the update traceability path and the at least partial increase in the probability of selecting the group label.
[0086] Furthermore, since each node may obtain the same group label over a period of time during iteration, causing the node to reach a stopping condition, if neighboring nodes continue to send group labels to the node, it is necessary to determine whether it is necessary to update the group label. Therefore, in order to reduce memory consumption for iterative calculations, in one or more embodiments of this specification, for each specified node in the graph topology data set, after receiving the group label sent by its neighboring nodes, the method further includes the following steps:
[0087] First, obtain the update status of the specified node for N consecutive rounds during the iterative execution, where it can be understood that N is a set value not less than 1. If the specified node is in a non-updated state during N consecutive rounds of iteration, and the group label of the currently received neighboring node does not contain a group label belonging to the supervisory data, then it means that the group label of the neighboring node at this time may still be the group label at the time of initialization, and if the specified node is already the supervisory data, then updating the group label of the specified node at this time will affect the reliability of group discovery. Therefore, the specified node is not updated at this time. And / or if the specified node is in a non-updated state for N consecutive rounds, and the group label of the currently received neighboring node contains a group label belonging to the supervisory data, then it can be determined whether the specified node needs to be updated based on the ratio of the group label in the supervisory data and the group label of the neighboring node to the preset update ratio. This avoids the impact of unnecessary updates on group discovery, and at the same time saves memory consumption in the offline calculation process by saving the iterative calculation process.
[0088] In order to facilitate rapid acquisition of relevant group query results from the online storage database, in one or more embodiments of this specification, synchronizing the group discovery results to the online storage database specifically includes the following steps:
[0089] First, a query identifier for the result is constructed based on the node identifiers of each node in the result. This construction process can be based on merging and concatenating the node identifiers of each node. The query identifier and the result are then stored offline based on the preset storage structure of the online storage database to support offline computing.
[0090] During the offline pre-computation process, since errors may occur in the offline algorithm and the update of relevant data of the nodes in the offline pre-computation may not be timely, in order to timely correct errors in the group query results obtained by the offline pre-computation and obtain the groups to which at least some of the nodes belong, in one or more embodiments of this specification, querying the online storage database for the groups to which at least some of the nodes belong specifically includes:
[0091] During the query process, group management can be directly integrated into the product for rapid error correction and accumulation of labeled data for the algorithm. Group management is performed during the query process to determine the labeled data and error correction data for offline calculation based on group management. It should be noted that the labeled data can flow back to the prior step of offline calculation based on the online storage database, thereby updating the group labels of a portion of nodes in the graph topology data set as group prior knowledge. Based on the node identifiers of multiple nodes, a query identifier list of the query data set can be constructed. Thus, based on the query identifier list, a query is performed from the online storage database to obtain at least some of the nodes in the online storage database corresponding to each query identifier in the query identifier list, and the group labels of at least some of the nodes are determined. The group labels of at least some of the nodes are corrected based on the error correction data of the group management to obtain the groups to which at least some of the multiple nodes belong after error correction.
[0092] Furthermore, the group management function is directly integrated into the product, which can quickly optimize existing errors or supplement undiscovered groups. In order to correct the group query results and improve the accuracy of group queries, in one or more embodiments of this specification, the group labels of at least some nodes are corrected based on the error correction data to obtain the groups to which at least some of the multiple nodes belong, specifically including the following steps:
[0093] First, group information for at least some of the nodes is obtained. It should be noted that the group information includes the node's group label and the node's associated path. If, after verifying the groups stored in the online storage database based on the error correction data, it is determined that the group information for at least some of the nodes contains errors, a designated group label corresponding to the at least some of the nodes in the error correction data is obtained, the group label for the at least some of the nodes is set to the designated group label in the error correction data, and the associated path for the at least some of the nodes is updated.
[0094] In one embodiment, the error correction data in the group management can add and delete groups identified by the algorithm. For example, the offline pre-calculation process divides the enterprise node N1 into group A. If the association details between the enterprise node N1 and the group are verified and an error is found in the offline pre-calculation process, the group information of the enterprise node N1 can be corrected on the management page. For example, the group label can be set to B and the corresponding association path can be updated at the same time. When it comes to adding, merging, and deleting groups, the relevant group information in the group information table can be directly updated. The following Table 1 is a user group table for an application scenario provided by one or more embodiments of this specification. Figure 2This table shows a group information table for an application scenario provided by one or more embodiments of this specification. For example, if error correction data reveals an error with node N3, the group label for node N3 in Table 1 can be modified. If groups need to be deleted, added, or merged, the corresponding information in Table 2 can be directly updated. For example, if group A needs to be deleted, the table corresponding to group A can be deleted.
[0095] Table 1. User group table in an application scenario
[0096]
[0097] Table 2. Group information table in an application scenario
[0098]
[0099]
[0100] like Figure 7 The figure shows a schematic diagram of a system framework of a group query method provided by one or more embodiments of this specification. Figure 7 It can be seen that the overall process of group query is:
[0101] The offline storage layer stores the original relational data and the annotated data returned from the online storage database. The algorithm layer obtains the data in the offline storage layer and obtains the group query results based on offline pre-calculation, and periodically synchronizes them to the online storage database. The online storage database is used to store the groups described by the nodes and the detailed information of the groups. The online storage database can be a graph database or a semi-structured storage database. In a certain scenario, the online storage database can return the group information corresponding to N query identifiers at a time. When the user uploads multiple nodes, they are uploaded through the same response interface so that the online storage database can obtain the results of the group query based on simple query and clustering. Figure 8 The figure shows a schematic diagram of the return results of a group query provided in this specification. It can be seen that when the user inputs N nodes, it is only necessary to query the group information of the nodes in the online storage database and cluster them based on the groups to obtain the group query results. In this solution, by pre-calculating the group information to which the nodes belong offline, the online group analysis algorithm that is more time-consuming is moved to the offline part, so that online queries only need to perform simple queries and clustering to obtain group query results, which greatly shortens the query delay and can support queries of up to 1000+ input nodes. The group discovery algorithm that integrates group management and prior knowledge of the group is used to iteratively identify the group, which greatly improves the interpretability of the group.
[0102] Based on the same idea, one or more embodiments of this specification also provide devices and apparatuses corresponding to the above methods, such as Figure 9 、 Figure 10 shown.
[0103] Figure 9 This is a schematic diagram of the structure of a group query device provided in one or more embodiments of this specification, the device comprising:
[0104] Acquisition unit 901, prior unit 902, setting unit 903, discovery unit 904, synchronization unit 905, query unit 906;
[0105] The acquisition unit 901 is used to acquire node-related data for offline calculation, and the offline calculation includes: a priori step, a setting step, and a discovery step;
[0106] The a priori unit 902 is used to obtain a priori knowledge of a group of nodes in the graph topology data set in the a priori step;
[0107] The setting unit 903 is configured to set, in the setting step, the group labels of the nodes according to the prior knowledge of the group as supervision data, and initialize the group labels of the remaining nodes;
[0108] The discovery unit 904 is configured to perform group discovery in the graph topology data set based on the supervision of the supervision data and the initialized group labels in the discovery step;
[0109] The synchronization unit 905 is used to synchronize the group discovery result to an online storage database;
[0110] The query unit 906 is configured to, upon receiving a query data set comprising multiple nodes submitted by a user, query the online storage database for groups to which at least some of the multiple nodes belong, and respond to the user according to the query result.
[0111] Optionally, in one or more embodiments of the present specification, the setting unit determines whether each remaining node has a group label, and if not, obtains a node identifier of the remaining node and uses the node identifier as the group label of the remaining node.
[0112] Optionally, in one or more embodiments of this specification, the discovery unit specifically includes: a receiving unit, a first updating unit, a sending unit, and an iterating unit;
[0113] The receiving unit is configured to receive, for each designated node in the graph topology data set, a group label sent by its neighboring nodes;
[0114] The first updating unit is configured to update the group label of the designated node according to the group label sent by the neighboring node based on the supervision of the supervision data;
[0115] The sending unit is configured to send the updated group label of the designated node to the neighboring node so as to decide whether to update the group label of the neighboring node;
[0116] The iterative unit is used to iteratively execute the above steps until a predetermined convergence target is reached, and divide the nodes with the same group label into the same group.
[0117] Optionally, in one or more embodiments of this specification, the updating unit specifically includes: a first judging unit, a determining unit, and a second determining unit;
[0118] The first judging unit is configured to judge whether the group labels sent by the neighboring nodes are the same;
[0119] The determining unit is configured to, if they are not the same, at least partially increase the probability of selecting the group label belonging to the supervisory data if the group labels sent by the neighboring nodes include a group label belonging to the supervisory data;
[0120] The second determining unit is configured to update the group label of the designated node according to a selection probability of the group label sent by each of the neighboring nodes determined according to a predetermined rule.
[0121] Optionally, in one or more embodiments of this specification, the setting unit is further configured to:
[0122] Setting a native tag for the group label of each of the part of nodes as supervision data, and associating the native tags with the part of nodes;
[0123] The determination unit specifically includes: a second determination unit, a third determination unit, and a probability improvement unit;
[0124] The second judgment unit is used to judge whether the neighbor node corresponding to the group label belonging to the supervision data is associated with the native label;
[0125] The third determining unit is configured to, if no, determine an update tracing path for the group label obtained by the corresponding neighbor node from the part of nodes;
[0126] The probability increasing unit is configured to at least partially increase the selection probability of the group label according to a negative correlation set between the probability increasing unit and the length of the update tracing path.
[0127] Optionally, in one or more embodiments of this specification, the apparatus further includes: a state acquiring unit, a fourth determining unit;
[0128] The state acquisition unit is used to acquire the update state of the designated node for N consecutive rounds in the iterative execution, where N is a set value not less than 1;
[0129] The fourth determination unit is configured to: if the designated node is in a no-update state for N consecutive rounds and the group label of the neighboring node currently received does not include the group label in the supervision data, then not update the designated node; and / or if the designated node is in a no-update state for N consecutive rounds and the group label of the neighboring node currently received does include the group label in the supervision data, then determine whether to update the designated node based on the ratio of the group label in the supervision data to the group label of the neighboring node and a preset update ratio.
[0130] Optionally, in one or more embodiments of this specification, the a priori unit specifically includes: a data acquisition unit, a fifth determination unit;
[0131] The data acquisition unit is used to acquire the business experience corresponding to each node in the graph topology data set and the annotation data returned from the online storage database;
[0132] The fifth determining unit is configured to determine group prior knowledge of a portion of nodes in the graph topology data set based on the business experience and the annotation data.
[0133] Optionally, in one or more embodiments of this specification, the synchronization unit specifically includes: a construction unit, a storage unit;
[0134] The construction unit is configured to construct a query identifier of the result according to the node identifier of each node in the result;
[0135] The storage unit is used to store the query identifier and the result offline based on the preset storage structure of the online storage database to support the offline calculation.
[0136] Optionally, in one or more embodiments of this specification, the query unit specifically includes: a management unit, a construction unit, a label query unit, and an error correction unit;
[0137] The management unit is configured to perform group management during the query process, and determine the labeling data and error correction data for the offline calculation based on the group management; wherein the labeling data is returned to the prior step of the offline calculation based on the online storage database to update the group prior knowledge of a portion of the nodes in the graph topology data set;
[0138] The construction unit is configured to construct a query identifier list of the query data set according to the node identifiers of the plurality of nodes;
[0139] The label query unit is configured to query the online storage database based on the query identifier list, obtain the at least some nodes in the online storage database corresponding to each query identifier in the query identifier list, and determine the group label of the at least some nodes;
[0140] The error correction unit is configured to correct the group labels of at least some of the nodes based on the error correction data, so as to obtain the groups to which at least some of the multiple nodes belong.
[0141] Optionally, in one or more embodiments of this specification, the error correction unit specifically includes: an information acquisition unit, a setting unit;
[0142] The information acquisition unit is configured to acquire group information of at least some of the nodes; wherein the group information includes: group labels of the nodes and associated paths of the nodes;
[0143] The setting unit is used to obtain the specified group label corresponding to the at least part of the nodes in the error correction data if it is determined based on the error correction data that the group information of the at least part of the nodes is erroneous, set the group label of the at least part of the nodes to the specified group label, and update the associated path of the at least part of the nodes.
[0144] Figure 10 This is a schematic diagram of the structure of a group query device provided in one or more embodiments of this specification, the device including:
[0145] at least one processor; and,
[0146] a memory communicatively connected to the at least one processor; wherein,
[0147] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0148] Obtaining node-related data for offline calculation, the offline calculation includes: a priori step, a setting step, and a discovery step;
[0149] In the prior step, a priori knowledge of a group of nodes in the graph topology data set is obtained;
[0150] In the setting step, according to the prior knowledge of the group, the group labels of each of the part of nodes are set as supervision data, and the group labels of each of the remaining nodes are initialized;
[0151] In the discovery step, group discovery is performed in the graph topology data set based on the supervision of the supervision data and the initialized group labels;
[0152] Synchronizing the results of the group discovery to an online storage database;
[0153] If a query data set comprising a plurality of nodes submitted by a user is received, the online storage database is queried for groups to which at least some of the plurality of nodes belong, and the user is responded to according to the query result.
[0154] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0155] The various embodiments in this specification are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the device, apparatus, and non-volatile computer storage medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simplified. For relevant details, refer to the descriptions of the method embodiments.
[0156] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0157] The foregoing description is merely one or more embodiments of this specification and is not intended to limit this specification. It will be apparent to those skilled in the art that various modifications and variations may be made to one or more embodiments of this specification. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of one or more embodiments of this specification are intended to be within the scope of the claims of this specification.
Claims
1. A group query method, comprising: Obtaining node-related data for offline calculation, the offline calculation includes: a priori step, a setting step, and a discovery step; In the prior step, a priori knowledge of a group of nodes in the graph topology data set is obtained; In the setting step, according to the prior knowledge of the group, the group labels of each of the part of nodes are set as supervision data, and the group labels of each of the remaining nodes are initialized; In the discovery step, group discovery is performed in the graph topology data set based on the supervision of the supervision data and the initialized group labels, specifically including: for each designated node in the graph topology data set, receiving the group label sent by its neighboring nodes; based on the supervision of the supervision data, updating the group label of the designated node according to the group label sent by the neighboring nodes; sending the updated group label of the designated node to the neighboring nodes so as to decide whether to update the group label of the neighboring nodes; by iteratively executing the above steps until a predetermined convergence target is reached, dividing the nodes with the same group label into the same group; Synchronizing the results of the group discovery to an online storage database, specifically comprising: constructing a query identifier for the results based on the node identifier of each node in the results; and storing the query identifier and the results offline based on a preset storage structure of the online storage database to support the offline calculation; If a query data set comprising a plurality of nodes submitted by a user is received, the online storage database is queried for groups to which at least some of the plurality of nodes belong, and the user is responded to according to the query result.
2. The method according to claim 1, wherein initializing the group labels of the remaining nodes comprises: Determine whether each remaining node has a group label. If not, obtain a node identifier of the remaining node and use the node identifier as the group label of the remaining node.
3. The method according to claim 1, wherein the supervision based on the supervision data and updating the group label of the designated node according to the group label sent by the neighboring node specifically comprises: Determining whether the group labels sent by the neighboring nodes are the same; If they are not the same, and the group label sent by the neighboring node includes a group label belonging to the supervisory data, at least partially increasing the probability of selecting the group label belonging to the supervisory data; The group label of the designated node is updated according to the selection probability of the group label sent by each of the neighboring nodes determined according to a predetermined rule.
4. The method according to claim 3, wherein the step of setting a group label for each of the plurality of nodes as supervisory data based on the group prior knowledge further comprises: Setting a native tag for the group label of each of the part of nodes as supervision data, and associating the native tags with the part of nodes; The at least partially increasing the selection probability of the group label belonging to the supervision data specifically includes: Determining whether a neighbor node corresponding to the group label belonging to the supervision data is associated with the native label; If not, determining an update tracing path for the group label obtained by the corresponding neighbor node from the part of nodes; According to the negative correlation set with the length of the update tracing path, the selection probability of the group label is at least partially improved.
5. The method according to claim 1, wherein after receiving the group label sent by the neighboring nodes of each designated node in the graph topology data set, the method further comprises: Obtaining the update status of the specified node for N consecutive rounds in the iterative execution, where N is a set value not less than 1; If the designated node is in a no-update state for N consecutive rounds, and the group label of the neighboring node currently received does not include the group label in the supervision data, the designated node is not updated, and / or if the designated node is in a no-update state for N consecutive rounds, and the group label of the neighboring node currently received does include the group label in the supervision data, then based on the ratio of the group label in the supervision data to the group label of the neighboring node and a preset update ratio, it is determined whether to update the designated node.
6. The method according to claim 1, wherein obtaining group prior knowledge of a portion of nodes in a graph topology data set comprises: Obtaining business experience corresponding to each of the nodes in the graph topology data set and the annotation data returned from the online storage database; According to the business experience and the annotated data, group prior knowledge of a portion of nodes in the graph topology data set is determined.
7. The method according to claim 1, wherein querying the online storage database to which groups at least some of the multiple nodes belong comprises: Performing group management during the query process to determine the labeling data and error correction data for the offline calculation based on the group management; wherein the labeling data is returned to the prior step of the offline calculation based on the online storage database to update the group prior knowledge of a portion of the nodes in the graph topology data set; constructing a query identifier list of the query data set according to the node identifiers of the multiple nodes; Searching the online storage database based on the query identifier list to obtain at least some of the nodes in the online storage database corresponding to each query identifier in the query identifier list, and determining group labels for the at least some of the nodes; Errors of the group labels of at least some of the nodes are corrected based on the error correction data to obtain the groups to which at least some of the multiple nodes belong.
8. The method according to claim 7, wherein the step of correcting the group labels of at least some of the nodes based on the error correction data to obtain the groups to which at least some of the plurality of nodes belong comprises: Acquire group information of at least some of the nodes; wherein the group information includes: group labels of the nodes and associated paths of the nodes; If it is determined based on the error correction data that there is an error in the group information of at least part of the nodes, the specified group label corresponding to the at least part of the nodes in the error correction data is obtained, the group label of the at least part of the nodes is set to the specified group label, and the associated path of the at least part of the nodes is updated.
9. A group query device, comprising: Acquisition unit, prior unit, setting unit, discovery unit, synchronization unit, query unit; The acquisition unit is used to acquire node-related data for offline calculation, and the offline calculation includes: a priori step, a setting step, and a discovery step; The a priori unit is used to obtain group a priori knowledge of a part of nodes in the graph topology data set in the a priori step; The setting unit is configured to set, in the setting step, the group labels of each of the part of nodes according to the group prior knowledge as supervision data, and initialize the group labels of the remaining nodes; The discovery unit is configured to perform group discovery in the graph topology data set based on the supervision of the supervision data and the initialized group labels in the discovery step; The synchronization unit is used to synchronize the result of the group discovery to an online storage database; The query unit is configured to, upon receiving a query data set comprising a plurality of nodes submitted by a user, query the online storage database for groups to which at least some of the plurality of nodes belong, and respond to the user according to a result of the query; The discovery unit specifically includes: a receiving unit, a first updating unit, a sending unit, and an iterating unit; The receiving unit is configured to receive, for each designated node in the graph topology data set, a group label sent by its neighboring nodes; The first updating unit is configured to update the group label of the designated node according to the group label sent by the neighboring node based on the supervision of the supervision data; The sending unit is configured to send the updated group label of the designated node to the neighboring node so as to decide whether to update the group label of the neighboring node; The iterative unit is configured to iteratively execute the above steps until a predetermined convergence target is reached, and divide the nodes with the same group label into the same group; The synchronization unit specifically includes: a construction unit and a storage unit; The construction unit is configured to construct a query identifier of the result according to the node identifier of each node in the result; The storage unit is used to store the query identifier and the result offline based on the preset storage structure of the online storage database to support the offline calculation.
10. The apparatus according to claim 9, wherein the setting unit determines whether each remaining node has a group label, and if not, obtains a node identifier of the remaining node and uses the node identifier as the group label of the remaining node.
11. The apparatus according to claim 9, wherein the updating unit specifically comprises: a first judging unit, a determination unit, and a second determining unit; The first judging unit is configured to judge whether the group labels sent by the neighboring nodes are the same; The determining unit is configured to, if they are not the same, at least partially increase the probability of selecting the group label belonging to the supervisory data if the group labels sent by the neighboring nodes include a group label belonging to the supervisory data; The second determining unit is configured to update the group label of the designated node according to a selection probability of the group label sent by each of the neighboring nodes determined according to a predetermined rule.
12. The apparatus according to claim 11, wherein the setting unit is further configured to: Setting a native tag for the group label of each of the part of nodes as supervision data, and associating the native tags with the part of nodes; The determination unit specifically includes: a second determination unit, a third determination unit, and a probability improvement unit; The second judgment unit is used to judge whether the neighbor node corresponding to the group label belonging to the supervision data is associated with the native label; The third determining unit is configured to, if no, determine an update tracing path for the group label obtained by the corresponding neighbor node from the part of nodes; The probability increasing unit is configured to at least partially increase the selection probability of the group label according to a negative correlation set between the probability increasing unit and the length of the update tracing path.
13. The apparatus of claim 9, further comprising: a state acquiring unit and a fourth determining unit; The state acquisition unit is used to acquire the update state of the designated node for N consecutive rounds in the iterative execution, where N is a set value not less than 1; The fourth determination unit is configured to: not update the designated node if the designated node is in a no-update state for the N consecutive rounds and the group label of the neighboring node currently received does not include the group label in the supervision data; and / or determine whether to update the designated node based on a ratio of the group label in the supervision data to the group label of the neighboring node and a preset update ratio if the designated node is in a no-update state for the N consecutive rounds and the group label of the neighboring node currently received does include the group label in the supervision data.
14. The apparatus according to claim 9, wherein the a priori unit specifically comprises: a data acquisition unit, a fifth determination unit; The data acquisition unit is used to acquire the business experience corresponding to each node in the graph topology data set and the annotation data returned from the online storage database; The fifth determining unit is configured to determine group prior knowledge of a portion of nodes in the graph topology data set based on the business experience and the annotation data.
15. The apparatus according to claim 9, wherein the query unit specifically comprises: Management unit, construction unit, label query unit, error correction unit; The management unit is configured to perform group management during the query process, and determine the labeling data and error correction data for the offline calculation based on the group management; wherein the labeling data is returned to the prior step of the offline calculation based on the online storage database to update the group prior knowledge of a portion of the nodes in the graph topology data set; The construction unit is configured to construct a query identifier list of the query data set according to the node identifiers of the plurality of nodes; The label query unit is configured to query the online storage database based on the query identifier list, obtain the at least some nodes in the online storage database corresponding to each query identifier in the query identifier list, and determine the group label of the at least some nodes; The error correction unit is configured to correct the group labels of at least some of the nodes based on the error correction data, so as to obtain the groups to which at least some of the multiple nodes belong.
16. The apparatus according to claim 15, wherein the error correction unit specifically comprises: Information acquisition unit, setting unit; The information acquisition unit is configured to acquire group information of at least some of the nodes; wherein the group information includes: group labels of the nodes and associated paths of the nodes; The setting unit is used to obtain the specified group label corresponding to the at least part of the nodes in the error correction data if it is determined based on the error correction data that the group information of the at least part of the nodes is erroneous, set the group label of the at least part of the nodes to the specified group label, and update the associated path of the at least part of the nodes.
17. A group query device, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores executable instructions that can be executed by the at least one processor to enable the at least one processor to: Obtaining node-related data for offline calculation, the offline calculation includes: a priori step, a setting step, and a discovery step; In the prior step, a priori knowledge of a group of nodes in the graph topology data set is obtained; In the setting step, according to the prior knowledge of the group, the group labels of each of the part of nodes are set as supervision data, and the group labels of each of the remaining nodes are initialized; In the discovery step, group discovery is performed in the graph topology data set based on the supervision of the supervision data and the initialized group labels, specifically including: for each designated node in the graph topology data set, receiving the group label sent by its neighboring nodes; based on the supervision of the supervision data, updating the group label of the designated node according to the group label sent by the neighboring nodes; sending the updated group label of the designated node to the neighboring nodes so as to decide whether to update the group label of the neighboring nodes; by iteratively executing the above steps until a predetermined convergence target is reached, dividing the nodes with the same group label into the same group; Synchronizing the results of the group discovery to an online storage database, specifically comprising: constructing a query identifier for the results based on the node identifier of each node in the results; and storing the query identifier and the results offline based on a preset storage structure of the online storage database to support the offline calculation; If a query data set comprising a plurality of nodes submitted by a user is received, the online storage database is queried for groups to which at least some of the plurality of nodes belong, and the user is responded to according to the query result.
Citation Information
Patent Citations
Mobile communication user group construction method on the basis of fraction filtering and label propagation
CN105592405A
Priori knowledge based microblog user group division method
CN105893382A