CN110825821A - Personnel relationship query method and device, electronic equipment and storage medium - Google Patents

Personnel relationship query method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110825821A
CN110825821A CN201910955085.1A CN201910955085A CN110825821A CN 110825821 A CN110825821 A CN 110825821A CN 201910955085 A CN201910955085 A CN 201910955085A CN 110825821 A CN110825821 A CN 110825821A
Authority
CN
China
Prior art keywords
attribute
edges
query
personnel
relationship
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910955085.1A
Other languages
Chinese (zh)
Other versions
CN110825821B (en
Inventor
戴世稳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Publication of CN110825821A publication Critical patent/CN110825821A/en
Application granted granted Critical
Publication of CN110825821B publication Critical patent/CN110825821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/26Government or public services
    • G06Q50/265Personal security, identity or safety

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Educational Administration (AREA)
  • Development Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a method and a device for inquiring personnel relationship, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a personnel relation graph; acquiring target personnel nodes to be searched and query conditions, wherein the query conditions comprise query depth and attribute value thresholds, and the query depth represents the maximum continuous attribute edge number taking the target personnel nodes as starting points; deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold; and obtaining a relation map of the target person based on the undeleted attribute sides, and displaying the relation map of the target person. By deleting the attribute edges according to the query depth and the attribute value threshold, data related to the deleted attribute edges do not need to be traversed, and the data volume needing to be traversed is reduced, so that the calculation amount is reduced, and the query efficiency is improved.

Description

Personnel relationship query method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a method and a device for inquiring personnel relationship, electronic equipment and a storage medium.
Background
Artificial intelligence is widely used in the field of security, for example: the personnel query based on image recognition can query information such as the identity, the snapshot time and the snapshot address of a target person, and the behavior and the relationship of the personnel are analyzed through the queried information. However, with the development requirement of security service, more and more cameras are deployed, the life cycle of image data is longer and longer, and massive image data is formed. When the relationship between the target person and other people is queried, related data needs to be found from massive image data, and then relationship data is formed, so that the relationship between the target person and other people is obtained, a large amount of computing resources are consumed in the process, and the query time is long. Therefore, the query efficiency of the existing personnel relationship query is not high.
Disclosure of Invention
The embodiment of the invention provides a method for inquiring personnel relationship, which can improve the efficiency of inquiring the personnel relationship.
In a first aspect, an embodiment of the present invention provides a method for querying a relationship between people, including:
acquiring a personnel relation graph, wherein the personnel relation graph comprises personnel nodes and attribute edges connected with the personnel nodes, and the attribute edges comprise attribute values;
acquiring target personnel nodes to be searched and query conditions, wherein the query conditions comprise query depth and attribute value thresholds, and the query depth represents the maximum continuous attribute edge number taking the target personnel nodes as starting points;
deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold;
and obtaining a relation graph of a target person based on the undeleted attribute edges, and obtaining the relation graph of the target person, wherein the relation graph comprises the target person and a person node directly or indirectly connected with the target person through the attribute edges.
Optionally, the deleting, according to the query depth and the attribute value threshold, the attribute edge directly or indirectly connected to the target person node includes:
in the query depth range, confirming the detected attribute edges with the attribute values smaller than the attribute value threshold value among the attribute edges directly or indirectly connected with the target personnel node as invalid attribute edges, deleting the invalid attribute edges, confirming the detected attribute edges with the attribute values larger than or equal to the attribute value threshold value among the attribute edges directly or indirectly connected with the target personnel node as valid attribute edges, and keeping the valid attribute edges directly or indirectly connected with the target personnel node;
the obtaining of the relationship graph of the target person based on the undeleted attribute edges comprises:
and obtaining the relation map of the target personnel based on the effective attribute edges directly or indirectly connected with the target personnel nodes.
Optionally, when the query depth is a single-valued query depth, the query depth range represents a range in which the target person node is used as a starting point and the single-valued query depth is used as the maximum number of continuous attribute edges;
and when the query depth is an interval query depth comprising a minimum query depth and a maximum query depth, the query depth range represents an annular range with the minimum query depth as an inner diameter and the maximum query depth as an outer diameter, and attribute edges directly and/or indirectly connected with the target personnel nodes are reserved in the minimum query depth range.
Optionally, the obtaining of the person relationship map includes:
acquiring all personnel data as personnel nodes; and
acquiring every two personnel relationship data as attribute edges, wherein the relationship data comprise attribute values;
and connecting the corresponding personnel nodes through the attribute edges to form a personnel relationship map.
Optionally, the attribute values include a relationship attribute value and a peer attribute value, the peer attribute value is smaller than the relationship attribute value, and the acquiring of each two pieces of personnel relationship data as an attribute edge includes:
traversing and detecting whether a predefined relationship type exists between two persons;
if a predefined relationship type exists between two persons, determining a relationship attribute value between the two persons according to the relationship type, wherein the relationship type and the relationship attribute value have a mapping relationship in advance;
if the predefined relationship type does not exist between the two persons, detecting whether the two persons have the same-row attribute;
and forming attribute edges corresponding to every two personnel nodes according to the relationship attribute values or the same row attribute values.
Optionally, the displaying the relationship map of the target person includes:
and according to the attribute value corresponding to each attribute side or the query depth of each attribute side in the relation graph of the target person, performing differential display on each attribute side.
In a second aspect, an embodiment of the present invention provides an apparatus for querying a person relationship, including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a personnel relation graph, the personnel relation graph comprises personnel nodes and attribute edges connected with the personnel nodes, and the attribute edges comprise attribute values;
the second acquisition module is used for acquiring a target person node to be searched and a query condition, wherein the query condition comprises a query depth and an attribute value threshold, and the query depth represents the maximum continuous attribute edge number taking the target person node as a starting point;
the processing module is used for deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold;
and the display module is used for obtaining a relation graph of the target person based on the undeleted attribute edges and aiming at the relation graph of the target person, wherein the relation graph comprises the target person and a person node directly or indirectly connected with the target person through the attribute edges.
Optionally, the processing module is further configured to, in the query depth range, delete an invalid attribute edge when detecting that an invalid attribute edge whose attribute value is smaller than the attribute value threshold exists in the attribute edges directly or indirectly connected to the target person node, and reserve to obtain an valid attribute edge directly or indirectly connected to the target person node;
the display module is further used for obtaining the relation map of the target person based on the effective attribute edges directly or indirectly connected with the target person nodes.
In a third aspect, an embodiment of the present invention provides an electronic device, including: the system comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the steps in the query method of the personnel relationship provided by the embodiment of the invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps in the query method for the relationship between people provided in the embodiment of the present invention.
In the embodiment of the invention, a personnel relation graph is obtained, wherein the personnel relation graph comprises personnel nodes and attribute edges connected with the personnel nodes, and the attribute edges comprise attribute values; acquiring target personnel nodes to be searched and query conditions, wherein the query conditions comprise query depth and attribute value thresholds, and the query depth represents the maximum continuous attribute edge number taking the target personnel nodes as starting points; deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold; and obtaining a relation graph of a target person based on the undeleted attribute edges, and displaying the relation graph of the target person, wherein the relation graph comprises the target person and a person node directly or indirectly connected with the target person through the attribute edges. By deleting the attribute edges according to the query depth and the attribute value threshold, data related to the deleted attribute edges do not need to be traversed, and the data volume needing to be traversed is reduced, so that the calculation amount is reduced, and the query efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for querying a person relationship according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for querying a person relationship according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for querying a person relationship according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a person relationship graph provided by an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for querying a personal relationship according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another inquiry apparatus for personal relationships according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another inquiry apparatus for personal relationships according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of another inquiry apparatus for personal relationships according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a method for querying a person relationship according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
101. and acquiring a personnel relation map.
The person relationship graph comprises person nodes and attribute edges connecting the person nodes, and the attribute edges comprise attribute values.
For a target person, the person relationship graph includes attribute edges connected to the target person and attribute edges indirectly connected to the target person nodes.
The above attribute edges directly connected to the target person node can be understood as: one end of the attribute edge is a target person node.
The above attribute edges indirectly connected to the target person node can be understood as: and one end of the attribute edge is not the target person node, but is connected with the target person node through other attribute edges.
The people relation map may be a people relation map of a designated area, for example, a people relation map of a certain city, a people relation map of a certain cell, and the like.
The personnel relation map can be constructed in advance, the personnel relation map can be constructed through image data acquired by a camera arranged in a corresponding area, for example, the personnel relation map is constructed through image data of the same row captured by the camera, two personnel are captured at the same time and the same place, the personnel relation map can be judged to be the same row, and the personnel relation map can be connected through attribute edges when the personnel relation map exists.
In some possible embodiments, the person relationship graph refers to a person relationship graph copied in the bottom database, and the obtained person relationship graph is modified and edited without affecting the person relationship graph in the bottom database. Specifically, when the query is performed, the corresponding staff relationship map is read from the bottom database where the staff relationship map is located, a temporarily generated staff relationship map is generated, and the temporarily generated staff relationship map is used for modification and editing.
In addition, the personnel nodes in the personnel relationship graph have a mapping relationship with the corresponding personnel information, namely the personnel nodes of a person in the relationship graph can be positioned through the personnel information of the person; or selecting a person node in the person relationship map to obtain the person information corresponding to the person node. For a larger personnel relationship map, such as a city-level personnel relationship map, the personnel information may be unique feature information such as identity card information or face information, and for a smaller personnel relationship map, such as a cell personnel relationship map, the personnel information may be feature information such as name, identity card information, face information, and the like.
In the personnel relation graph, the attribute edges are used for connecting two personnel nodes with relations, the relations comprise a natural relation and a same-row relation, and attribute edge connection is not arranged between two personnel nodes without relations. The natural relationship may be a relationship such as no wife, mother and child, father and child, brother, sister, other relatives, friends, and coworkers, and the relationship of the coworkers refers to a relationship corresponding to the same camera being captured at the same time and the same place.
The attribute value is used for representing the degree of relationship between two personnel nodes, and the more intimate the relationship is, the higher the attribute value is. In some possible embodiments, when the two person nodes are direct relatives, the attribute value is highest, the attribute value of strangers in the same row is lowest, and no stranger in the same row has no attribute value because no attribute edge is set.
In the embodiment of the present invention, the attribute value may also be referred to as a relationship weight. The person node may be also referred to as a person, and the attribute edge may be also referred to as a relationship edge, a connection line, or the like.
102. And acquiring a target person node to be searched and a query condition.
The query condition includes a query depth and an attribute value threshold. The target person node to be searched may be obtained by inputting by a user, for example, the user uploads identity information or a face image corresponding to the target person, a specific person node is located in the person relationship graph through the identity information or the face image of the target person, and the node is used as the target person node to be searched. The identity information includes name, date of birth, identification number, etc. In the embodiment of uploading the face image, the person nodes in the person relationship graph correspond to the face feature values of the persons, and after the face image is uploaded by the user, the face feature values of the face image are extracted through the feature extraction engine, so that the person node corresponding to the face feature value with the maximum similarity is found in the person relationship graph according to the extracted face feature values and serves as the target person node to be searched.
The query conditions are input by a user, and the user can select buttons or directly input the query conditions through a display interface of the terminal.
The query depth described above represents the maximum number of consecutive attribute edges starting from the target person node. When the query depth is 1, the maximum number of continuous attribute edges is 1, that is, only the attribute edges directly connected with the target person node and the person nodes corresponding to the attribute edges are queried. When the query depth is 2, the maximum number of continuous attribute edges is 2, that is, only the attribute edges directly connected with the target person node, the attribute edges indirectly connected with the target person node through the directly connected attribute edges, and the corresponding person nodes are queried. The above-mentioned query depths of 1 and 2 are merely exemplary descriptions of the query depth, and should not be considered as limitations of embodiments of the present invention, and in some embodiments, the query depth may be other user-selectable positive integers.
The attribute value threshold is used for comparing with the attribute values of the attribute edges to judge whether the relation degree of the two personnel nodes corresponding to the attribute edges meets the requirements of the user. The attribute value threshold may be set according to an input of a user, for example, when the user wants to query other people having a close relationship with the target person, the attribute value threshold may be set to be a little higher. For example, if the user wants to query the immediate relatives of the target person, and the attribute value of the attribute edge corresponding to the immediate relatives is higher than 0.9, the threshold of the attribute value may be adjusted to 0.9, that is, the attribute value corresponding to the attribute edge is greater than 0.9, so that the condition is satisfied.
In some possible implementations, the attribute value threshold may be two extremes when the user wants to visit other people who are not close or strange to the target person. For example, the attribute value threshold is 0.2 and 0.8, that is, the attribute value corresponding to the attribute edge is greater than 0.2 and less than 0.8, and the attribute value threshold is satisfied.
103. And deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold.
In step 103, attribute edges that do not satisfy the query depth and attribute value thresholds may be deleted.
Deleting attribute edges that do not meet the query depth may be, for example: when the query depth is 3, continuous attribute edges A-B-C-D-E directly or indirectly connected with the target person node A exist, the corresponding person nodes are B, C, D, E respectively, wherein the attribute edges A-B are the attribute edges directly connected with the target person node A, the attribute edges B-C, C-D, D-E are the attribute edges indirectly connected with the target person node A, and the attribute edges meeting the query depth are A-B, B-C, C-D due to the fact that the query depth is 3, and the attribute edges D-E are deleted.
Deleting the attribute edge whose attribute value does not satisfy the attribute value threshold may be, for example: when the attribute value threshold is 0.6, there are continuous attribute edges D-a-B-C-E directly or indirectly connected with the target person node a, and the corresponding person nodes are B, C, D, E respectively, where the D-a attribute edge and the a-B attribute edge are attribute edges directly connected with the target person node a, the B-C attribute edge and the C-E attribute edge are attribute edges indirectly connected with the target person node a, assuming: the attribute value of the D-A attribute edge is 0.4, the attribute value of the A-B attribute edge is 0.9, the attribute value of the B-C attribute edge is 0.8, and the attribute value of the C-E attribute edge is 0.3. Deleting the D-A attribute edge because the attribute value 0.4 of the D-A attribute edge is less than the attribute value threshold value 0.6; because the attribute value 0.9 of the A-B attribute edge is greater than the attribute value threshold value 0.6, the A-B attribute edge is not deleted; because the attribute value 0.8 of the B-C attribute edge is greater than the attribute value threshold value 0.6, the B-C attribute edge is not deleted; since the attribute value 0.3 of the C-E attribute edge is less than the attribute value threshold 0.6, the C-E attribute edge is deleted.
Note that, after deleting an attribute edge, the attribute edge to be connected to the attribute edge is not calculated.
In addition, attribute edges satisfying the query depth and the attribute value threshold may be marked, and unmarked attribute edges may be deleted.
For example, marking attribute edges that satisfy query depth may be, for example: when the query depth is 3, continuous attribute edges A-B-C-D-E directly or indirectly connected with a target person node A exist, corresponding person nodes are B, C, D, E respectively, wherein the attribute edges A-B are the attribute edges directly or indirectly connected with the target person node A, B-C, C-D, D-E and the target person node A are the attribute edges indirectly connected, when the query depth is 3, when the query depth is met after the query depth is reached, the A-B is marked, the query depth is continued to be reached, the B-C is marked, the query depth is met, the B-C is marked, the C-D meeting the query depth is also marked, when the depth of the D-E is 4, the marking cannot be carried out, the attribute edges D-E without marks are deleted, and the marked attribute properties A-B, B-C, C-D are reserved.
Marking attribute edges whose attribute values satisfy the attribute value threshold may be, for example: when the attribute value threshold is 0.6, there are continuous attribute edges D-a-B-C-E directly or indirectly connected with the target person node a, and the corresponding person nodes are B, C, D, E respectively, where the D-a attribute edge and the a-B attribute edge are attribute edges directly connected with the target person node a, the B-C attribute edge and the C-E attribute edge are attribute edges indirectly connected with the target person node a, assuming: the attribute value of the D-A attribute edge is 0.4, the attribute value of the A-B attribute edge is 0.9, the attribute value of the B-C attribute edge is 0.8, and the attribute value of the C-E attribute edge is 0.3. Because the attribute value 0.4 of the D-A attribute edge is less than the attribute value threshold value 0.6, the D-A attribute edge is not marked; marking the A-B attribute edge because the attribute value 0.9 of the A-B attribute edge is greater than the attribute value threshold value 0.6; marking the B-C attribute edge because the attribute value 0.8 of the B-C attribute edge is greater than the attribute value threshold value 0.6; since the attribute value of 0.3 for the C-E attribute edge is less than the attribute value threshold of 0.6, the C-E attribute edge is not marked. Finally, the attribute side D-A, C-E without the mark is deleted, and the attribute side A-B, B-C with the mark is reserved.
In the query depth range, after all the attribute edges of one depth are calculated, only the attribute edges connected with the marked attribute edges in the next depth are calculated, and the attribute edges not connected with the marked attribute edges are not calculated any more.
The above-mentioned marking may be understood as marking by an identifier, or may be adding attribute edges satisfying a query depth or attribute value threshold to a specific set, thereby marking the attribute edges.
In one embodiment, the step 103 comprises:
and in the query depth range, confirming the detected attribute edges with the attribute values smaller than the attribute value threshold value among the attribute edges directly or indirectly connected with the target personnel node as invalid attribute edges, deleting the invalid attribute edges, confirming the detected attribute edges with the attribute values larger than or equal to the attribute value threshold value among the attribute edges directly or indirectly connected with the target personnel node as valid attribute edges, and keeping the valid attribute edges directly or indirectly connected with the target personnel node.
In one embodiment, the query depth may be a single-value query depth, or may be an interval query depth including a minimum query depth and a maximum query depth. It is understood that the single-valued query depth refers to the query depth being a positive integer greater than or equal to 1 (e.g., 3, 4, 5, etc.).
And when the query depth is the single-value query depth, the query depth range represents a range which takes the target person node as a starting point and the single-value query depth as the maximum number of continuous attribute edges.
And when the query depth is an interval query depth comprising a minimum query depth and a maximum query depth, the query depth range represents an annular range with the minimum query depth as an inner diameter and the maximum query depth as an outer diameter, and attribute edges directly and/or indirectly connected with the target personnel nodes are reserved in the minimum query depth range.
104. And obtaining the relation map of the target person based on the undeleted attribute sides, and displaying the relation map of the target person.
In step 103, the attribute sides that do not satisfy the query condition are deleted, the remaining attribute sides are the attribute sides that satisfy the condition, and since the person relationship graph is a complete graph, after the attribute sides that do not satisfy the query condition are deleted, the remaining attribute sides are also a graph, which is the relationship graph of the target person.
It should be noted that, the relationship graph of the target person includes attribute edges where the target person node is directly or indirectly connected to the target person node, one end of the attribute edge directly connected to the target person node is the target person node, the other end of the attribute edge is a related person node, and both ends of the attribute edge indirectly connected to the target person node are related person nodes.
The above-mentioned display may be performed through a display screen of the user terminal. The user side can be a mobile phone, a notebook computer, a computer and other electronic equipment with a display function.
It should be noted that the method for querying a person relationship provided in the embodiment of the present invention may be applied to a device such as a mobile phone, a computer, and a server for querying a person relationship.
In the embodiment of the invention, a personnel relationship graph is obtained, the personnel relationship graph comprises personnel nodes and attribute edges connected with the personnel nodes, and the attribute edges comprise attribute values; acquiring target personnel nodes to be searched and query conditions, wherein the query conditions comprise query depth and attribute value thresholds, and the query depth represents the maximum continuous attribute edge number taking the target personnel nodes as starting points; deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold; and obtaining a relation graph of a target person based on the undeleted attribute edges, and displaying the relation graph of the target person, wherein the relation graph comprises the target person and a person node directly or indirectly connected with the target person through the attribute edges. The attribute edges are deleted through the query depth and the attribute value threshold, data related to the deleted attribute edges do not need to be traversed, and the data volume needing to be traversed is reduced, so that the calculation amount is reduced, and the query efficiency is improved.
Referring to fig. 2, fig. 2 is a flowchart of another method for querying a relationship between people according to an embodiment of the present invention, as shown in fig. 2, including the following steps:
201. and acquiring a personnel relation map.
202. And acquiring a target person node to be searched and a query condition.
The query conditions include a query depth and an attribute value threshold. The query depth includes an interval query depth and a single-value query depth, and the interval query depth includes a minimum depth and a maximum depth.
And when the query is carried out through the interval query depth, the attribute edges which are directly and/or indirectly connected with the target personnel nodes in the minimum query depth range are reserved.
The single-valued query depth described above can be understood as the maximum number of consecutive attribute edges starting from the target person node. It can also be understood that the minimum query depth among the interval query depths is 0.
In the minimum depth range, all attribute edges may not be compared with the attribute value threshold, and all attribute edges in the minimum depth range are reserved, such as: and each person node is B, C, D, E, wherein the A-B attribute edge is the attribute edge directly connected with the target person node A, the B-C, C-D, D-E is the attribute edge indirectly connected with the target person node A, when the interval query depth is 1-3, the minimum depth is 1, the maximum depth is 3, starting from the attribute edge with the depth of 1, and the attribute edge meeting the query depth is B-C, C-D, the attribute edge D-E is deleted. The maximum depth described above is used to represent the maximum number of consecutive attribute edges starting from the target person node. When the query condition is the interval query depth, for example, the interval query depth is 2 to 4, in the interval query depth, the minimum depth is 2, the maximum depth is 4, and from the attribute edge with the depth of 2, the attribute edge satisfying the query depth is C-D, D-E, and then deletion is not performed. The minimum depth may also be referred to as a minimum deletion depth, and attribute edges smaller than or equal to the minimum deletion depth may not be deleted, that is, all attribute edges within the minimum depth need to be traversed. Through the minimum depth in the interval query depth, attribute edges in the minimum depth range can not be compared with attribute value thresholds during query, so that all attribute edges directly or indirectly connected with target personnel nodes are reserved.
The maximum depth may also be referred to as a maximum retention depth, and all attribute edges larger than the maximum retention depth are deleted, for example, if the maximum depth is 3, all attribute edges exceeding 3 depths are deleted, and traversal is not performed.
Therefore, in the above-described interval query depth, all attribute edges within the minimum depth range are retained, attribute edges whose attribute values satisfy the attribute value threshold are retained within the range of the minimum depth and the maximum depth, attribute edges whose attribute values do not satisfy the attribute value threshold are deleted, and outside the maximum depth range, all attribute edges are deleted without traversing.
203. And in the query depth range, when detecting that an invalid attribute edge with the attribute value smaller than the attribute value threshold exists in the attribute edges directly or indirectly connected with the target personnel node, deleting the invalid attribute edge, and reserving to obtain the valid attribute edge directly or indirectly connected with the target personnel node.
In this step 203, when other persons having a direct relationship with the target person need to be queried, other person nodes directly connected to the target person node through the attribute edge may be queried, the query depth may be set to 1, and then the attribute value of the attribute edge within the range where the query depth is 1 may be compared with the attribute value threshold, the attribute edge that satisfies the attribute value threshold is reserved as an effective attribute edge, and the attribute edge that does not satisfy the attribute value threshold is deleted as an ineffective attribute edge. It should be noted that, when the query depth is set to 1, the remaining valid attribute edges are all direct attribute edges directly connected to the target person node. In this case, only the attribute edges directly connected to the target person node within the query depth range are deleted.
In addition, when other people having an indirect relationship with the target person need to be queried, other person nodes indirectly connected with the target person node through the attribute edge may be queried, the minimum depth in the query depths may be set to 1, the maximum depth is set to an integer greater than 1, and for example, the maximum depth is set to 3. Then all attribute edges within the range with the depth of 1 can be reserved, the attribute edges with the attribute values not meeting the attribute value threshold within the depth range larger than 1 and smaller than or equal to 3 are deleted as invalid attribute edges, and the attribute edges with the attribute values meeting the attribute value threshold are reserved as valid attribute edges. In this case, only attribute edges indirectly connected to the target person node are deleted.
The above attribute edges directly connected to the target person node can be understood as: one end of the attribute edge is a target person node.
The above attribute edges indirectly connected to the target person node can be understood as: and one end of the attribute edge is not the target person node, but is connected with the target person node through other attribute edges.
In some possible embodiments, when only other people having a direct relationship with the target person need to be queried and comparison does not need to be performed through an attribute value threshold, the comparison may be performed by closing the comparison item of the attribute value threshold, or may be performed by setting both the minimum depth and the maximum depth of the interval query depth to 1, and when the minimum depth and the maximum depth of the interval query depth are both 1, all attribute edges having a depth of 1 in the person relationship map are retained, and all attribute edges having a depth greater than 1 are deleted, so that the obtained person is the other person having a direct relationship with the target person. Similarly, the minimum depth and the maximum depth may also be set to the same value, so that any attribute edge is not deleted in the query range, for example, if the interval query depth is 3 to 3, all attribute edges with a depth within 3 in the person relationship map are retained according to the minimum depth 3, and all attribute edges with a depth greater than 3 in the person relationship map are deleted according to the maximum depth 3.
Optionally, when the query depth is greater than or equal to 2, in the query depth range, when detecting that a first invalid attribute edge with an attribute value smaller than an attribute value threshold exists in the attribute edges directly connected with the target person node, deleting the first invalid attribute edge, and reserving to obtain a direct valid attribute edge directly connected with the target person node; and in the inquiry depth range, when detecting that a second invalid attribute edge with the attribute value smaller than the attribute value threshold exists in the attribute edges indirectly connected with the target personnel node, deleting the second invalid attribute edge, and reserving to obtain the indirect valid attribute edge indirectly connected with the target personnel node.
Specifically, for example: when the query depth is equal to 2 and the attribute value threshold is 0.6, there are continuous attribute edges D-a-B-C (F) -E and D-a-B-F directly or indirectly connected with the target person node a, where the corresponding person nodes are B, C, D, E, F respectively, where the D-a attribute edge and the a-B attribute edge are attribute edges directly connected with the target person node a, the B-C attribute edge, the B-F attribute edge and the C-E attribute edge are attribute edges indirectly connected with the target person node a, and it is assumed that: the attribute value of the D-A attribute edge is 0.4, the attribute value of the A-B attribute edge is 0.9, the attribute value of the B-C attribute edge is 0.8, the attribute value of the B-F attribute edge is 0.3, and the attribute value of the C-E attribute edge is 0.9. Detecting whether a first invalid attribute edge with an attribute value smaller than an attribute value threshold exists: because the attribute value 0.4 of the D-A attribute edge is less than the attribute value threshold value 0.6, the D-A attribute edge belongs to a first invalid attribute edge, and the first invalid attribute edge D-A is deleted; as the attribute value 0.9 of the A-B attribute edge is greater than the attribute value threshold value 0.6 and belongs to the direct effective attribute edge, the direct effective attribute edge A-B is reserved.
Detecting whether a second invalid attribute edge with the attribute value smaller than the attribute value threshold exists: the attribute value 0.8 of the B-C attribute edge is greater than the attribute value threshold value 0.6, the attribute belongs to an indirect effective attribute edge, and the indirect effective attribute edge B-C is reserved; because the depth of the C-E attribute edge is 3 and is greater than the query depth, the attribute edge C-E can be directly deleted, the attribute value 0.3 of the B-F attribute edge is less than the attribute value threshold value 0.6, the attribute edge belongs to a second invalid attribute edge, and the second invalid attribute edge B-F is deleted.
In addition, when the query depth is equal to 3, it is detected whether there is a third invalid attribute edge whose attribute value is less than the attribute value threshold: the attribute value 0.9 of the C-E attribute edge is greater than the attribute value threshold value 0.6, the attribute belongs to the indirect effective attribute edge, and the indirect effective attribute edge C-E is reserved.
The D-A attribute edge and the A-B attribute edge are directly connected with the target person node A; the B-C attribute edge and the B-F attribute edge are both indirectly connected with the target person node A through the A-B attribute edge; the C-E attribute edge is indirectly connected with the target person node A through the B-C attribute edge and the A-B attribute edge.
In addition, in the present optional embodiment, different attribute value thresholds may be set corresponding to different depths, and the attribute value threshold may be set higher as the data of the depth is larger. For example, the threshold of the attribute value in the first invalid attribute edge for detecting whether the attribute value is smaller than the attribute value threshold may be 0.6, and the threshold of the attribute value in the second invalid attribute edge for detecting whether the attribute value is smaller than the attribute value threshold may be 0.7. Therefore, the relevance between each person and the target person in the target person relation map can be obtained.
204. And obtaining the relation map of the target personnel based on the effective attribute edges directly or indirectly connected with the nodes of the target personnel.
When the query depth is 1, the relationship graph of the target person includes direct effective attribute edges directly connected to the target person node, and each direct effective attribute edge includes the same target person node and a person node connected to the target person node.
When the query depth is an integer greater than or equal to 2, the relationship graph of the target person comprises a direct effective attribute edge directly connected with the node of the target person and an indirect effective attribute edge indirectly connected with the target person. Each direct valid attribute edge includes the same target person node and a person node connected to the target person node. Each indirect effective attribute edge comprises two same personnel nodes different from the target personnel node, and each indirect effective attribute edge is directly or indirectly connected with the direct effective attribute edge.
When the query depth is greater than or equal to 3, the indirect effective attribute edge is indirectly connected with the direct effective attribute edge.
205. And displaying the relationship map of the target person.
In step 204, the invalid attribute not meeting the query condition is deleted in the person relationship graph, and the remaining valid attributes are valid attributes meeting the condition.
It should be noted that, the relationship graph of the target person includes attribute edges where the target person node is directly or indirectly connected to the target person node, one end of the attribute edge directly connected to the target person node is the target person node, the other end of the attribute edge is a related person node, and both ends of the attribute edge indirectly connected to the target person node are related person nodes.
The above-mentioned display may be performed through a display screen of the user terminal. The user side can be a mobile phone, a notebook computer, a computer and other electronic equipment with a display function.
Optionally, before the presentation, each attribute side in the relationship map of the target person may be differentially presented according to the attribute value corresponding to each attribute side or the query depth in the relationship map of the target person.
In some possible embodiments, when the attribute sides in the relationship map of the target person are differentially displayed according to the query depth, the attribute sides in the relationship map of the target person may be differentially displayed by colors, that is, different depths correspond to different colors, for example, depth 1 corresponds to deep blue, depth 2 corresponds to light blue, depth 3 corresponds to deep green, and the like.
In other possible embodiments, when the attribute sides in the relationship graph of the target person are differentially displayed according to the attribute values corresponding to the attribute sides, the attribute sides in the relationship graph of the target person may be differentially displayed through numbers, that is, the corresponding attribute values are displayed on the attribute sides, for example, if the attribute value of the attribute side a is 0.9, a value of 0.9 is displayed on the position corresponding to the attribute side.
By differentially displaying each attribute side in the relation map of the target person, a user can more intuitively analyze the relation map of the target person.
In addition, before the display, the times of the same row of each person in the relationship graph of the target person can be obtained, the times of the same row can be marked and displayed at the position of the corresponding attribute edge, and the times of the same row can also be displayed at the position of the corresponding person node. The number of times of the same row is displayed, so that a user can more intuitively analyze the relationship graph of the target person in the same row.
In the steps, the attribute sides which do not meet the query conditions in the human-computer relationship map are deleted through the query depth and the attribute value threshold, the deleted attribute side related data are not required to be traversed, and the data quantity which needs to be traversed is reduced, so that the calculated quantity is reduced, and the query efficiency is improved.
It should be noted that the method for querying a person relationship provided in the embodiment of the present invention may be applied to a device such as a mobile phone, a computer, and a server for querying a person relationship.
Referring to fig. 3, fig. 3 is a schematic flow chart of another method for querying a relationship between people according to an embodiment of the present invention, as shown in fig. 3, including:
301. and acquiring all personnel data as personnel nodes.
All the personnel data are determined according to the required personnel relationship map, when the required personnel relationship map is the personnel relationship map of a city, all the personnel data of the city are acquired as nodes, and the personnel data of the city can be acquired by taking a snapshot through a global camera deployed in the whole city; when the required personnel relation map is the personnel relation map of a cell, all personnel data of the cell are obtained as nodes, and the data of all personnel of the cell can be obtained by capturing through a global camera deployed in the whole cell.
302. And acquiring every two person relationship data as attribute edges.
The relationship data of the two people may be peer relationship data, that is, image data captured by the same camera at the same time in the same place, or natural relationship data in an identity library, where the natural relationship data refers to a naturally existing relationship type, such as a relationship type of no wife, mother and child, father and child, brother, sister, other relatives, friends, colleagues, strangers, and the like.
Traversing and detecting whether a predefined relationship type exists between two persons; the predefined relationship types include: there are no wife, mother and child, father and child, brother, sister, other relatives, friends, co-workers, etc. The relationship type may be determined based on natural relationship data in the identity repository.
And if a predefined relationship type exists between the two persons, determining a relationship attribute value between the two persons according to the relationship type, wherein the relationship type and the relationship attribute value have a mapping relationship. The mapping relationship can be as shown in table 1, where the relationship type is couple, mother and child, and father and child, the relationship attribute value is 1.00, the relationship type is brother, sister, the relationship attribute value is 0.90, the relationship type is other relatives, the relationship attribute value is 0.80, the relationship type is friend, the relationship attribute value is 0.75, and the relationship type is coworkers, the relationship attribute value is 0.70.
Figure BDA0002226999500000151
TABLE 1
If the predefined relationship type does not exist between the two persons, the relationship type is indicated as stranger, the same-row attribute exists, calculation can be performed according to the number of the same row, and the attribute value is in the interval (0, 0.70). The attribute value for a stranger of the type of relationship can be calculated by the formula n/100 x 60% (where n represents the number of co-ordinates), at 0.69 for values above 0.70.
In some possible embodiments, the expression 0.7-0.83 can be usedn+1And calculating the attribute value when the relation type is stranger, wherein n is more than or equal to 1.
And forming attribute edges corresponding to every two personnel nodes according to the relationship attribute values or the attribute values in the same row so as to endow the attribute edges with corresponding attribute values, and simultaneously knowing the attribute values corresponding to the attribute edges when inquiring each attribute edge.
303. And connecting the corresponding personnel nodes through the attribute edges to form a personnel relationship map.
The two personnel nodes are connected through corresponding attribute edges, one attribute edge corresponds to two personnel nodes, and one personnel node can correspond to a plurality of attribute edges, so that a personnel relationship map of all personnel is obtained, as shown in fig. 4.
304. And acquiring a personnel relation map.
305. And acquiring a target person node to be searched and a query condition.
306. And deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold.
307. And obtaining the relation map of the target person based on the undeleted attribute sides, and displaying the relation map of the target person.
In the steps, the change from the personnel relation map to the target personnel relation map is more visual by constructing the personnel relation map in advance.
It should be noted that the method for querying a person relationship provided in the embodiment of the present invention may be applied to a device such as a mobile phone, a computer, and a server for querying a person relationship.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an inquiry apparatus for personal relationships according to an embodiment of the present invention, as shown in fig. 5, including:
a first obtaining module 501, configured to obtain a staff relationship graph, where the staff relationship graph includes staff nodes and attribute edges connected to the staff nodes, and the attribute edges include attribute values;
a second obtaining module 502, configured to obtain a target person node to be searched and a query condition, where the query condition includes a query depth and an attribute value threshold, and the query depth represents a maximum number of continuous attribute edges using the target person node as a starting point;
a processing module 503, configured to delete the attribute edge directly and/or indirectly connected to the target person node according to the query depth and the attribute value threshold;
a display module 504, configured to obtain a relationship graph of a target person based on an undeleted attribute edge, and display the relationship graph of the target person, where the relationship graph includes the target person and a person node directly or indirectly connected to the target person through the attribute edge.
Optionally, as shown in fig. 5, the query depth is a single-value query depth, where the processing module 503 is further configured to, within the query depth range, determine, as an invalid attribute edge, an attribute edge, of the detected attribute edges directly or indirectly connected to the target person node, whose attribute value is smaller than the attribute value threshold, delete the invalid attribute edge, determine, as a valid attribute edge, an attribute edge, of the detected attribute edges directly or indirectly connected to the target person node, whose attribute value is greater than or equal to the attribute value threshold, and keep the valid attribute edge directly or indirectly connected to the target person node;
the display module 504 is further configured to obtain a relationship graph of the target person based on the effective attribute edges directly or indirectly connected to the target person nodes.
Optionally, as shown in fig. 6, the query depth is an interval query depth including a minimum query depth and a maximum query depth, and the processing module 503 includes:
a first processing unit 5031, configured to reserve attribute edges directly and/or indirectly connected to the target person node within the minimum query depth range;
a second processing unit 5032, configured to determine, as an invalid attribute edge, an attribute edge whose attribute value is smaller than the attribute value threshold among the detected attribute edges directly or indirectly connected to the target person node outside the minimum query depth range and within the maximum query depth range, delete the invalid attribute edge, determine, as a valid attribute edge, an attribute edge whose attribute value is greater than or equal to the attribute value threshold among the detected attribute edges directly or indirectly connected to the target person node, and keep the valid attribute edge directly or indirectly connected to the target person node.
Optionally, as shown in fig. 7, the first obtaining module 501 includes:
a first acquiring unit 5011 configured to acquire all the person data as person nodes; and
the second obtaining unit 5012 is configured to obtain every two pieces of person relationship data as attribute edges, where the relationship data includes attribute values;
the connection unit 5013 is configured to connect corresponding person nodes through the attribute edges to form a person relationship graph.
Optionally, as shown in fig. 8, the attribute values include a relationship attribute value and a peer attribute value, where the peer attribute value is smaller than the relationship attribute value, and the second obtaining unit 5012 includes:
a detection subunit 50121, configured to traverse to detect whether a predefined relationship type exists between two people;
the first calculating subunit 50122 is configured to determine, if a predefined relationship type exists between two persons, a relationship attribute value between the two persons according to the relationship type, where the relationship type and the relationship attribute value have a mapping relationship in advance;
the second calculating subunit 50123 is configured to, if a predefined relationship type does not exist between the two people, detect whether a peer attribute exists between the two people;
the processing subunit 50124 is configured to form an attribute edge corresponding to each two person nodes according to the relationship attribute value or the peer attribute value.
Optionally, as shown in fig. 5, the display module 504 is further configured to perform differential display on each attribute edge according to an attribute value or a query depth of each attribute edge in the relationship graph of the target person.
It should be noted that the query device for person relationship provided in the embodiment of the present invention may be applied to devices such as a mobile phone, a computer, and a server for querying person relationship.
The query device for the personnel relationship provided by the embodiment of the invention can realize each process realized by the query method for the personnel relationship in the method embodiment, and can achieve the same beneficial effect. To avoid repetition, further description is omitted here.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 9, including: a memory 902, a processor 901 and a computer program stored on the memory 902 and executable on the processor 901, wherein:
the processor 901 is used for calling the computer program stored in the memory 902 and executing the following steps:
acquiring a personnel relation graph, wherein the personnel relation graph comprises personnel nodes and attribute edges connected with the personnel nodes, and the attribute edges comprise attribute values;
acquiring target personnel nodes to be searched and query conditions, wherein the query conditions comprise query depth and attribute value thresholds, and the query depth represents the maximum continuous attribute edge number taking the target personnel nodes as starting points;
deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold;
and obtaining a relation graph of a target person based on the undeleted attribute edges, and displaying the relation graph of the target person, wherein the relation graph comprises the target person and a person node directly or indirectly connected with the target person through the attribute edges.
Optionally, the query depth is a single-value query depth, and the deleting, performed by the processor 901, the attribute edge directly or indirectly connected to the target person node according to the query depth and the attribute value threshold includes:
in the query depth range, confirming the detected attribute edges with the attribute values smaller than the attribute value threshold value among the attribute edges directly or indirectly connected with the target personnel node as invalid attribute edges, deleting the invalid attribute edges, confirming the detected attribute edges with the attribute values larger than or equal to the attribute value threshold value among the attribute edges directly or indirectly connected with the target personnel node as valid attribute edges, and keeping the valid attribute edges directly or indirectly connected with the target personnel node;
the obtaining of the relationship graph of the target person based on the undeleted attribute edges comprises:
and obtaining the relation map of the target personnel based on the effective attribute edges directly or indirectly connected with the target personnel nodes.
Optionally, the query depth is an interval query depth including a minimum query depth and a maximum query depth, and the deleting, performed by the processor 901, the attribute edge directly and/or indirectly connected to the target person node according to the query depth and the attribute value threshold includes:
within the minimum query depth range, preserving attribute edges directly and/or indirectly connected with the target personnel nodes;
and confirming the detected attribute sides with the attribute values smaller than the attribute value threshold value among the attribute sides directly or indirectly connected with the target personnel node as invalid attribute sides, deleting the invalid attribute sides, confirming the detected attribute sides with the attribute values larger than or equal to the attribute value threshold value among the attribute sides directly or indirectly connected with the target personnel node as valid attribute sides, and keeping the valid attribute sides directly or indirectly connected with the target personnel node within the minimum query depth range and the maximum query depth range.
Optionally, the obtaining the person relationship map performed by the processor 901 includes:
acquiring all personnel data as personnel nodes; and
acquiring every two personnel relationship data as attribute edges, wherein the relationship data comprise attribute values;
and connecting the corresponding personnel nodes through the attribute edges to form a personnel relationship map.
Optionally, the attribute values include a relationship attribute value and a peer attribute value, where the peer attribute value is smaller than the relationship attribute value, and the obtaining of every two pieces of personnel relationship data executed by the processor 901 as an attribute edge includes:
traversing and detecting whether a predefined relationship type exists between two persons;
if a predefined relationship type exists between two persons, determining a relationship attribute value between the two persons according to the relationship type, wherein the relationship type and the relationship attribute value have a mapping relationship in advance;
if the predefined relationship type does not exist between the two persons, detecting whether the two persons have the same-row attribute;
and forming attribute edges corresponding to every two personnel nodes according to the relationship attribute values or the same row attribute values.
Optionally, the displaying of the relationship graph of the target person performed by the processor 901 includes:
and according to the attribute value corresponding to each attribute side or the query depth of each attribute side in the relation graph of the target person, performing differential display on each attribute side.
The electronic device may be a mobile phone, a computer, a server, or the like, which can be applied to query the relationship between people.
The electronic device provided by the embodiment of the present invention can implement each process implemented by the method for querying a person relationship in the foregoing method embodiments, and is not described here again to avoid repetition. And the same beneficial effects can be achieved.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the query method for a person relationship provided in the embodiment of the present invention, and can achieve the same technical effect, and in order to avoid repetition, the computer program is not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. A method for querying a person relationship is characterized by comprising the following steps:
acquiring a personnel relation graph, wherein the personnel relation graph comprises personnel nodes and attribute edges connected with the personnel nodes, and the attribute edges comprise attribute values;
acquiring target personnel nodes to be searched and query conditions, wherein the query conditions comprise query depth and attribute value thresholds, and the query depth represents the maximum continuous attribute edge number taking the target personnel nodes as starting points;
deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold;
and obtaining a relation graph of a target person based on the undeleted attribute edges, and displaying the relation graph of the target person, wherein the relation graph comprises the target person and a person node directly or indirectly connected with the target person through the attribute edges.
2. The method of claim 1, wherein said deleting attribute edges directly or indirectly connected to the target person node based on the query depth and the attribute value threshold comprises:
in the query depth range, confirming the detected attribute edges with the attribute values smaller than the attribute value threshold value among the attribute edges directly or indirectly connected with the target personnel node as invalid attribute edges, deleting the invalid attribute edges, confirming the detected attribute edges with the attribute values larger than or equal to the attribute value threshold value among the attribute edges directly or indirectly connected with the target personnel node as valid attribute edges, and keeping the valid attribute edges directly or indirectly connected with the target personnel node;
the obtaining of the relationship graph of the target person based on the undeleted attribute edges comprises:
and obtaining the relation map of the target personnel based on the effective attribute edges directly or indirectly connected with the target personnel nodes.
3. The method of claim 2, wherein when the query depth is a single-valued query depth, the query depth range represents a range starting at the target person node and having the single-valued query depth as a maximum number of consecutive attribute edges;
and when the query depth is an interval query depth comprising a minimum query depth and a maximum query depth, the query depth range represents an annular range with the minimum query depth as an inner diameter and the maximum query depth as an outer diameter, and attribute edges directly and/or indirectly connected with the target personnel nodes are reserved in the minimum query depth range.
4. The method of claim 1, wherein the obtaining a people relationship graph comprises:
acquiring all personnel data as personnel nodes; and
acquiring every two personnel relationship data as attribute edges, wherein the relationship data comprise attribute values;
and connecting the corresponding personnel nodes through the attribute edges to form a personnel relationship map.
5. The method of claim 4, wherein the attribute values include a relationship attribute value and a peer attribute value, the peer attribute value being less than the relationship attribute value, the obtaining each two people relationship data as an attribute edge comprising:
traversing and detecting whether a predefined relationship type exists between two persons;
if a predefined relationship type exists between two persons, determining a relationship attribute value between the two persons according to the relationship type, wherein the relationship type and the relationship attribute value have a mapping relationship in advance;
if the predefined relationship type does not exist between the two persons, detecting whether the two persons have the same-row attribute;
and forming attribute edges corresponding to every two personnel nodes according to the relationship attribute values or the same row attribute values.
6. The method of any one of claims 1 to 5, wherein the displaying the relationship graph of the target person comprises:
and according to the attribute value corresponding to each attribute side or the query depth of each attribute side in the relation graph of the target person, performing differential display on each attribute side.
7. An apparatus for querying a relationship between persons, the apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a personnel relation graph, the personnel relation graph comprises personnel nodes and attribute edges connected with the personnel nodes, and the attribute edges comprise attribute values;
the second acquisition module is used for acquiring a target person node to be searched and a query condition, wherein the query condition comprises a query depth and an attribute value threshold, and the query depth represents the maximum continuous attribute edge number taking the target person node as a starting point;
the processing module is used for deleting the attribute edges directly and/or indirectly connected with the target personnel nodes according to the query depth and the attribute value threshold;
and the display module is used for obtaining a relation graph of the target person based on the undeleted attribute edges and displaying the relation graph of the target person, wherein the relation graph comprises the target person and a person node directly or indirectly connected with the target person through the attribute edges.
8. The apparatus of claim 7, wherein the processing module is further configured to delete an invalid attribute edge when detecting that an invalid attribute edge whose attribute value is smaller than the attribute value threshold exists in attribute edges directly or indirectly connected to the target human node within the query depth range, and keep obtaining valid attribute edges directly or indirectly connected to the target human node;
the display module is further used for obtaining the relation map of the target person based on the effective attribute edges directly or indirectly connected with the target person nodes.
9. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor implementing the steps in the query method of person relationships according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, implements the steps in the query method for person relations as claimed in any one of claims 1 to 6.
CN201910955085.1A 2019-09-30 2019-10-09 Personnel relationship query method and device, electronic equipment and storage medium Active CN110825821B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910944488 2019-09-30
CN2019109444886 2019-09-30

Publications (2)

Publication Number Publication Date
CN110825821A true CN110825821A (en) 2020-02-21
CN110825821B CN110825821B (en) 2022-11-22

Family

ID=69548878

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910955085.1A Active CN110825821B (en) 2019-09-30 2019-10-09 Personnel relationship query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110825821B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113157756A (en) * 2021-05-12 2021-07-23 广州虎牙科技有限公司 Interactive data statistical method and device, electronic equipment and storage medium
CN113254763A (en) * 2021-04-30 2021-08-13 青岛以萨数据技术有限公司 Data analysis method and device based on open source arangodb and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120158633A1 (en) * 2002-12-10 2012-06-21 Jeffrey Scott Eder Knowledge graph based search system
US20180197111A1 (en) * 2015-10-28 2018-07-12 Fractal Industries, Inc. Transfer learning and domain adaptation using distributable data models
CN108536702A (en) * 2017-03-02 2018-09-14 腾讯科技(深圳)有限公司 A kind of related entities determine method, apparatus and computing device
CN109241291A (en) * 2018-07-18 2019-01-18 华南师范大学 Knowledge mapping optimal path inquiry system and method based on deeply study
CN109389303A (en) * 2018-09-28 2019-02-26 苏州朗动网络科技有限公司 Querying method, device, computer equipment and the storage medium of business connection
CN109710599A (en) * 2018-12-14 2019-05-03 浪潮软件集团有限公司 A kind of group dividing method and device of knowledge based map
CN109740034A (en) * 2018-12-20 2019-05-10 北京华夏电通科技有限公司 The case-involving information query method of enterprise and device based on graphic data base
CN110209826A (en) * 2018-02-06 2019-09-06 武汉观图信息科技有限公司 A kind of financial map construction and analysis method towards bank risk control

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120158633A1 (en) * 2002-12-10 2012-06-21 Jeffrey Scott Eder Knowledge graph based search system
US20180197111A1 (en) * 2015-10-28 2018-07-12 Fractal Industries, Inc. Transfer learning and domain adaptation using distributable data models
CN108536702A (en) * 2017-03-02 2018-09-14 腾讯科技(深圳)有限公司 A kind of related entities determine method, apparatus and computing device
CN110209826A (en) * 2018-02-06 2019-09-06 武汉观图信息科技有限公司 A kind of financial map construction and analysis method towards bank risk control
CN109241291A (en) * 2018-07-18 2019-01-18 华南师范大学 Knowledge mapping optimal path inquiry system and method based on deeply study
CN109389303A (en) * 2018-09-28 2019-02-26 苏州朗动网络科技有限公司 Querying method, device, computer equipment and the storage medium of business connection
CN109710599A (en) * 2018-12-14 2019-05-03 浪潮软件集团有限公司 A kind of group dividing method and device of knowledge based map
CN109740034A (en) * 2018-12-20 2019-05-10 北京华夏电通科技有限公司 The case-involving information query method of enterprise and device based on graphic data base

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BENJAMIN KWAPONG 等: "A Knowledge Graph Based Framework for Web API Recommendation", 《 IEEE WORLD CONGRESS ON SERVICES 》 *
吴山: "国际竞争情报研究的知识图谱——基于CiteSpace的知识计量分析", 《现代情报》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254763A (en) * 2021-04-30 2021-08-13 青岛以萨数据技术有限公司 Data analysis method and device based on open source arangodb and storage medium
CN113157756A (en) * 2021-05-12 2021-07-23 广州虎牙科技有限公司 Interactive data statistical method and device, electronic equipment and storage medium
CN113157756B (en) * 2021-05-12 2023-11-21 广州虎牙科技有限公司 Interactive data statistics method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110825821B (en) 2022-11-22

Similar Documents

Publication Publication Date Title
US9378408B2 (en) Assisted photo-tagging with facial recognition models
US20180046855A1 (en) Face detection and recognition
US8270684B2 (en) Automatic media sharing via shutter click
US8520909B2 (en) Automatic and semi-automatic image classification, annotation and tagging through the use of image acquisition parameters and metadata
CN110765215A (en) Query method and device for personnel common relationship, electronic equipment and storage medium
CN105302428B (en) Dynamic information display method and device based on social network
US20160292494A1 (en) Face detection and recognition
WO2015070320A1 (en) Face detection and recognition
US20110025710A1 (en) Systems and methods for image archeology
CN109063784B (en) Character clothing image data screening method and device
KR101782590B1 (en) Method for Providing and Recommending Related Tag Using Image Analysis
KR101832680B1 (en) Searching for events by attendants
CN110825821B (en) Personnel relationship query method and device, electronic equipment and storage medium
JP2007011637A (en) Image management device
Adams et al. Extraction of social context and application to personal multimedia exploration
Jiang et al. Camera fingerprint: A new perspective for identifying user's identity
CN110825822B (en) Personnel relationship query method and device, electronic equipment and storage medium
CN103093213B (en) Video file classification method and terminal
KR101138873B1 (en) Method and apparatus for reducing the number of photo in photo album
JP6244887B2 (en) Information processing apparatus, image search method, and program
KR101100429B1 (en) Semi automatic enrollment method and apparatus of photo album, and photo album system using them
CN111694979A (en) Archive management method, system, equipment and medium based on image
CN111783786A (en) Picture identification method and system, electronic equipment and storage medium
CN103886031A (en) Method and equipment for image browsing
WO2022261801A1 (en) Method for operating an electronic device to browse a collection of images

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant