A method and system for automatically generating family tree and genealogy
By constructing a family member graph structure, calculating blood distance and intimacy, and optimizing the display effect of the family tree system, it solves the problem of low efficiency in querying related information in the existing system, and achieves more efficient generation and display of family trees.
Patent Information
- Application Number
- CN202410728644.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-06
AI Technical Summary
The existing family tree genealogy system has a poor display effect when querying the related information of family members, and cannot quickly and accurately determine the members who are closely related to the query members, resulting in a decrease in efficiency.
By constructing a graph structure between family members, calculate the blood distance and closeness, combine the closeness and blood distance in each path, calculate the correlation value, determine the degree of outliers and importance, and adjust the order of information calling to optimize the display.
It improves the generation efficiency and display effect of family trees, can better reflect the blood and social relationships between family members, and ensures the adaptability and accuracy of the display.
Smart Images

Figure CN118297145B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of family information management, and in particular to a method and system for automatically generating a family tree or genealogy. Background Art
[0002] A family tree can reflect the blood relationship between family members. By browsing a family tree, users can easily know the blood relationship between the members of the family. With the increasing attention paid to family history and traditional culture, more and more families have begun to pay attention to the compilation and preservation of family trees. The emergence of automatic generation technology of family trees meets this demand and provides people with more convenient and efficient family tree compilation tools. However, the family tree system may be affected by the excessive amount of information of family members, resulting in a decrease in speed or efficiency. As the number of family members increases, the system needs to process more data, including names, birthdays, relationships, personal experiences and other information, which may cause the system to require more computing resources and time when generating and presenting family trees. When querying the relationship between a member of a family and other members of the family, in order to better reflect the relationship between the queried member and other members, it is generally necessary to first view the information of members who are closer to the current member. However, due to the large amount of information in the family tree, it is impossible to quickly and accurately determine the members with greater correlation with it, which leads to poor display effect of the display interface when querying the correlation information between a member and other members. Summary of the invention
[0003] In order to solve the problem that the existing method has poor display effect when querying the association information between a member and other members in a family tree, the purpose of the present invention is to provide a method and system for automatically generating a family tree. The technical solution adopted is as follows:
[0004] In a first aspect, the present invention provides a method for automatically generating a family tree, the method comprising the following steps:
[0005] Obtain the relationship between the direct relatives of the family members and the profile information of each family member; construct a graph structure based on the relationship between the direct relatives of the family members, where the nodes of the graph structure are members;
[0006] Based on the graph structure, the blood relationship distance between every two members is obtained; based on the similarity between the profile information of every two members, the intimacy between every two members is determined; based on the intimacy between the members passed through in each path between every two members in the graph structure and the corresponding two members and the blood relationship distance, the degradation degree of the blood relationship between every two members is obtained; and the correlation value between every two members is obtained by combining the blood relationship distance, intimacy and the degradation degree between every two members;
[0007] Determine the degree of outlier corresponding to each member based on the correlation value; obtain the importance of each member when accessing the information of other members according to the degree of outlier and the correlation value;
[0008] The family tree is displayed based on the importance.
[0009] Preferably, the step of constructing a graph structure based on the relationship between the direct relatives of the family members includes:
[0010] Build a graph structure based on the relationships between all members of the family;
[0011] Among them, when constructing the graph structure, if the relationship between two members is a father-child relationship or a mother-child relationship, the corresponding two members are connected, and the weight of the connecting edge between the corresponding two members is set to a preset first value; if the relationship between the two members is a grandfather-grandson relationship, the corresponding two members are connected, and the weight of the connecting edge between the corresponding two members is set to a preset second value; the preset first value is less than the preset second value.
[0012] Preferably, determining the intimacy between each two members according to the similarity between the profile information of each two members includes:
[0013] For the i-th member and the j-th member:
[0014] Use word2vec to convert each profile information of the i-th user and each profile information of the j-th member into corresponding word vectors; obtain the inverse document frequency corresponding to each word vector;
[0015] If there is an overlapping time period between any profile information of the i-th user and any profile information of the j-th member, the word vectors corresponding to the two profile information are taken as a matching vector pair;
[0016] Calculate the cosine similarity of the two word vectors in each matching vector pair; take the sum of the inverse document frequencies corresponding to the two word vectors in each matching vector pair as the frequency representation value of each matching vector pair; record the product of the cosine similarity of the two word vectors in each matching vector pair and the corresponding frequency representation value as the first product of each matching vector pair; record the maximum value of the first products of all matching vector pairs as the similarity evaluation value between the i-th member and the j-th member;
[0017] According to the length of the overlapping time periods in the two profile information corresponding to the two word vectors in each matching pair and the similarity evaluation value, the intimacy between the i-th member and the j-th member is obtained.
[0018] Preferably, the following formula is used to calculate the intimacy between the i-th member and the j-th member:
[0019]
[0020] in, represents the intimacy between the i-th member and the j-th member, represents the number of matching vector pairs, Indicates the length of the overlapping time period of the brief information of the two word vectors in the rth matching vector pair, Indicates the duration of the brief information of the word vector corresponding to the i-th member in the r-th matching vector pair, Indicates the duration of the brief information of the word vector corresponding to the jth member in the rth matching vector pair, Represents the similarity evaluation value between the i-th member and the j-th member.
[0021] Preferably, obtaining the degree of degradation of the blood relationship between every two members according to the intimacy and blood distance between the members passed through in each path between every two members in the graph structure and the corresponding two members includes:
[0022] For the i-th member and the j-th member:
[0023] The path whose blood relationship distance between the i-th member and the j-th member is less than the preset distance threshold among all the paths between the i-th member and the j-th member is determined as the target path between the i-th member and the j-th member;
[0024] For the kth target path: the ratio of the degree of intimacy between each member passed by the kth target path and the i-th member and the blood relationship distance between each member passed by the kth target path and the j-th member is used as the first characteristic value of each member passed by the kth target path; the ratio of the degree of intimacy between each member passed by the kth target path and the j-th member and the blood relationship distance between each member passed by the kth target path and the i-th member is used as the second characteristic value of each member passed by the kth target path; the maximum value of the first characteristic value and the second characteristic value of each member passed by the kth target path is used as the characteristic index of each member passed by the kth target path; the average value of the characteristic indexes of all members passed by the kth target path is used as the relationship evaluation value of the kth target path;
[0025] The negative correlation normalization result of the maximum value of the relationship evaluation value on all target paths is determined as the degradation degree of the blood relationship between the i-th member and the j-th member.
[0026] Preferably, the following formula is used to calculate the correlation value between the i-th member and the j-th member:
[0027]
[0028] in, represents the correlation value between the i-th member and the j-th member, represents the degree of degradation of the blood relationship between the i-th member and the j-th member, represents the blood relationship distance between the i-th member and the j-th member, represents the degree of intimacy between the i-th member and the j-th member, and exp( ) represents an exponential function with a natural constant as the base.
[0029] Preferably, determining the outlier degree corresponding to each member based on the correlation value includes:
[0030] For the i-th member and the j-th member: the negative correlation normalized result of the correlation value between the i-th member and the j-th member is used as the distance measure between the i-th member and the j-th member;
[0031] Based on the distance measurement between every two members, the local anomaly factor detection algorithm is used to detect all members and obtain the outlier degree corresponding to each member.
[0032] Preferably, obtaining the importance of each member when accessing information of other members according to the outlier degree and the correlation value includes:
[0033] When the i-th member accesses the information of the z-th member, the product of the negative correlation normalized result of the outlier degree corresponding to the i-th member and the correlation value between the i-th member and the z-th member is determined as the importance corresponding to the i-th member when accessing the information of the z-th member.
[0034] Preferably, the display of the family tree based on the importance level includes:
[0035] For the zth member:
[0036] When accessing the information of the zth member, based on the corresponding importance of other members except the zth member when accessing the information of the zth member, the information of the corresponding members is retrieved in sequence and displayed in the display interface; wherein the importance is positively correlated with the retrieval order.
[0037] In a second aspect, the present invention provides a system for automatically generating a family tree or genealogy, comprising a memory and a processor, wherein the processor executes a computer program stored in the memory to implement the above-mentioned method for automatically generating a family tree or genealogy.
[0038] The present invention has at least the following beneficial effects:
[0039] The present invention constructs a corresponding graph structure based on the relationship between the direct relatives of the family members, obtains the blood relationship distance between every two members according to the graph structure, and avoids the problem that the traditional tree-structured family tree cannot well display the complex blood relationship; then the closeness of the relationship between the two members is quantified through the profile information of each member, and the intimacy between every two members is obtained. By combining the intimacy and blood relationship distance between the members passed through in each path between every two members in the family and the corresponding two members, the correlation between the members is evaluated, and the correlation value between every two members is obtained. The correlation value can well reflect the closeness of the blood relationship and social relationship between each member and the other members in the family; then the degree of outlier corresponding to each member is determined according to the correlation value, and the corresponding importance of each member when accessing the information of other members is obtained in combination with the family relationship corresponding to each member, and the information calling order is adjusted according to the importance, and then the family tree is displayed, so that the family tree can be displayed adaptively according to the blood relationship and social relationship between the visited member and other members, and the display effect of the family tree is better, which effectively improves the generation efficiency of the family tree, and is convenient for the retrieval and management of family information. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A flow chart of a method for automatically generating a family tree and genealogy provided by an embodiment of the present invention;
[0042] Figure 2 The figure is a flowchart of a method for obtaining a correlation value. DETAILED DESCRIPTION
[0043] In order to further illustrate the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the following is a detailed description of a method and system for automatically generating a family tree and genealogy proposed by the present invention in combination with the accompanying drawings and preferred embodiments.
[0044] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0045] The following is a detailed description of the specific scheme of the method and system for automatically generating a family tree and genealogy provided by the present invention in conjunction with the accompanying drawings.
[0046] An embodiment of a method for automatically generating a family tree:
[0047] The specific scenario targeted by this embodiment is: when querying the relationship between a member in a family tree and other members of the family, it is generally necessary to first view the information of members who are closer to the current member, so it is necessary to set a suitable retrieval order. This embodiment will analyze the degree of intimacy and blood distance between the members passed through in each path between each two members and the corresponding two members to determine the corresponding degree of outlier of each member, and then obtain the corresponding importance of each member when accessing the information of other members, and use the importance to determine the retrieval order of information of other members in the family, and then display it on the display interface.
[0048] This embodiment proposes a method for automatically generating a family tree. Figure 1 As shown, a method for automatically generating a family tree in this embodiment includes the following steps:
[0049] Step S1, obtaining the relationship between the direct relatives of the family members and the profile information of each family member; constructing a graph structure based on the relationship between the direct relatives of the family members, wherein the nodes of the graph structure are members.
[0050] This embodiment first collects the relationship between the members of the family and the profile information of each member of the family. For any member, the profile information is as follows: On March 15, 1970, the member was born in a certain city in a certain province of China. He was born in a poor family, but he showed diligence and intelligence since he was a child; from 1988 to 1992: the member studied in a certain high school in a certain city, with excellent grades, and actively participated in school clubs and volunteer activities; from 1992 to 1996: the member entered a certain university in a certain province to study business management, and performed well during his time at school and obtained a bachelor's degree; from 1997 to 2003: the member began to hold a management position in a certain enterprise, and through his own efforts and innovation, he led the enterprise to achieve rapid development and expansion; in 2004: the member established his own charitable foundation, dedicated to education and medical care, and made positive contributions to society; from 2010 to 2022: the member continued to serve as the leader of the family business and achieved greater achievements in charity, etc. "On March 15, 1970, this member was born in a certain city in a certain province in China. He was born into a poor family, but he has been diligent and smart since he was a child" is a brief information, "From 1988 to 1992: This member studied in a certain high school in a certain city, had excellent grades, and actively participated in school clubs and volunteer activities" is a brief information, and so on, multiple brief information of this member can be obtained. So far, the relationship between the direct relatives of the family members and multiple brief information of each family member have been obtained.
[0051] Due to the complexity of the relationship between people in the family structure, when the blood relationship is far, two people may appear in different family structures. At this time, the traditional tree structure cannot well display the blood relationship between the two members. The graph structure can flexibly represent various complex family relationships, so as to have a deeper understanding of family history and tradition. Therefore, this embodiment constructs a graph structure based on the relationship between the direct relatives of family members. Each node in the graph structure is a family member. If the relationship between the two members is a father-son relationship or a mother-son relationship, the corresponding two members are connected, and the weight of the connection edge between the corresponding two members is set to a preset first value; if the relationship between the two members is a grandfather-grandson relationship, the corresponding two members are connected, and the weight of the connection edge between the corresponding two members is set to a preset second value; the preset first value is less than the preset second value; when the relationship between the two members is not within the direct relatives, there is no connection edge between the two members. In this embodiment, the preset first value is 1, and the preset second value is 2. In specific applications, the implementer can set it according to the specific situation.
[0052] So far, this embodiment has constructed a graph structure based on the relationship between direct relatives of family members.
[0053] Step S2, based on the graph structure, obtain the blood relationship distance between every two members; determine the degree of intimacy between every two members according to the similarity between the profile information of every two members; based on the graph structure, obtain the blood relationship distance between every two members; obtain the degree of degradation of the blood relationship between every two members according to the degree of intimacy and blood relationship distance between the members passed through in each path between every two members in the graph structure and the corresponding two members; obtain the correlation value between every two members by combining the blood relationship distance, intimacy and degradation degree between every two members.
[0054] Since the closeness of social relations between different members is often not taken into account in the traditional process of generating family pedigrees, the generation and display efficiency of a family pedigree that is too large will be reduced. Therefore, this embodiment will combine the profile information of different members, and quantify the correlation between two members on the basis of considering the blood relationship between the two members, and then analyze the degree to which each member is a core member in its corresponding family based on the correlation between the members; considering that different visitors should pay more attention to their relatives who have a closer relationship with them during the display of the family pedigree, the importance of each member is quantified by using the correlation between each member and the visiting member, and then the call and display of each member node is performed according to the importance, which can improve the generation efficiency of the family pedigree.
[0055] Step S21, obtaining the blood relationship distance between every two members based on the graph structure; and determining the degree of intimacy between every two members according to the similarity between the profile information of every two members.
[0056] In the constructed graph structure, the blood relationship between two different members depends on the shortest path between the two members in the corresponding graph structure. Here, the single-source shortest path (Dijkstra) algorithm is used to obtain the shortest path between any two members, and the sum of the weights of all connecting edges in the shortest path is used as the blood relationship distance between the two members for subsequent analysis. The Dijkstra algorithm is an existing technology and will not be described in detail here.
[0057] Considering that different people live in different historical periods, and that different people have different social relationships with other members in their era, it is considered to use the profile data of each member to quantify the intimacy between each member, and then the importance of the social attributes of different people in the family tree and the closeness of their relationships with other family members can be expressed based on the intimacy between different members. Based on this, this embodiment will evaluate the intimacy between each two members based on the similarity between the profile information of each two members.
[0058] Specifically, for the i-th member and the j-th member:
[0059] Use word2vec to convert each profile information of the i-th user and each profile information of the j-th member into corresponding word vectors; obtain the inverse document frequency corresponding to each word vector; the process of obtaining word2vec and inverse document frequency are both existing technologies and will not be described in detail here.
[0060] If there is an overlapping time period between any profile information of the ith user and any profile information of the jth member, the word vectors corresponding to the two corresponding profile information are taken as a matching vector pair, that is, multiple matching vector pairs can be obtained. Calculate the cosine similarity of the two word vectors in each matching vector pair; take the sum of the inverse document frequencies corresponding to the two word vectors in each matching vector pair as the frequency representation value of each matching vector pair, each matching vector pair corresponds to a frequency representation value, and record the product of the cosine similarity of the two word vectors in each matching vector pair and the corresponding frequency representation value as the first product of each matching vector pair; record the maximum value of the first product of all matching vector pairs as the similarity evaluation value between the ith member and the jth member; obtain the intimacy between the ith member and the jth member based on the length of the overlapping time period in the two profile information corresponding to the two word vectors in each matching pair and the similarity evaluation value. The specific calculation formula for the intimacy between the ith member and the jth member is:
[0061]
[0062] in, represents the intimacy between the i-th member and the j-th member, represents the number of matching vector pairs, Indicates the length of the overlapping time period of the brief information of the two word vectors in the rth matching vector pair, Indicates the duration of the brief information of the word vector corresponding to the i-th member in the r-th matching vector pair, Indicates the duration of the brief information of the word vector corresponding to the jth member in the rth matching vector pair, Represents the similarity evaluation value between the i-th member and the j-th member.
[0063] It is used to characterize the size of the overlap ratio of two time periods as the weight of the similarity of profile information. When the similarity evaluation value between the i-th member and the j-th member is larger and the similarity weight is larger, it means that the similarity between the i-th member and the j-th member is higher, that is, the intimacy between the i-th member and the j-th member is greater.
[0064] By using the above method, the intimacy between the i-th member and the j-th member can be obtained.
[0065] Step S22, obtaining the degree of degradation of the blood relationship between every two members according to the intimacy and blood distance between the members passed through in each path between every two members in the graph structure and the corresponding two members.
[0066] When measuring the size of the correlation between two member nodes, it is necessary to consider not only the distance of the blood relationship between the two member nodes, but also the intimacy between different member nodes; therefore, multiple paths between two member nodes in the graph structure are considered, which can represent the family relationship represented by different blood relationships between the two member nodes. If there is a close correlation between one or more of the multiple paths between the two, the final correlation between the two should be strong. Based on this, this embodiment will evaluate the intimacy and blood relationship distance between the members passed through in each path between each two members and the corresponding two members, and determine the degree of degradation of the blood relationship between each two members.
[0067] Specifically, for the i-th member and the j-th member:
[0068] Among all the paths between the i-th member and the j-th member, the path whose blood relationship distance is less than the preset distance threshold is determined as the target path between the i-th member and the j-th member, that is, multiple target paths between the i-th member and the j-th member can be obtained. The preset distance threshold in this embodiment is 7, and in specific applications, the implementer can set it according to specific circumstances. For the kth target path: the ratio of the degree of intimacy between each member passed by the kth target path and the ith member and the blood relationship distance between each member passed by the kth target path and the jth member is used as the first characteristic value of each member passed by the kth target path; the ratio of the degree of intimacy between each member passed by the kth target path and the jth member and the blood relationship distance between each member passed by the kth target path and the ith member is used as the second characteristic value of each member passed by the kth target path; the maximum value of the first characteristic value and the second characteristic value of each member passed by the kth target path is used as the characteristic index of each member passed by the kth target path; the average value of the characteristic indexes of all members passed by the kth target path is used as the relationship evaluation value of the kth target path. By using the above method, the relationship evaluation values of all target paths can be obtained, and the negative correlation normalization result of the maximum value of the relationship evaluation values on all target paths is determined as the degradation degree of the blood relationship between the ith member and the jth member. In this embodiment, the specific calculation formula for the degradation degree of the blood relationship between the i-th member and the j-th member is:
[0069]
[0070] in, represents the degree of degradation of the blood relationship between the i-th member and the j-th member, Represents the maximum value of the relationship evaluation value on all target paths, Represents the normalization function.
[0071] If the first eigenvalue is larger, it means that there are points around the jth member node that are more intimate with the ith member node; if the second eigenvalue is larger, it means that there are points around the ith member node that are more intimate with the jth member node. The relationship evaluation value of the target path represents the closeness of the connection between each node in a certain path between the nodes of the ith member and the jth member and the ith and jth member nodes. The maximum value of the relationship evaluation value on all target paths represents the relationship between the members on the closely connected path between the ith and jth member nodes. At this time, even if the blood relationship between the two nodes is less intimate, it should be given a higher correlation; the negative correlation normalization result is used as the degradation degree of the blood relationship. The closer the relationship, the smaller the degradation degree.
[0072] By adopting the above method, the intimacy between every two members can be obtained.
[0073] Step S23, obtaining the correlation value between every two members by combining the blood relationship distance, intimacy and the degree of degradation between every two members.
[0074] Next, this embodiment will determine the correlation value between every two members based on the blood relationship distance, intimacy and degeneration degree between the members. For the i-th member and the j-th member, the specific calculation formula for the correlation value between them is:
[0075]
[0076] in, represents the correlation value between the i-th member and the j-th member, represents the degree of degradation of the blood relationship between the i-th member and the j-th member, represents the blood relationship distance between the i-th member and the j-th member, represents the degree of intimacy between the i-th member and the j-th member, and exp( ) represents an exponential function with a natural constant as the base.
[0077] When the degree of degradation of the blood relationship between the i-th member and the j-th member is small, The value of is close to 1. At this time, the size of the correlation value between the i-th member and the j-th member depends more on the intimacy between the two. When the degree of degradation of the blood relationship between the i-th member and the j-th member is smaller, the blood relationship between the i-th member and the j-th member is closer, and the intimacy between the i-th member and the j-th member is greater, it means that the correlation between the i-th member and the j-th member is stronger, and the correlation value is greater.
[0078] Using the above method, the correlation value between every two members in the family can be obtained, such as Figure 2 As shown, this figure is a flow chart of the method for obtaining the correlation value.
[0079] Step S3, determining the degree of outlier corresponding to each member based on the correlation value; and obtaining the degree of importance corresponding to each member when accessing the information of other members according to the degree of outlier and the correlation value.
[0080] In step S2, this embodiment determines the correlation value between every two members. Next, anomaly detection is performed on each member based on the correlation value to determine the importance of each member when other members visit it, and then the information of the corresponding members is retrieved in turn and displayed in the display interface.
[0081] Specifically, for the i-th member and the j-th member: the negative correlation normalization result of the correlation value between the i-th member and the j-th member is used as the distance measurement between the i-th member and the j-th member; the specific calculation formula of the distance measurement between the i-th member and the j-th member is: ,in, represents the distance measure between the i-th member and the j-th member, represents the correlation value between the i-th member and the j-th member, Represents an exponential function with a natural constant as the base. Using this method, the distance measurement between every two members in the family can be obtained, which is substituted into the Local Outlier Factor (LOF) algorithm to obtain the degree of outlier corresponding to each member. The LOF algorithm is an existing technology and will not be described in detail here.
[0082] For members with higher degree of outliers, they tend to be marginalized in the family, and their importance should be reduced in the subsequent display of the family tree; conversely, for members with lower degree of outliers, they are closer to core members in the corresponding family tree, and their display priority should be increased in the subsequent display process.
[0083] In this embodiment, the degree of outlier corresponding to each member is obtained based on the blood relationship and social activities between each member and the rest of the family members. However, when different members visit their corresponding family tree, they should not only consider whether each member is a core member in the family, but also consider the size of the correlation between each family member displayed and the visitor. This allows different family members to observe the member information that is closely related to them earlier when visiting the family tree.
[0084] When the i-th member accesses the information of the z-th member, the product of the negative correlation normalization result of the outlier degree corresponding to the i-th member and the correlation value between the i-th member and the z-th member is determined as the importance degree corresponding to the i-th member when accessing the information of the z-th member. The specific calculation formula for the importance degree corresponding to the i-th member when accessing the information of the z-th member is:
[0085]
[0086] in, It indicates the importance of the i-th member when accessing the information of the z-th member. represents the degree of outlier corresponding to the i-th member, represents the correlation value between the ith member and the zth member, and exp( ) represents an exponential function with a natural constant as the base.
[0087] When the outlier degree corresponding to the i-th member is smaller and the correlation value between the i-th member and the z-th member is larger, the importance of the i-th member when accessing the information of the z-th member is greater; when the outlier degree corresponding to the i-th member is larger and the correlation value between the i-th member and the z-th member is smaller, the importance of the i-th member when accessing the information of the z-th member is smaller.
[0088] By adopting the above method, the importance of each member in the family when accessing the information of other members can be obtained.
[0089] Step S4, displaying the family tree based on the importance.
[0090] This embodiment has obtained the corresponding importance of each member in the family when accessing the information of other members. The greater the importance, the closer the relationship between the member and the currently accessed member. Therefore, when accessing the current member, the information of other members with greater importance should be retrieved first.
[0091] When different members access the family tree, the order of calling each member in the corresponding family tree is sorted according to the importance of other members when accessing the information under the member, and then displayed. Specifically, when accessing the information of the zth member, based on the importance of other members except the zth member when accessing the information of the zth member, the information of the corresponding members is called in sequence and displayed in the display interface; among which, the importance is positively correlated with the calling order, that is, the more important the member, the higher the calling order. Since the size of the display interface is fixed and there may be many members to be displayed, when displaying, the more important members can load all the family tree data, and the less important members can load thumbnail data, such as thumbnails of avatars. The more important members can be stored in the cache of the App, and the cache will not be cleared within one minute after the App is exited. When the App is opened again, the data can be read directly from the cache to improve efficiency. When the less important members exit the interface or App, their cached data will be cleared directly. This display method can obtain the information that each member wants to obtain from the family tree in a shorter time, avoiding the situation where multiple family member information is sent at the same time, which causes a large load on the terminal device, and improves the generation efficiency and display effect of the family tree.
[0092] This embodiment constructs a corresponding graph structure based on the relationship between the direct relatives of the family members, and obtains the blood relationship distance between every two members according to the graph structure, thereby avoiding the problem that the traditional tree-structured family tree cannot well display the complex blood relationship; then, the closeness of the relationship between the two members is quantified through the profile information of each member, and the degree of intimacy between every two members is obtained. By combining the intimacy and blood relationship distance between the members passed through in each path between every two members in the family and the corresponding two members, the correlation between the members is evaluated, and the correlation value between every two members is obtained. The correlation value can well reflect the closeness of the blood relationship and social relationship between each member and the other members in the family; then, the degree of outlier corresponding to each member is determined according to the correlation value, and the corresponding importance of each member when accessing the information of other members is obtained in combination with the family relationship corresponding to each member, and the order of information calling is adjusted according to the importance, and then the family tree and family tree are displayed, so that the family tree and family tree can be displayed adaptively according to the blood relationship and social relationship between the visited member and other members, and the display effect of the family tree and family tree is better, which effectively improves the generation efficiency of the family tree and family tree.
[0093] An embodiment of a family tree automatic generation system:
[0094] In this embodiment, a family tree and pedigree automatic generation system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the above-mentioned family tree and pedigree automatic generation method.
[0095] Since a method for automatically generating a family tree or genealogy has been described in an embodiment of a method for automatically generating a family tree or genealogy, this embodiment will not further describe the method for automatically generating a family tree or genealogy.
[0096] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for automatically generating a family tree, characterized in that: The method comprises the following steps: Obtain the relationship between the direct relatives of the family members and the profile information of each family member; construct a graph structure based on the relationship between the direct relatives of the family members, where the nodes of the graph structure are members; Based on the graph structure, the blood relationship distance between every two members is obtained; based on the similarity between the profile information of every two members, the intimacy between every two members is determined; based on the intimacy between the members passed through in each path between every two members in the graph structure and the corresponding two members and the blood relationship distance, the degradation degree of the blood relationship between every two members is obtained; and the correlation value between every two members is obtained by combining the blood relationship distance, intimacy and the degradation degree between every two members; Determine the degree of outlier corresponding to each member based on the correlation value; obtain the importance of each member when accessing the information of other members according to the degree of outlier and the correlation value; Display family tree genealogy based on said importance; The following formula is used to calculate the correlation value between the i-th member and the j-th member: ,in, represents the correlation value between the i-th member and the j-th member, represents the degree of degradation of the blood relationship between the i-th member and the j-th member, represents the blood relationship distance between the i-th member and the j-th member, represents the degree of intimacy between the i-th member and the j-th member, and exp( ) represents an exponential function with a natural constant as the base; The determining the outlier degree corresponding to each member based on the association value comprises: For the i-th member and the j-th member: the negative correlation normalized result of the correlation value between the i-th member and the j-th member is used as the distance measure between the i-th member and the j-th member; Based on the distance measurement between every two members, the local anomaly factor detection algorithm is used to detect all members and obtain the degree of outlier corresponding to each member; The obtaining, according to the outlier degree and the correlation value, the importance of each member when accessing the information of other members includes: When the i-th member accesses the information of the z-th member, the product of the negative correlation normalized result of the outlier degree corresponding to the i-th member and the correlation value between the i-th member and the z-th member is determined as the importance corresponding to the i-th member when accessing the information of the z-th member.
2. A method for automatically generating a family tree according to claim 1, characterized in that: The step of constructing a graph structure based on the relationship between the direct relatives of the family members includes: Build a graph structure based on the relationships between all members of the family; Among them, when constructing the graph structure, if the relationship between two members is a father-child relationship or a mother-child relationship, the corresponding two members are connected, and the weight of the connecting edge between the corresponding two members is set to a preset first value; if the relationship between the two members is a grandfather-grandson relationship, the corresponding two members are connected, and the weight of the connecting edge between the corresponding two members is set to a preset second value; the preset first value is less than the preset second value.
3. A method for automatically generating a family tree according to claim 1, characterized in that: Determining the intimacy between each two members based on the similarity between the profile information of each two members includes: For the i-th member and the j-th member: Use word2vec to convert each profile information of the i-th user and each profile information of the j-th member into corresponding word vectors; obtain the inverse document frequency corresponding to each word vector; If there is an overlapping time period between any profile information of the i-th user and any profile information of the j-th member, the word vectors corresponding to the two profile information are taken as a matching vector pair; Calculate the cosine similarity of the two word vectors in each matching vector pair; take the sum of the inverse document frequencies corresponding to the two word vectors in each matching vector pair as the frequency representation value of each matching vector pair; record the product of the cosine similarity of the two word vectors in each matching vector pair and the corresponding frequency representation value as the first product of each matching vector pair; record the maximum value of the first products of all matching vector pairs as the similarity evaluation value between the i-th member and the j-th member; According to the length of the overlapping time periods in the two profile information corresponding to the two word vectors in each matching pair and the similarity evaluation value, the intimacy between the i-th member and the j-th member is obtained.
4. A method for automatically generating a family tree according to claim 3, characterized in that: The following formula is used to calculate the intimacy between the i-th member and the j-th member: ,in, represents the intimacy between the i-th member and the j-th member, represents the number of matching vector pairs, Indicates the length of the overlapping time period of the brief information of the two word vectors in the rth matching vector pair, Indicates the duration of the brief information of the word vector corresponding to the i-th member in the r-th matching vector pair, Indicates the duration of the brief information of the word vector corresponding to the jth member in the rth matching vector pair, Represents the similarity evaluation value between the i-th member and the j-th member.
5. A method for automatically generating a family tree according to claim 1, characterized in that: The step of obtaining the degree of degradation of the blood relationship between each two members according to the intimacy and blood relationship distance between the members passed through in each path between each two members in the graph structure and the corresponding two members includes: For the i-th member and the j-th member: The path whose blood relationship distance between the i-th member and the j-th member is less than the preset distance threshold among all the paths between the i-th member and the j-th member is determined as the target path between the i-th member and the j-th member; For the kth target path: the ratio of the degree of intimacy between each member passed by the kth target path and the i-th member and the blood relationship distance between each member passed by the kth target path and the j-th member is used as the first characteristic value of each member passed by the kth target path; the ratio of the degree of intimacy between each member passed by the kth target path and the j-th member and the blood relationship distance between each member passed by the kth target path and the i-th member is used as the second characteristic value of each member passed by the kth target path; the maximum value of the first characteristic value and the second characteristic value of each member passed by the kth target path is used as the characteristic index of each member passed by the kth target path; the average value of the characteristic indexes of all members passed by the kth target path is used as the relationship evaluation value of the kth target path; The negative correlation normalization result of the maximum value of the relationship evaluation value on all target paths is determined as the degradation degree of the blood relationship between the i-th member and the j-th member.
6. A method for automatically generating a family tree according to claim 1, characterized in that: The display of the family tree based on the importance level includes: For the zth member: When accessing the information of the zth member, based on the corresponding importance of other members except the zth member when accessing the information of the zth member, the information of the corresponding members is retrieved in sequence and displayed in the display interface; wherein the importance is positively correlated with the retrieval order.
7. A family tree automatic generation system, comprising a memory and a processor, characterized in that: The processor executes the computer program stored in the memory to implement a method for automatically generating a family tree as described in any one of claims 1-6.
