Method, device, equipment and storage medium for subgraph cut in graph database

By parsing and reconstructing information from subgraphs in a graph database, and using neighborhood information of the central point and the shortest path to determine the cutting point, efficient cutting of subgraphs is achieved, solving the problems of complex and redundant subgraph data and improving data availability.

CN115618037BActive Publication Date: 2025-12-09GREAT WALL MOTOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211102367.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2025-12-09
Estimated Expiration
2042-09-09

AI Technical Summary

Technical Problem

In the prior art, methods, apparatus, devices, and computer-readable storage media for subgraph segmentation exist in graph databases.

Method used

By parsing the information of the subgraphs in the graph database, the visualization center point is reconstructed. The target cutting point is determined based on the neighborhood information and the shortest path of the center point, and the cutting is performed to form independent subgraphs.

Benefits of technology

It effectively solves the problems of complex and redundant subgraph data, and improves data availability and segmentation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115618037B_ABST
    Figure CN115618037B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and equipment for subgraph cutting in a graph database and a storage medium. The method comprises the following steps: firstly, information of a subgraph in a graph database is parsed to obtain information of points and edges in the subgraph; the subgraph is reconstructed by using the information to form a visual center point; then, the center point is classified according to neighborhood information of the center point; a target cutting point is determined according to shortest paths between the classified center points; finally, the reconstructed subgraph is cut through the target cutting point to obtain a cutting result. The application also discloses a device for subgraph cutting in a graph database. In the embodiment of the application, the cutting of a subgraph with a large amount of data and redundant information is completed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of graph database, in particular to a method and device for subgraph cutting in a graph database, equipment and a computer readable storage medium. BACKGROUND

[0002] In recent years, with the vigorous development of the Internet, complex relationship network storage and analysis scenarios are increasing, which generates the demand for analyzing relationship networks. A graph database is a database that uses a graph structure for queries, which is formally a collection of points and edges, a point representing an entity and an edge representing the association between two entities. There are large-scale subgraphs in the graph database, but the data in the subgraph is complex and information is redundant, which is not conducive to further use of the subgraph data. SUMMARY

[0003] Therefore, the embodiments of the present application provide a method and device for subgraph cutting in a graph database, equipment and a computer readable storage medium, which facilitates the use of data in the subgraph through processing by cutting.

[0004] In a first aspect, the embodiments of the present application provide a method for subgraph cutting in a graph database, which comprises:

[0005] analyzing information of a subgraph in the graph database to obtain information of points and edges in the subgraph;

[0006] reconstructing the subgraph using the information of the points and edges in the subgraph to form a visual center point;

[0007] classifying the center point according to neighborhood information of the center point;

[0008] determining a target cutting point according to the shortest path between the classified center points;

[0009] cutting the reconstructed subgraph through the target cutting point to obtain a cutting result.

[0010] Optionally, the neighborhood information of the center point includes the types of entity points in the neighborhood of the center point and the number of entity points of each type; if the center point includes information of a first type, then the classifying the center point according to the neighborhood information of the center point comprises:

[0011] obtaining the number of entity points of a second type in the neighborhood information of the center point;

[0012] if the number of entity points of the second type exceeds a preset threshold, then determining the center point as a group center point;

[0013] If the number of the entity points of the second type does not exceed the preset threshold, the center point is determined as a non-group center point;

[0014] The second type is a type of entity point in a neighborhood of the center point bound with the first type of information, and is used to determine whether the center point is a group center point or a non-group center point.

[0015] Optionally, the target cut point is determined according to the shortest path between the classified center points, and the method comprises the following steps of:

[0016] The target cut point is determined according to the type of the center point, the type of the entity point in the neighborhood of the center point, and the information of the edge on the shortest path.

[0017] Optionally, the reconstructed subgraph is cut through the target cut point, and the method comprises the following steps of:

[0018] It is judged whether there is a shortest path between two classified center points;

[0019] If there is a shortest path, the reconstructed subgraph is cut according to the target cut point on the shortest path;

[0020] After the cutting, it is continuously judged whether there is a shortest path between the two classified center points, if not, the subgraph cutting about the two classified center points in the reconstructed subgraph is completed, and if yes, a new target cut point is continuously determined for the subgraph cutting until there is no shortest path between the two classified center points.

[0021] Optionally, the preset threshold is determined by the following method:

[0022] The types of all entity points in the reconstructed subgraph and the number of entity points of each type in the reconstructed subgraph are counted;

[0023] The preset threshold is determined according to the distribution of the number of entity points of each type in the reconstructed subgraph.

[0024] Optionally, the first type is a mobile phone number, and the second type is a vehicle chassis number bound with the mobile phone number.

[0025] In a second aspect, an embodiment of the present application provides a device for subgraph cutting in a graph database, and the device comprises:

[0026] An information analysis unit is configured to analyze information of a subgraph in a graph database to obtain information of points and edges in the subgraph;

[0027] A graph reconstruction unit is configured to reconstruct the subgraph by using the analyzed information of the points and edges in the subgraph to form a visual center point.

[0028] a classifying unit configured to classify the center points according to neighborhood information of the center points;

[0029] a cut point determining unit configured to determine a target cut point according to a shortest path between the classified center points;

[0030] a cutting unit configured to cut the reconstructed subgraph by the target cut point to obtain a cut result.

[0031] Optionally, the neighborhood information of the center points comprises types of entity points in the neighborhood of the center points and quantities of entity points of each type; if the center points comprise information of a first type, the classifying unit comprises:

[0032] a quantity obtaining subunit configured to obtain a quantity of entity points of a second type in the neighborhood information of the center points;

[0033] a center point classifying subunit configured to determine the center points as group class center points if the quantity of entity points of the second type exceeds a preset threshold, and determine the center points as non-group class center points if the quantity of entity points of the second type does not exceed the preset threshold.

[0034] In a third aspect, an embodiment of the present application provides a device for subgraph cutting in a graph database, and the device comprises:

[0035] a memory configured to store a computer program;

[0036] a processor configured to execute the computer program to implement the method in any one of the first aspect.

[0037] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium for subgraph cutting in a graph database, and the computer readable storage medium comprises:

[0038] The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method in any one of the first aspect.

[0039] The application provides a subgraph cutting method, device and equipment in a graph database and a computer readable storage medium. When the method is executed, information of a subgraph in the graph database is parsed first to obtain information of each point and edge. The parsed information is used to reconstruct the subgraph to form a visual center point. The center point is classified according to a neighborhood condition of the center point. Then, a target cutting point is determined by traversing a shortest path between the center points. The reconstructed subgraph is cut according to the target cutting point to obtain a subgraph with independent and complete center point information after cutting. In this way, the classification of the center point is determined by analyzing the neighborhood condition of the center point, the shortest path between the classified center points is traversed, the target cutting point is determined according to the neighborhood condition, and the subgraph is cut according to the target cutting point, so as to facilitate the subsequent use of data. BRIEF DESCRIPTION OF DRAWINGS

[0040] To make the technical solutions in the embodiments or the prior art clearer, the accompanying drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are only some embodiments of the application, and other accompanying drawings can be obtained by those skilled in the art without any creative effort.

[0041] Figure 1 A flowchart of the subgraph cutting method in the graph database in the application;

[0042] Figure 2 A flowchart of the process of determining the target cutting point in the application;

[0043] Figure 3 A flowchart of the method of cutting the reconstructed subgraph in the application;

[0044] Figure 4 A flowchart of the cutting method of the center point as a device number in the application;

[0045] Figure 5 A structural schematic diagram of the subgraph cutting device in the graph database in the application. DETAILED DESCRIPTION

[0046] In the research on the subgraph in the graph database in the prior art, it is found that in the graph database, the scale of part of the subgraph is very large, there are numerous points of different categories in a subgraph, and numerous points and edges are connected to different points. One point represents an entity (also known as an entity point), and an edge represents an association relationship between two entity points. At present, part of the subgraph has a large scale and integrates information of numerous entities, so the data amount is large and information redundancy is generated, which is not conducive to the subsequent application of data in the subgraph.

[0047] Based on this, the method, device, equipment and computer readable storage medium for subgraph cutting in a graph database are provided in the application, which quickly and efficiently cut the invalid connection in the subgraph, effectively improve the problems of complex and redundant data in the subgraph, and the specific method is:

[0048] First, the information of the subgraph in the graph database is parsed to parse the information of each point and edge, abstract various entities to realize the visualization of the subgraph information, and form different center points. Then, the neighborhood situation of different center points is statistically analyzed, and the center points are classified. The target cutting point is determined according to the shortest path between the classified center points, including traversing the shortest path between different center points to determine the best cutting point, and completing the subgraph cutting. The category of the center point is determined by analyzing the neighborhood situation of the center point, the target cutting point is determined according to the neighborhood situation of the center point, and the subgraph is cut according to the target cutting point to realize the cutting of the subgraph, which is convenient for subsequent use of data.

[0049] Figure 1 A flowchart of a method for subgraph cutting in a graph database. Referring to Figure 1 The method for subgraph cutting in a graph database provided by the application includes:

[0050] Step 101: parsing the information of the subgraph in the graph database to obtain the information of the points and edges in the subgraph.

[0051] The graph database is a data management system based on graph theory, and its composition includes points and edges. Data is represented in the form of points and edges, and data is converted into points, and the relationship between data is converted into edges. As mentioned earlier, the points in the subgraph represent entities, and as an example, these points can be divided into: mobile phone number, ID number, vehicle chassis number, license plate number and equipment number and other types. The edge is a key concept in the graph database and a unique data abstraction concept in the graph database, which represents the relationship between different points.

[0052] The information parsing can be easily realized by using existing database technology for those skilled in the art, for example: the Nebula Graph information parsing can be completed by using the nebula3 library.

[0053] Step 102: reconstructing the subgraph by using the information of the points and edges in the subgraph to form a visual center point.

[0054] The reconstructing subgraph by using the information comprises: abstracting points in the subgraph into various entities. The abstracting into various entities can be understood as judging the entity category corresponding to the node by using the unique corresponding identifier possessed by different points and different edges according to the information of the points and edges parsed from the subgraph. The unique corresponding identifier specifically comprises: different points have unique identifiers corresponding thereto, different edges have a start point and an end point, and the start point of the edge and the end point of the edge have unique identifiers corresponding thereto. The identifier can be generated in a function mapping manner, for example, a mobile phone number can be converted into a fixed-length hash value by using a hash algorithm, so that the mobile phone number has a unique hash value as an identifier, and the identifier can be used to realize fast random access to the relevant information corresponding to the mobile phone number stored.

[0055] The image reconstruction of the subgraph is reconstructing the subgraph into a divergent image with the entity as the center and diverging outward. Such an image can enable a user to more clearly judge the center point. The visual center point can be a mobile phone number, a device number, an ID number, or the like, which has a specific identifier and can be connected to a plurality of identity information. For example, a salesperson logs in to a sales system of a company by using a mobile phone number, and the mobile phone number forms a specific unique identifier in the system. The salesperson contacts a plurality of customers due to the work attribute, and uploads customer information to the sales system which is bound to the mobile phone number in the work process. Thus, a subgraph with the mobile phone number of the salesperson as the center point and associated with the customer information is formed in the graph database.

[0056] Step 103: classifying the center point according to the neighborhood information of the center point.

[0057] The neighborhood information of the center point comprises the types of entity points in the neighborhood of the center point and the number of entity points of each type; if the center point comprises first-type information, the center point is classified according to the neighborhood information of the center point. The first-type of the center point can be a mobile phone number, a device number, or the like. The first-type information can be information associated with a mobile phone number, information associated with a device number, or the like.

[0058] The specific steps of classifying the center point can be:

[0059] acquiring the number of second-type entity points in the neighborhood information of the center point;

[0060] if the number of second-type entity points exceeds a preset threshold, the center point is determined as a group-type center point;

[0061] if the number of second-type entity points does not exceed the preset threshold, the center point is determined as a non-group-type center point.

[0062] The second type is an entity point type of a center point neighborhood bound with the information of the first type, and is used to determine whether the center point is a group type center point or a non-group type center point. The entity point of the second type is an entity point capable of judging the category of the center point in the information of the first type of the center point. The center point can be classified according to the number of the entity points of the second type. For example, when the first type of the center point is a mobile phone number, the neighborhood situation corresponding to the mobile phone number is statistically analyzed, and the category of the mobile phone number center point is determined according to the number of the second type entity points in the neighborhood of the mobile phone number center point. The second type entity point here refers to a vehicle chassis number. If the number of vehicle chassis numbers exceeds a preset threshold, the mobile phone number belongs to a group type center point; if the number of vehicle chassis numbers does not exceed the preset threshold, the mobile phone number belongs to a non-group type center point.

[0063] The neighborhood information includes the points and edges of the center point neighborhood. According to the types and numbers of the points and edges, the center point can be classified into a group type and a non-group type. The group type can be understood as a point as the center, radiating to drive a large number of points to be associated with it. The non-group type can be understood as all points other than the group type, in other words, can be understood as having no radiation effect and not having a large number of different points associated with it.

[0064] The determination method of the preset threshold value is: counting the types of all entity points in the reconstructed subgraph and the number of entity points of each type in the reconstructed subgraph; and determining the preset threshold value according to the distribution of the number of entity points of each type in the reconstructed subgraph. The preset threshold value can be set by a person skilled in the art based on the type and number distribution of the entity points, and the threshold value is not limited in value here.

[0065] Step 104: determining a target cutting point according to the shortest paths between the classified center points.

[0066] The shortest paths between the center points include the shortest paths between the group type center points and the shortest paths between the group type center points and the non-group type center points. To avoid confusion, the shortest path between two group type center points is denoted as a first shortest path, and the shortest path between a group type center point and a non-group type center point is denoted as a second shortest path.

[0067] The group type center point can be understood as a point as the center, capable of radiating to drive a large number of points to be associated with it. The non-group type center point can be understood as all center points other than the group type center point, in other words, can be understood as having no radiation effect and not having a large number of center points associated with it.

[0068] The target cutting point needs to be determined according to the type of the center point, the type of the entity point in the neighborhood of the center point, and the information of the edge on the shortest path, that is, by judging whether the connection between two classified center points is an effective connection to determine the target cutting point.

[0069] Step 105: cutting the reconstructed subgraph through the target cutting point to obtain a cutting result.

[0070] Since the number of entity points in the subgraph is large, the cutting of the reconstructed subgraph cannot be completed at one time, but needs to be performed multiple times. Therefore, in this step, a loop judgment method is used to determine the target cutting point until there is no shortest path between the two classified center points, that is, when there is no target cutting point, the cutting of the subgraph of the two classified center points is completed.

[0071] In the embodiment of the application, the information of the subgraph is analyzed to obtain the information of all points and edges in the subgraph, then the subgraph is reconstructed to highlight the center points, the neighborhood information of the center points is used to determine the category of the center points, and then the target cutting point is determined according to the shortest path between the classified center points to complete the cutting of the reconstructed subgraph. In the process, the preset threshold is determined according to the distribution of the number of entity points of each type in the reconstructed subgraph, the category of the center points is determined according to the dynamic preset threshold, so that the process of center point type determination is more flexible and has strong operability. When the reconstructed subgraph is cut, a loop judgment method is used to determine the target cutting point to cut, thereby ensuring the complete cutting of the subgraph. In this way, the one complex subgraph is cut into multiple independent and complete subgraphs, which is convenient for subsequent use of the data.

[0072] The application provides a subgraph cutting method in a graph database, Figure 2 A flowchart for determining the target cutting point is shown in FIG. Figure 2 As shown in the method provided in the foregoing embodiment, step 104 can be implemented by the following steps:

[0073] Step 201: traversing the first shortest path between the group class center points and the group class center points, determining the point of invalid connection between the center points as the target cutting point according to the neighborhood information of the center points;

[0074] Step 202: traversing the second shortest path between the group class center points and the non-group class center points, determining the point of invalid connection between the center points as the target cutting point according to the neighborhood information of the center points;

[0075] The judgment of whether the center points are effective connections according to the neighborhood information of the center points is based on the type of the center point itself, the type of the neighborhood point, the information of the edge on the shortest path, and the like.

[0076] The shortest path can be understood as follows: between two classified center points, taking one of the center points as the starting point, the path between the nearest center point to the starting point and the starting point is the shortest path. For example, both center points are mobile phone numbers, and there are two paths between the two center points. The first path is: mobile phone number-vehicle chassis number-mobile phone number; the second path is: mobile phone number-ID number-vehicle chassis number-ID number-mobile phone number. At this time, it can be seen that the distance between the two center points in the first path is shorter than that in the second path, so the first path is the shortest path. After the first path is cut, the second path becomes the shortest path, and the second path continues to be operated.

[0077] The invalid connection can be understood as follows: a certain point and a center point do not have an explicit and subsequent operation affecting association, but are connected. This invalid connection obviously causes waste of data resources, makes the data volume complex, produces information redundancy, and affects the construction of subgraphs, so it needs to be cut. For example, there are two points in the subgraph, which are a mobile phone number and a vehicle chassis number, the mobile phone number is a center point, and the vehicle chassis number is a point in the neighborhood of the center point. There is an edge between the above two points. When judging the target cutting point, in addition to judging the type of the center point and the type of the point in the neighborhood, the information of the edge on the shortest path between the two points also needs to be judged. When the two points are a mobile phone number and a vehicle chassis number, the information on the edge can be in three situations: new owner, old owner, and no information. When the information on the edge shows that the new owner, it means that the user corresponding to the mobile phone number is the new owner of the vehicle corresponding to the vehicle chassis number, and the connection between them is valid, so it needs to be retained. When the information on the edge shows that the old owner, it means that the user corresponding to the mobile phone number is the old owner of the vehicle corresponding to the vehicle chassis number, and the connection between them is invalid, so it needs to be cut. When the information on the edge shows no information, it means that the relationship between the user corresponding to the mobile phone number and the vehicle corresponding to the vehicle chassis number is not clear, so it needs to be retained or judged according to other neighborhood information.

[0078] Obviously, in the above steps, the shortest path between non-group center points and non-group center points is not traversed, because the association between non-group center points is less, and sometimes there may be no association at all. In order to save computing resources, this type of operation can be selected not to be performed.

[0079] In the embodiment, specific implementation steps of determining the target cutting point according to the shortest path between the classified center points are provided, and the most preferred operation sequence is given, that is, first performing the first shortest path between the group class and the center point of the group class, and then performing the second shortest path between the group class and the center point of the non-group class. According to the operation sequence, the efficiency of subgraph cutting can be improved from simple to complex.

[0080] The application provides a method for subgraph cutting in a graph database, and the specific execution steps of the embodiment are basically the same as those of the embodiment shown in Figure 1 Figure 3 The method flowchart for cutting the reconstructed subgraph is shown in Figure 3 Figure 1 The steps 104 and 105 of the embodiment shown can be implemented by the following steps:

[0081] Step 301: determining whether there is a shortest path between the center points of two group classes, if yes, performing step 302, and if no, performing step 303;

[0082] Step 302: cutting the reconstructed subgraph according to the target cutting point on the shortest path, and entering step 301;

[0083] Step 303: completing the subgraph cutting in the reconstructed subgraph about the center points of the two group classes.

[0084] Step 304: determining whether there is a shortest path between the center point of the group class and the center point of the non-group class, if yes, performing step 305, and if no, performing step 306;

[0085] Step 305: cutting the reconstructed subgraph according to the target cutting point on the shortest path, and entering step 304;

[0086] Step 306: completing the subgraph cutting in the reconstructed subgraph about the center point of the group class and the center point of the non-group class.

[0087] The method for determining whether there is a shortest path between two center points is as follows: starting from the starting center point, all traversal paths are accessed, then there are multiple paths reaching the terminal center point, and the path with the least number of entity points between the two center points is taken as the shortest path; if all traversal paths are accessed starting from the starting center point, and there is only one path reaching the terminal center point, then the path is the shortest path between the two center points; if all traversal paths are accessed starting from the starting center point, and there is no path reaching the terminal center point, then it is proved that there is no shortest path between the two center points.

[0088] ​​In this embodiment, steps 301, 302, and 303 can be considered as a combination A, and steps 304, 305, and 306 can be considered as a combination B. Combination A is used to cut the subgraph between two community center points, and combination B is used to cut the subgraph between a community center point and a non-community center point. The operation of combination A can be performed first, followed by the operation of combination B; or combination B can be performed first, followed by the operation of combination A; or combinations A and B can be performed simultaneously. The order of operations for the two combinations is not limited here.

[0089] To further improve the efficiency of subgraph cutting, we can choose to perform combination operation A first, followed by combination operation B. That is, first determine the target cutting point between community center points and community center points, and then determine the target cutting point between community center points and non-community center points. The reason is that this operational sequence can be understood as follows: first, a subgraph is cut into many smaller subgraphs, that is, a subgraph with many center points and many entities is cut into several smaller subgraphs with unique center points and many entities. This completes the cutting between community center points, where the center point represents the community center point. Then, the center points and entities in the smaller subgraphs are traversed to find the target cutting point for cutting, which completes the cutting between community center points and non-community center points. Since there are fewer connections between community center points and fewer shortest paths to traverse, while there are many connections between community and non-community center points, the traversal is more complex and difficult. Following this step can better complete the cutting process and improve efficiency.

[0090] Figure 4 The flowchart for the cutting method with the device number as the center point is shown below. Figure 4 As shown, this invention provides a specific embodiment of a method for subgraph cutting in a graph database. In this embodiment, the center point is the device number, and the specific steps may include:

[0091] Step 401: Parse the information of the subgraph in the graph database to obtain the information of the points and edges in the subgraph;

[0092] Step 402: Reconstruct the subgraph using the information to form a visualized center point;

[0093] Step 403: Cut the reconstructed subgraph according to the neighborhood information of the center point to obtain the cutting result.

[0094] The step 403 of cutting the reconstructed subgraph according to the neighborhood information of the center point needs to count the types of entity points in the neighborhood of the center point and the number of entity points, and determine the preset threshold according to the distribution of the number of entity points of each type in the reconstructed subgraph. The number of entity points of the second type in the neighborhood information of the center point is obtained; if the number of entity points of the second type exceeds the preset threshold, cutting is needed; if the number of entity points of the second type does not exceed the preset threshold, cutting is not needed.

[0095] The entity point of the second type here is a combination point of sso_id (node single sign-on system ID) and mobile phone number. The preset threshold can be set by a person skilled in the art and is not limited here.

[0096] Figure 5 The structure of the subgraph cutting device in the graph database is shown in FIG. 1. Figure 5 The present application also provides a device for cutting a subgraph in a graph database, which comprises:

[0097] An information analysis unit 100 is configured to analyze information of a subgraph in a graph database to obtain information of points and edges in the subgraph;

[0098] An image reconstruction unit 200 is configured to reconstruct a subgraph by using the information of points and edges in the analyzed subgraph to form a visual center point;

[0099] A classification unit 300 is configured to classify the center point according to neighborhood information of the center point;

[0100] A cutting point determination unit 400 is configured to determine a target cutting point according to the shortest path between the classified center points;

[0101] A cutting unit 500 is configured to cut the reconstructed subgraph through the target cutting point to obtain a cutting result.

[0102] The application provides a device for subgraph cutting in a graph database, which comprises an information analysis unit 100, a graph reconstruction unit 200, a classification unit 300 and a cutting unit 500.

[0103] In an optional implementation, the threshold determination unit 310 comprises a statistics subunit 311 and a threshold determination subunit 312, the statistics subunit 311 is used for counting the types of all entity points in the reconstructed subgraph and the number of entity points of each type in the reconstructed subgraph, and the threshold determination subunit 312 is used for determining the preset threshold according to the distribution of the number of entity points of each type in the reconstructed subgraph.

[0104] In an optional implementation, the cutting unit 500 comprises a path judgment subunit 510 and a cutting subunit 520, the path judgment subunit 510 is used for judging whether there is a shortest path between two classified center points, and is also used for judging whether there is a shortest path between the two classified center points after cutting by the cutting subunit, if not, the cutting subunit completes subgraph cutting of the subgraph about the two classified center points in the reconstructed subgraph, if yes, the cutting subunit continues to determine a new target cutting point for subgraph cutting until there is no shortest path between the two classified center points.

[0105] In an optional implementation, the cutting subunit 520 is used for cutting the reconstructed subgraph according to the target cutting point on the shortest path if the path judgment subunit judges that there is a shortest path.

[0106] The device for subgraph cutting in a graph database can cut the subgraph with complex data and redundant information.

[0107] The embodiments of the present application further provide a corresponding device and a computer readable storage medium for implementing the scheme provided by the embodiments of the present application.

[0108] The device comprises a memory and a processor, the memory is used for storing instructions or codes, and the processor is used for executing the instructions or codes to enable the device to perform the object anti-lost method provided by any of the embodiments of the present application.

[0109] In actual application, the computer readable storage medium can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiments, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.

[0110] The computer readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, in which a computer readable program code is borne. Such a propagated data signal can take multiple forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a storage medium and that can transmit, propagate or transport a program for use by or in connection with an instruction execution system, device or component.

[0111] The program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination thereof.

[0112] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0113] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0114] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for subgraph cut in a graph database, characterized in that, The method comprises: information analysis on a subgraph in a graph database to obtain information of points and edges in the subgraph; reconstruction of the subgraph by using the information of points and edges in the subgraph to form a center point for visualization; classification of the center point according to neighborhood information of the center point; determination of a target cutting point according to a shortest path between the classified center points; cutting of the reconstructed subgraph by the target cutting point to obtain a cutting result; the neighborhood information of the center point comprises types of entity points in the neighborhood of the center point and quantities of entity points of each type; if the center point comprises information of a first type, the classification of the center point according to the neighborhood information of the center point comprises: acquisition of a quantity of entity points of a second type in the neighborhood information of the center point; if the quantity of entity points of the second type exceeds a preset threshold, the center point is determined as a group class center point; if the quantity of entity points of the second type does not exceed the preset threshold, the center point is determined as a non-group class center point; wherein the second type is a type of entity points in the neighborhood of the center point that is bound to the information of the first type, and is used to determine whether the center point is a group class center point or a non-group class center point; the first type is a mobile phone number; and the second type is a vehicle chassis number bound to the mobile phone number.

2. The method of claim 1, wherein, The determination of the target cutting point according to the shortest path between the classified center points comprises: determination of the target cutting point according to the type of the center point, the type of entity points in the neighborhood of the center point, and information of edges on the shortest path.

3. The method of claim 1, wherein, The cutting of the reconstructed subgraph by the target cutting point comprises: determination of whether there is a shortest path between two classified center points; if there is a shortest path, the reconstructed subgraph is cut according to the target cutting point on the shortest path; after the cutting, it is determined whether there is a shortest path between the two classified center points; if there is not, the cutting of the subgraph about the two classified center points in the reconstructed subgraph is completed; if there is, a new target cutting point is determined for the cutting of the subgraph until there is not a shortest path between the two classified center points.

4. The method of claim 1, wherein, The preset threshold is determined by the following method: statistics of types of all entity points in the reconstructed subgraph and quantities of entity points of each type in the reconstructed subgraph; determination of the preset threshold according to a distribution of the quantities of entity points of each type in the reconstructed subgraph.

5. An apparatus for subgraph cut in a graph database, the apparatus comprising: The device comprises: an information analysis unit configured to analyze information of a subgraph in a graph database to obtain information of points and edges in the subgraph; an image reconstruction unit configured to reconstruct the subgraph by using the information of points and edges in the analyzed subgraph to form a center point for visualization; a classification unit configured to classify the center point according to neighborhood information of the center point; a cutting point determination unit configured to determine a target cutting point according to a shortest path between the classified center points; a cutting unit configured to cut the reconstructed subgraph by the target cutting point to obtain a cutting result. The neighborhood information of the center point includes types of entity points in the neighborhood of the center point and quantities of entity points of each type; and if the center point includes information of a first type, the classifying the center point according to the neighborhood information of the center point includes: acquiring a quantity of entity points of a second type in the neighborhood information of the center point; if the quantity of entity points of the second type exceeds a preset threshold, determining the center point as a group class center point; if the quantity of entity points of the second type does not exceed the preset threshold, determining the center point as a non-group class center point; wherein the second type is a type of entity points in the neighborhood of the center point that is bound with the information of the first type, and is used to determine whether the center point is a group class center point or a non-group class center point; the first type is a mobile phone number; and the second type is a vehicle chassis number bound with the mobile phone number. 6.An electronic device for subgraph cut in a graph database, the electronic device comprising: comprise: a memory for storing a computer program; a processor for executing the computer program to implement the method for cutting a subgraph in a graph database according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method for cutting a subgraph in a graph database according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Image classification method and device, electronic equipment and storage medium

    CN112364933A

  • Segmentation strengthening method for damage detection image of aerospace composite material

    CN112819775A