CN112860704A - Method and device for processing family tree data - Google Patents

Method and device for processing family tree data Download PDF

Info

Publication number
CN112860704A
CN112860704A CN202110251319.1A CN202110251319A CN112860704A CN 112860704 A CN112860704 A CN 112860704A CN 202110251319 A CN202110251319 A CN 202110251319A CN 112860704 A CN112860704 A CN 112860704A
Authority
CN
China
Prior art keywords
family tree
family
character
node
tree
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
CN202110251319.1A
Other languages
Chinese (zh)
Other versions
CN112860704B (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.)
Hefei University of Technology
Original Assignee
Hefei University of Technology
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 Hefei University of Technology filed Critical Hefei University of Technology
Priority to CN202110251319.1A priority Critical patent/CN112860704B/en
Publication of CN112860704A publication Critical patent/CN112860704A/en
Application granted granted Critical
Publication of CN112860704B publication Critical patent/CN112860704B/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • 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/24Querying
    • G06F16/248Presentation of query results
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method and a device for processing family tree data. Wherein, the method comprises the following steps: acquiring a family tree, wherein family tree data in the family tree comprises information of a plurality of family tree characters and a first family tree character relationship; constructing a family tree according to the family tree graph, wherein the family tree at least comprises information of a plurality of family characters, a first family character relationship and a second family character relationship; and searching the information of the target family tree character and the family tree character relationship of the target family tree character according to the family tree. The method and the device solve the technical problems that due to the fact that existing electronic family tree data are limited to storage and display of traditional character relations, some special character relations are not protected and processed in the actual family tree repairing process, characters in a family tree are displayed disorderly, family tree characters are difficult to search, character relations are established wrongly, and accurate and efficient family tree building is difficult to achieve.

Description

Method and device for processing family tree data
Technical Field
The application relates to the field of family tree data processing, in particular to a family tree data processing method and device.
Background
The family tree is also called as spectral disc, genealogy and taberson, and the information of ancestry reproduction, population change, residence change, marital status, family member traces and the like in the family can be recorded in the form of book, graph, log, table and history, so that the family tree has important academic and historical material values; in addition, the genetic disease spectrum and the gene family spectrum in the surname family spectrum data provide powerful support for human genetic disease analysis and national origin tracing. At present, the development of electronic spectrum repair work is accelerated by the arrival of the wave of the root-seeking question and the wave of the overseas and the development of the information technology.
At present, the family tree electronization mainly comprises the following three ways:
(1) and (3) text document saving: converting a traditional pedigree paper document into documents of txt, word, excel and the like in a specified format in a manual and semi-automatic mode for storage;
(2) and (3) database storage: storing the family tree in a relational database such as MySQL or a non-relational database such as Neo4j, wherein in MySQL, the attributes and the incidence relation of the characters are stored in a record, in Neo4j, the characters are stored in nodes, and the character relation is stored in edges among the nodes;
(3) and (3) modifying the music score website: the medium and external repair spectrum website can only provide the functions of saving, consulting and the like of the designated incidence relation and the character attributes for the user.
The traditional relations such as father and son, father and woman, couples and the like are limited to the existing electronic pedigree data, and other special relations such as the relation of a subsequent relation, a facultative relation 31079a child relation, an encumbrance relation and the like do not have a storage and processing method; in particular, no storage and processing method is provided for the following character relationships in the actual spectrum modifying process:
fig. 1a is a schematic diagram of a relationship to be considered in a family persona relationship according to an embodiment of the present application, as shown in fig. 1a, a person has only unknown name and other unknown information, and has a direct association relationship with a specified person, but the direct association relationship is to be further confirmed, and the relationship is a relationship to be considered.
Fig. 1b is a schematic diagram of an alternate generation connected relationship in a family character relationship according to an embodiment of the present application, as shown in fig. 1b, all information of a certain person is known, a certain designated person is an ancestor of the family character, N generations of persons are separated from each other, N is known, but all information of N generations of persons separated from each other is unknown, and the relationship is an alternate generation connected relationship.
Because the existing electronic family tree data is limited to the storage and display of the traditional character relations, some special character relations are not protected and processed in the actual family tree repairing process, the character display in the family tree is disordered, the family tree characters are difficult to search, the character relations are mistaken to be established, and the accurate and efficient family tree building is difficult to realize.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a method and a device for processing family tree data, and the technical problems that the existing electronic family tree data are limited in the storage and display of the traditional character relations, some special character relations are not protected and processed in the actual family tree repairing process, the character relations in a family tree are displayed disorderly, the family tree characters are difficult to search, the character relations are established wrongly, and the accurate and efficient family tree repairing is difficult to realize are at least solved.
According to an aspect of an embodiment of the present application, there is provided a method for processing pedigree data, including: acquiring a family tree, wherein family tree data in the family tree comprises information of a plurality of family tree characters and a first family tree character relationship; constructing a family tree according to the family tree graph, wherein the family tree at least comprises information of a plurality of family characters, a first family character relationship and a second family character relationship; and searching the information of the target family tree character and the family tree character relationship of the target family tree character according to the family tree.
Optionally, the first pedigree character relationship comprises: father-son relationship, father-woman relationship and couple relationship; the second family persona relationship includes: the adoptive relationship, the facultative 31079relationship, the pending relationship and the alternate connection relationship among the pedigree characters.
Optionally, the first pedigree character is only unknown in name, other information is known, all information of the second pedigree character is known, a direct relation exists between the first pedigree character and the second pedigree character, the direct relation needs to be further confirmed, and the relation between the first pedigree character and the second pedigree character is a relation to be checked; all information of the third family tree character and the fourth family tree character is known, the third family tree character and the fourth family tree character are separated by a character with a known algebra, the information of the character with the known algebra is unknown, and the third family tree character and the fourth family tree character are in an alternate connection relationship.
Optionally, constructing a family tree according to the family tree graph includes: when the relaying relation is displayed in the family tree, the father node of the node corresponding to the subsequent child is the node corresponding to the relaying family; when the relation of the facultative 31079is displayed in the family tree, the father node of the node corresponding to the child is the node corresponding to the native family; when an alternate connection relation is displayed in the family tree, representing the character which is separated between two known family characters by using virtual nodes, wherein the number of the virtual nodes is the same as the number of the generations of the separated characters; when the relation to be checked is displayed in the family tree, the nodes corresponding to the two family tree figures with the relation to be checked are directly connected child nodes and father nodes.
Optionally, the building of the family tree according to the family tree graph further includes: and respectively allocating unique codes to nodes except the virtual nodes in the family tree according to the preset ranking of the family characters.
Optionally, the building of the family tree according to the family tree graph further includes: processing family tree data in the family tree by adopting a queue and recursion method to generate a family tree.
Optionally, processing the family tree data in the family tree by using a queue and a recursion method to generate a family tree, including: step 1, initializing parameters, wherein the initializing parameters comprise: determining a family tree ancestor, determining an initial code of a family tree character, initializing a family tree, storing the family tree ancestor to the family tree, and creating a virtual node set and a queue; step 2.1, if the queue is not empty, acquiring a queue head element, and initializing an alternate connected node set; step 2.2, judging whether the current node is a virtual node, if so, inquiring a child node set in the virtual node set, and if not, acquiring the child node set from family tree data in the family tree; step 2.3, judging whether the child nodes in the child node set are generation-next-generation connected nodes one by one, if so, storing the child nodes in the generation-next-generation connected node set, and if not, executing the step 2.4; step 2.4, if the child node is not a virtual node, setting the code of the child node, storing the code of the child node into a father node of the child node, and storing the child node into a family tree, and if the child node of the child node is not empty, storing the child node into a queue; step 2.5, if the alternate connected node set is not empty, creating a plurality of front and back connected virtual nodes according to the requirement, and storing the plurality of front and back connected virtual nodes into the virtual node set, the family tree and the queue; step 2.6, updating the codes of all child nodes of the current node in the family tree; and 3, returning to the family tree.
Optionally, before representing a character spaced apart from two known pedigree characters by using a virtual node, the method further includes establishing the virtual node by: step S1, initializing parameters, wherein the initializing parameters include: acquiring an initial tree depth, an ending tree depth, a virtual root node, a virtual node set and a preset virtual node according to descendant generations connected with each other in an alternate way; s2.1, setting a father node code; s2.2, if the initial tree depth is less than or equal to the final tree depth, creating a virtual node; step S3, returns the virtual root node and the virtual node set.
According to another aspect of the embodiments of the present application, there is also provided a device for processing family tree data, including: the family tree management system comprises an acquisition module, a storage module and a management module, wherein the acquisition module is used for acquiring a family tree, and family tree data in the family tree comprises information of a plurality of family tree characters and a first family tree character relationship; the family tree management system comprises a processing module, a family tree management module and a family tree management module, wherein the family tree management module is used for constructing a family tree according to a family graph, and the family tree at least comprises information of a plurality of family characters, a first family character relationship and a second family character relationship; and the searching module is used for searching the information of the target family tree character and the family tree character relationship of the target family tree character according to the family tree.
According to still another aspect of the embodiments of the present application, there is provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, a device in which the non-volatile storage medium is located is controlled to execute the above processing method for the pedigree data.
According to still another aspect of the embodiments of the present application, there is also provided a processor configured to execute a program stored in a memory, where the program executes the above processing method of pedigree data.
In the embodiment of the application, a family tree is obtained, wherein family tree data in the family tree comprises information of a plurality of family tree people and a first family tree people relationship; constructing a family tree according to the family tree graph, wherein the family tree at least comprises information of a plurality of family characters, a first family character relationship and a second family character relationship; according to the method for searching the information of the target family tree character and the family tree character relationship of the target family tree character, the family tree graph is converted into the family tree graph and the special character relationship is processed, so that the technical effects of ensuring accurate storage of characters and character relationships in the family tree, avoiding storage of useless information and improving the value of family tree data are achieved, and the technical problems that the existing electronic family tree data are limited in storage and display of traditional character relationships, some special character relationships are not protected and processed in the actual family tree repairing process, character display in the family tree is disordered, family tree characters are difficult to search, character relationship building errors are caused, and accurate and efficient family tree building is difficult to achieve are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1a is a schematic diagram of a relationship to be considered in family persona relationships according to an embodiment of the present application;
FIG. 1b is a schematic diagram of an alternate joining relationship in a family tree character relationship according to an embodiment of the present application
Fig. 2 is a flowchart of a method for processing family tree data according to an embodiment of the present application;
FIG. 3a is a schematic diagram of an e-homed spectrogram according to an embodiment of the present application;
FIG. 3b is a schematic diagram of a family tree into which the family tree shown in FIG. 3a is transformed;
fig. 4 is a block diagram of a device for processing family tree data according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all 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 application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an embodiment of the present application, there is provided an embodiment of a method for processing pedigree data, where the steps shown in the flowchart of the drawings may be executed in a computer system such as a set of computer-executable instructions, and where a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown.
The processing of the family tree data is to finally construct a complete family tree with correct node sequencing, the current mode for storing the family tree data is a family tree graph, and the main problem of how to convert the family tree graph into the family tree according to the needs and process and sequence the special character relations is the current problem.
The family spectrogram is difficult to visually see the character information and the associated information, and the processing of the family spectrogram into a family tree is a better solution at present; however, an effective solution for saving and processing the special character relationship is lacking, and the invention mainly provides a family tree construction method and a special character relationship processing method. The method is described in detail below:
fig. 2 is a flowchart of a method for processing family tree data according to an embodiment of the present application, and as shown in fig. 2, the method includes the following steps:
step S202, obtaining a family tree, wherein family tree data in the family tree comprise information of a plurality of family tree characters and a first family tree character relationship;
according to an alternative embodiment of the present application, the first pedigree persona relationship comprises: father-son relationship, father-woman relationship, and couple relationship.
Step S204, constructing a family tree according to the family tree graph, wherein the family tree at least comprises information of a plurality of family characters, a first family character relationship and a second family character relationship;
according to another alternative embodiment of the present application, the second pedigree persona relationship comprises: the adoptive relationship, the facultative 31079relationship, the pending relationship and the alternate connection relationship among the pedigree characters.
The adoptive relationships and the facultative 31079relationships belong to traditional special persona relationships. The adoptive relationship is divided into adoptive export and adoptive import, wherein the adoptive export refers to the fact that children and females are relayed into the family of parents for subsequent generation, the adoptive import refers to the fact that people do not have children and children who accept the same or relatives are bred for subsequent generation. The relation 310793 is that a man inherits two families at the same time, does not depart from the ancestral family of the original family, and is also used as a subsequent family.
According to an optional embodiment of the application, the first pedigree character is only unknown in name, other information is known, all information of the second pedigree character is known, a direct relation exists between the first pedigree character and the second pedigree character, the direct relation needs to be further confirmed, and the relation between the first pedigree character and the second pedigree character is a relation to be checked; all information of the third family tree character and the fourth family tree character is known, the third family tree character and the fourth family tree character are separated by a character with a known algebra, the information of the character with the known algebra is unknown, and the third family tree character and the fourth family tree character are in an alternate connection relationship.
The relation to be examined and the relation of successive generations are the new special character relation provided by the invention. The relation to be examined means that a certain person only has an unknown name and other known information, and has a direct association relationship with the specified person, but the direct association relationship is to be further confirmed.
The successive generation connection relation is that a designated person is an ancestor of the designated person, the designated person and the designated person are separated by N generations, N is known, but all information of the separated N generations is unknown.
Step S206, searching the information of the target family tree character and the family tree character relationship of the target family tree character according to the family tree.
Through the steps, the family tree graph is converted into the family tree, and the special character relations are processed, so that the technical effects of ensuring accurate storage of characters and character relations in the family tree, avoiding storage of useless information and improving the value of family tree data are achieved.
According to an optional embodiment of the present application, when step S204 is executed and the relaying relationship is shown in the family tree, the parent node of the node corresponding to the subsequent child is the node corresponding to the relaying family; when the relation of the facultative 31079is displayed in the family tree, the father node of the node corresponding to the child is the node corresponding to the native family; when an alternate connection relation is displayed in the family tree, representing the character which is separated between two known family characters by using virtual nodes, wherein the number of the virtual nodes is the same as the number of the generations of the separated characters; when the relation to be checked is displayed in the family tree, the nodes corresponding to the two family tree figures with the relation to be checked are directly connected child nodes and father nodes.
Fig. 3a is a schematic diagram of an electronic spectrogram according to an embodiment of the present application, and as shown in fig. 3a, the relationship between people in the spectrogram includes: father and son (woman), adoptive, facultative, waiting for examination, and alternate connection relations, wherein:
d and H, D, I, F and K are 3, 4 and 2 respectively in algebraic separation;
x is the future generation of O;
q is the future generation of L;
t is adoptively given to M as a subsequent child of M;
j facultative 3107925.
Fig. 3b is a schematic diagram of the family tree converted from the family tree diagram shown in fig. 3a, and as shown in fig. 3b, the node a is used as a family root plus a point, and the family characters are sorted and encoded from top to bottom according to the family ranking (the actual character numbers behind the nodes).
In the process of converting the family tree graph into the family tree, the adoptive relationship and the Facultative 31079relationship are processed according to the following rules:
the facultative 31079relation: a facultative 31079;
the adoptive relationship is as follows: the subsequent child is displayed in the adoptive home in the family tree (as shown in fig. 3b, the parent node of T is M).
In the process of converting the family tree into the family tree, when showing the relation of successive generations, the virtual nodes are used for representing the characters which are separated from each other between two known family tree characters (2 virtual nodes are separated between D and H, namely three generations of characters are separated, 3 virtual nodes are separated between D and I, namely four generations of characters are separated, and 1 virtual node is separated between F and K, namely two generations of characters are separated). When processing successive generation numbers, a virtual node is created to ensure the correctness of the coding.
In the process of converting the pedigree graph into the pedigree tree, when the relation to be considered is displayed, the processing method of a descendant to be considered is the same as that of a common son or a daughter (the father node of X is O; the father node of Q is L).
According to another alternative embodiment of the present application, when step S204 is executed: and respectively allocating unique codes to nodes except the virtual nodes in the family tree according to the preset ranking of the family characters.
The existing family spectrogram neglects the arrangement of people and families, so that the display sequence of people and things in the family tree is disordered. In the embodiment provided by the application, family tree characters are sequenced and encoded from top to bottom according to family ranking (the character node numbers are unique), and virtual nodes created for the correctness of the numbers among nodes connected in the generation-alternate mode are not numbered.
By the method, correct family tree character sequencing and encoding can be guaranteed, the family tree characters can be regularly processed and displayed, and the family tree characters can be conveniently consulted and corrected. And the volume judgment and basis are provided for the family tree volume division work.
In some optional embodiments of the present application, the family tree is generated by processing the family tree data in the family tree by using a queue and a recursion method.
The embodiment provided by the invention mainly adopts the open source graph database Neo4j to store the family tree data, the characters are represented by nodes, the character relations are represented by edges between the nodes, the character information and the associated information are stored in the attribute information of the nodes and the edges, and the generation method of the family tree is explained in detail with reference to fig. 3a and 3 b.
According to an optional embodiment of the present application, the family tree is generated by processing family tree data in a family tree by using a queue and a recursion method, and the method comprises the following steps:
step 1, initializing parameters, wherein the initializing parameters comprise: determining a family tree ancestor, determining an initial code of a family tree character, initializing a family tree, storing the family tree ancestor to the family tree, and creating a virtual node set and a queue;
step 2.1, if the queue is not empty, acquiring a queue head element, and initializing an alternate connected node set;
step 2.2, judging whether the current node is a virtual node, if so, inquiring a child node set in the virtual node set, and if not, acquiring the child node set from family tree data in the family tree;
step 2.3, judging whether the child nodes in the child node set are generation-next-generation connected nodes one by one, if so, storing the child nodes in the generation-next-generation connected node set, and if not, executing the step 2.4;
step 2.4, if the child node is not a virtual node, setting the code of the child node, storing the code of the child node into a father node of the child node, and storing the child node into a family tree, and if the child node of the child node is not empty, storing the child node into a queue;
step 2.5, if the alternate connected node set is not empty, creating a plurality of front and back connected virtual nodes according to the requirement, and storing the plurality of front and back connected virtual nodes into the virtual node set, the family tree and the queue;
step 2.6, updating the codes of all child nodes of the current node in the family tree;
and 3, returning to the family tree.
Figure BDA0002966194110000081
Figure BDA0002966194110000091
The algorithm 1 is a pseudo code for constructing the family tree, and comprises the following specific steps for establishing the family tree:
step 1, initializing parameters, initializing a family tree ancestor processor, setting an initial sequencing order of family characters as 1, storing a family tree ancestor into the family tree, creating a virtual node set, and queuing a Queue (line 1);
step 2, constructing a family tree;
step 2.1, when the queue is not empty, acquiring a queue head element node, and initializing an alternate connected node set genSkipnodes (lines 2-4);
step 2.2, judging whether the current node is a virtual node, and inquiring a child node set in the virtualNodeSet when the current node is the virtual node; otherwise, acquiring and preprocessing a child node set (lines 5-8) from the original family tree;
step 2.3, judging the child node sets one by one, when the child node sets are descendants connected in an alternate generation, storing the descendants into the set gen Skipdoes according to the generation division (lines 10-12), otherwise, turning to the step 2.4;
step 2.4, when the child is not a virtual node, setting the family tree code of the child node, storing the ID of the child node into the father node of the child node, storing the ID of the child node into the family tree, and when the child node is not empty, storing the family tree code into a queue for continuous processing (lines 13-19);
step 2.5, when the generation node set genSkipnodes are not empty, creating a plurality of virtual nodes connected in tandem according to requirements, and storing the virtual root nodes into the virtual node set, the family tree and the queue (20 th-25 th lines);
step 2.6, updating the ID sets of all child nodes of the current node in the family tree (line 26);
and 3, returning to the family tree (line 27).
In another alternative embodiment of the present application, before representing characters spaced apart from two known pedigree characters by using virtual nodes, the virtual nodes are further created by:
step S1, initializing parameters, wherein the initializing parameters include: acquiring an initial tree depth, an ending tree depth, a virtual root node, a virtual node set and a preset virtual node according to descendant generations connected with each other in an alternate way;
s2.1, setting a father node code;
s2.2, if the initial tree depth is less than or equal to the final tree depth, creating a virtual node; step S3, returns the virtual root node and the virtual node set.
Figure BDA0002966194110000092
Figure BDA0002966194110000101
The algorithm 2 is a function for creating virtual nodes, and the following concrete steps are used for creating the virtual nodes:
step 1, initializing parameters, and acquiring an initial tree depth start, an end tree depth end, a virtual root node sNode, a virtual node set nodesSet and a preset virtual node vitulaNode according to an algebra of successive generations;
step 2, virtual node creation;
step 2.1, father fartherID is preset;
step 2.2, when the start is equal to the end, sequentially creating a plurality of virtual nodes (lines 3-16) connected with the front generation and the rear generation;
step 2.2.1, nodes connected with each other at every other generation exist in the current generation, the ID value of the father of the nodes is sequentially updated and stored in a set nodesSet of virtual nodes, and the ID of the nodes is stored in a value childrenID (lines 5-9);
step 2.2.2, creating the virtual node under the current algebra, updating the values of id, generation, parent id and the like, storing the values into a set nodesSet of the virtual node, and storing the id into a value childrenID (lines 10-13);
step 2.2.3 updates the ID array of the child node of the node with the corresponding ID as the fastern ID in the virtual node set nodesSet (line 14);
step 2.2.4, adding 1 to the start, setting the fastern ID as the ID of the current virtual node, and entering the next cycle (lines 15-16);
and step 3, returning the virtual initial root node sNode, and collecting the nodesSet by the virtual node (the 17 th line).
Chinese and English meaning comparison table
Figure BDA0002966194110000111
Figure BDA0002966194110000121
Fig. 4 is a block diagram of a device for processing family tree data according to an embodiment of the present application, and as shown in fig. 4, the device includes:
the obtaining module 40 is configured to obtain a family tree, where family tree data in the family tree includes information of a plurality of family tree people and a first family tree people relationship;
the processing module 42 is configured to construct a family tree according to the family tree graph, where the family tree at least includes information of a plurality of family characters, a first family character relationship and a second family character relationship;
and the searching module 44 is used for searching the information of the target family tree character and the family tree character relationship of the target family tree character according to the family tree.
It should be noted that reference may be made to the description related to the embodiment shown in fig. 2 for a preferred implementation of the embodiment shown in fig. 4, and details are not repeated here.
The embodiment of the application also provides a nonvolatile storage medium, wherein the nonvolatile storage medium comprises a stored program, and when the program runs, the device where the nonvolatile storage medium is located is controlled to execute the processing method of the family tree data.
The nonvolatile storage medium stores a program for executing the following functions: acquiring a family tree, wherein family tree data in the family tree comprises information of a plurality of family tree characters and a first family tree character relationship; constructing a family tree according to the family tree graph, wherein the family tree at least comprises information of a plurality of family characters, a first family character relationship and a second family character relationship; and searching the information of the target family tree character and the family tree character relationship of the target family tree character according to the family tree.
The embodiment of the application also provides a processor, wherein the processor is used for running the program stored in the memory, and the program is used for executing the above processing method of the pedigree data when running.
The processor is used for running a program for executing the following functions: acquiring a family tree, wherein family tree data in the family tree comprises information of a plurality of family tree characters and a first family tree character relationship; constructing a family tree according to the family tree graph, wherein the family tree at least comprises information of a plurality of family characters, a first family character relationship and a second family character relationship; and searching the information of the target family tree character and the family tree character relationship of the target family tree character according to the family tree.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (11)

1. A method for processing family tree data is characterized by comprising the following steps:
acquiring a family tree, wherein family tree data in the family tree comprises information of a plurality of family tree characters and a first family tree character relationship;
constructing a family tree according to the family tree, wherein the family tree at least comprises the information of the family characters, the first family character relationship and the second family character relationship;
and searching the information of the target family tree character and the family tree character relationship of the target family tree character according to the family tree.
2. The method of claim 1,
the first pedigree character relationship comprises: father-son relationship, father-woman relationship and couple relationship;
the second pedigree character relationship comprises: the adoptive relationship, the facultative 31079relationship, the waiting relation and the alternate generation connection relationship among the pedigree figures.
3. The method of claim 2,
the method comprises the following steps that a first pedigree character is only unknown in name, other information is known, all information of a second pedigree character is known, a direct relation exists between the first pedigree character and the second pedigree character, the direct relation needs to be further confirmed, and the relation between the first pedigree character and the second pedigree character is the relation to be checked;
all information of a third pedigree character and information of a fourth pedigree character are known, a character with a known algebra is arranged between the third pedigree character and the fourth pedigree character, the information of the character with the known algebra is unknown, and the relationship between the third pedigree character and the fourth pedigree character is the algebra-separated connection relationship.
4. The method of claim 2, wherein constructing a family tree from the family tree graph comprises:
when the relaying relation is displayed in the family tree, the father node of the node corresponding to the subsequent child is the node corresponding to the relaying family;
when the Facultative 31079relation is displayed in the family tree, the father node of the node corresponding to the child is the node corresponding to the native family;
when the alternate linkage relation is displayed in the family tree, representing the character which is separated between two known family character characters by using virtual nodes, wherein the number of the virtual nodes is the same as the number of the generations of the separated characters;
and when the relation to be considered is displayed in the family tree, the nodes corresponding to the two family characters with the relation to be considered are directly connected child nodes and father nodes.
5. The method of claim 4, wherein constructing a family tree from the family graph further comprises:
and respectively setting unique codes for nodes except the virtual nodes in the family tree according to the preset ranks of the family characters.
6. The method of claim 4, wherein constructing a family tree from the family graph further comprises:
and processing family tree data in the family tree by adopting a queue and recursion method to generate the family tree.
7. The method of claim 6, wherein processing the family tree data in the family tree using a queue and recursion method to generate the family tree comprises:
step 1, initializing parameters, wherein the initialization parameters comprise: determining a family tree ancestor, determining an initial code of the family tree character, initializing a family tree, storing the family tree ancestor to the family tree, and creating a virtual node set and a queue;
step 2.1, if the queue is not empty, acquiring a queue head element, and initializing an alternate connected node set;
step 2.2, judging whether the current node is the virtual node, if so, inquiring a child node set in the virtual node set, and if not, acquiring the child node set from family tree data in the family tree;
step 2.3, judging whether the child nodes in the child node set are generation-next-generation connected nodes one by one, if so, storing the child nodes in the generation-next-generation connected node set, and if not, executing step 2.4;
step 2.4, if the child node is not the virtual node, setting the code of the child node, saving the code of the child node into a father node of the child node, saving the child node into the family tree, and if the child node of the child node is not empty, saving the child node into the queue;
step 2.5, if the alternate connected node set is not empty, creating a plurality of front and back connected virtual nodes according to requirements, and storing the front and back connected virtual nodes into the virtual node set, the family tree and the queue;
step 2.6, updating the codes of all child nodes of the current node in the family tree;
and 3, returning to the family tree.
8. The method of claim 4, wherein before representing a character spaced between two known pedigree characters with a virtual node, the method further comprises establishing the virtual node by:
step S1, initializing parameters, wherein the initialization parameters include: acquiring an initial tree depth, an ending tree depth, a virtual root node, a virtual node set and a preset virtual node according to descendant generations connected with each other in an alternate way;
s2.1, setting a father node code;
step S2.2, if the initial tree depth is less than or equal to the final tree depth, creating the virtual node;
and step S3, returning the virtual root node and the virtual node set.
9. An apparatus for processing family tree data, comprising:
the family tree management system comprises an acquisition module, a display module and a management module, wherein the acquisition module is used for acquiring a family tree, and family tree data in the family tree comprises information of a plurality of family tree figures and a first family tree figure relation;
the processing module is used for constructing a family tree according to the family tree graph, wherein the family tree at least comprises the information of the family characters, the first family character relationship and the second family character relationship;
and the searching module is used for searching the information of the target family tree character and the family tree character relationship of the target family tree character according to the family tree.
10. A non-volatile storage medium, comprising a stored program, wherein when the program runs, a device where the non-volatile storage medium is located is controlled to execute the processing method of family tree data according to any one of claims 1 to 8.
11. A processor, characterized in that the processor is configured to run a program stored in a memory, wherein the program is configured to execute the method for processing pedigree data according to any one of claims 1 to 8 when running.
CN202110251319.1A 2021-03-08 2021-03-08 Family tree data processing method and device Active CN112860704B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110251319.1A CN112860704B (en) 2021-03-08 2021-03-08 Family tree data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110251319.1A CN112860704B (en) 2021-03-08 2021-03-08 Family tree data processing method and device

Publications (2)

Publication Number Publication Date
CN112860704A true CN112860704A (en) 2021-05-28
CN112860704B CN112860704B (en) 2023-07-14

Family

ID=75994623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110251319.1A Active CN112860704B (en) 2021-03-08 2021-03-08 Family tree data processing method and device

Country Status (1)

Country Link
CN (1) CN112860704B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115146115A (en) * 2022-07-14 2022-10-04 合肥工业大学 Family tree display method and device based on coordinate information and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101131699A (en) * 2007-09-20 2008-02-27 北京乾坤化物数字技术有限公司 Construction method for structure tree with genetic information
JP2016207078A (en) * 2015-04-27 2016-12-08 国立大学法人大阪大学 Family tree drawing device, family tree drawing method, and program
US20170213127A1 (en) * 2016-01-24 2017-07-27 Matthew Charles Duncan Method and System for Discovering Ancestors using Genomic and Genealogic Data
CN110989944A (en) * 2019-10-11 2020-04-10 合肥工业大学 Family tree printing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101131699A (en) * 2007-09-20 2008-02-27 北京乾坤化物数字技术有限公司 Construction method for structure tree with genetic information
JP2016207078A (en) * 2015-04-27 2016-12-08 国立大学法人大阪大学 Family tree drawing device, family tree drawing method, and program
US20170213127A1 (en) * 2016-01-24 2017-07-27 Matthew Charles Duncan Method and System for Discovering Ancestors using Genomic and Genealogic Data
CN110989944A (en) * 2019-10-11 2020-04-10 合肥工业大学 Family tree printing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
盛绍静: "《面向亲属关系知识图谱的数据降噪与可视化研究》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
盛绍静: "《面向亲属关系知识图谱的数据降噪与可视化研究》", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 February 2021 (2021-02-15), pages 138 - 2698 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115146115A (en) * 2022-07-14 2022-10-04 合肥工业大学 Family tree display method and device based on coordinate information and electronic equipment

Also Published As

Publication number Publication date
CN112860704B (en) 2023-07-14

Similar Documents

Publication Publication Date Title
AU2020200351B2 (en) Family networks
Cilibrasi et al. Clustering by compression
JP4647336B2 (en) Method and system for ranking words and concepts in text using graph-based ranking
Hommersand et al. Recent developments in the systematics of the Gigartinaceae (Gigartinales, Rhodophyta) based on rbcL sequence analysis and morphological evidence
US20020021838A1 (en) Adaptively weighted, partitioned context edit distance string matching
CN106502991B (en) Publication treating method and apparatus
CN111104525B (en) Construction method of building design specification knowledge graph based on graph database
KR20030011220A (en) Data sort method, data sort apparatus, and data sort program
CN113283238B (en) Text data processing method and device, electronic equipment and storage medium
CN107480279A (en) A kind of generation method of network family tree style
CN110989944B (en) Family tree printing method and device
CN111428503A (en) Method and device for identifying and processing same-name person
CN112860704A (en) Method and device for processing family tree data
Rouard et al. A digital catalog of high‐density markers for banana germplasm collections
JP3126945B2 (en) Character error correction device
Song et al. Scaphopoda is the sister taxon to Bivalvia: Evidence of ancient incomplete lineage sorting
KR900002174A (en) Data processing device and method
Kirkpatrick et al. Comparing pedigree graphs
JP2002041551A (en) Compile method for data and storage medium storing the same
CN113886420B (en) SQL sentence generation method and device, electronic equipment and storage medium
CN111563139B (en) Checking method and device for identifying invoice drug name through OCR (optical character recognition) and computer equipment
JP5512817B2 (en) Information processing apparatus, information processing method, program, and medium
CN114418752B (en) Method and device for processing user data without type label, electronic equipment and medium
JP7323138B2 (en) Technology map output device, technology map output method, and program
CN116721703A (en) Method, equipment, system and storable medium for constructing molecular diagnosis database of Mendelian genetic disease based on NLP

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