Address book management method, device, equipment and medium based on multi-tree structure
By using a multi-forktree structure in the communications management system to organize the communications information, the problem of information being too flat and cannot be customized in traditional systems is solved, and the hierarchical representation of information and user-defined sorting functions are realized.
Patent Information
- Application Number
- CN202311329858.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2043-10-13
AI Technical Summary
The information in traditional messaging management systems is too flat, fails to consider the organizational relationships and structures in the stored information, and cannot meet the user's needs for customized sorting.
Use a multi-forktree structure to organize and manage communications information. Each node contains basic information, parent node ID, predecessor node ID and child node list. These IDs form a multi-forktree structure, allowing users to customize the order of nodes at the same level. .
It realizes effective representation of the hierarchy and organizational relationship of the contact book information, meets the needs of user custom sorting, and changes the limitations of traditional flat structures.
Smart Images

Figure CN117319352B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication software, and in particular to an address book management method, device, equipment, medium and program product based on a multi-tree structure. Background Art
[0002] In the traditional address book management system, there is no organizational relationship between the entries, and the nodes can only be sorted in alphabetical order, which cannot meet the user's customized sorting needs. However, for a unit or organization with a hierarchical relationship, the address book management system needs to have a hierarchy and organizational relationship and be able to customize the node order, so the traditional address book management system cannot meet the above needs. In the data structure, a multi-branch tree means that a parent node can have multiple child nodes, but a child node follows the law of a parent node. And in the multi-branch tree structure, the predecessor node parameters can be set for each node, so that each layer of the multi-branch tree has an order. In this way, for address book nodes of the same level, users can customize the order between nodes. This structure of the multi-branch tree can just meet the address book management system's needs for hierarchy and organizational relationships, and change the flat structure of the traditional address book management system. Summary of the invention
[0003] 1. Technical issues to be resolved
[0004] In view of the above problems, the present disclosure provides an address book management method, device, equipment and medium based on a multi-tree structure, so as to at least partially solve the problems that the information stored in the traditional address book management system is too flat, does not consider the organizational relationship and structure of the stored information, and cannot meet the user's customized sorting requirements.
[0005] (II) Technical solution
[0006] On the one hand, the present disclosure provides an address book management method based on a multi-branch tree structure, comprising: organizing the communication information contained in the address book into multiple nodes, and constructing a class structure of each node, wherein the class structure includes basic information of the node, a parent node ID, a predecessor node ID and a child node list, and the basic information includes an identifier and a node type; based on the parent node ID and the predecessor node ID in the class structure, the nodes are formed into a multi-branch tree structure and displayed in an address book management system, wherein the parent node ID is an identifier of a node one level above the node, and the predecessor node ID is an identifier of a node previous to the node.
[0007] According to an embodiment of the present disclosure, it also includes: importing each of the nodes and the basic information corresponding to each of the nodes into the address book management system; reading and traversing the basic information of each of the nodes, and determining the parent node ID and predecessor node ID of each of the nodes based on the hierarchical relationship between the nodes in the basic information.
[0008] According to an embodiment of the present disclosure, it also includes: in response to a deletion operation of a user accessing the address book management system, recursively deleting the node specified by the user; traversing the child node list of the specified node, recursively deleting all nodes in the child node list; recursively finding and deleting the child nodes of all nodes in the child node list, and continuing to recursively delete all child nodes of the child nodes until there are no more child nodes that need to be deleted.
[0009] According to an embodiment of the present disclosure, the highest-level node in the node type is taken as the root node, and the nodes are formed into a multi-branch tree structure based on the parent node ID and the predecessor node ID in the class structure, including: visiting each of the nodes one by one, and sorting the nodes with the same parent node ID according to the coding order of the predecessor node ID; repeating the above steps until the sorting of the last layer of nodes in the multi-branch tree structure is completed.
[0010] According to an embodiment of the present disclosure, the basic information of each of the nodes is read and traversed, and the parent node ID and predecessor node ID of each of the nodes are determined based on the hierarchical relationship between the nodes in the basic information, including: determining the parent node ID of each of the nodes according to the priority of the node type; based on the same child node list, making the predecessor node ID of the first node of each layer the corresponding parent node ID, and making the predecessor node ID of the subsequent nodes of the layer the identifier of the previous node; repeating the above steps until the predecessor node IDs of all nodes are assigned.
[0011] According to an embodiment of the present disclosure, it also includes: when each of the nodes determines the corresponding parent node ID and predecessor node ID, the parent node ID and the predecessor node ID are stored in a relational database; when each of the nodes is organized into a multi-branch tree structure, the relational database is traversed and each of the nodes is visited one by one to form a multi-branch tree structure.
[0012] The second aspect of the present disclosure provides an address book management device based on a multi-branch tree structure, including: a construction module, used to organize the communication information contained in the address book into multiple nodes, and construct a class structure of each node, the class structure includes basic information of the node, a parent node ID, a predecessor node ID and a child node list, the basic information includes an identifier and a node type; a management module, used to form the nodes into a multi-branch tree structure based on the parent node ID and the predecessor node ID in the class structure, and display them in an address book management system, wherein the parent node ID is the identifier of the node one level above the node, and the predecessor node ID is the identifier of the previous node of the node.
[0013] The third aspect of the present disclosure provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, each step in the address book management method is implemented.
[0014] A fourth aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, each step in the address book management method is implemented.
[0015] The fifth aspect of the present disclosure also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the address book management method is implemented.
[0016] (III) Beneficial effects
[0017] The address book management method, device, equipment and medium based on a multi-branch tree structure provided by the present invention change the overly flat information stored in the traditional address book management system by using a multi-branch tree structure in an address book management system with hierarchical and organizational relationship requirements; and in the multi-branch tree structure, a predecessor node parameter is set for each node, so that each layer of the multi-branch tree has an order, so that for address book nodes of the same level, the user can customize the order between the nodes to meet the user's customized sorting needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description taken in conjunction with the accompanying drawings, in which:
[0019] Figure 1 A flowchart of a method for managing a contact list based on a multi-tree structure according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 2 A schematic diagram schematically shows a structure of a node class of a contact list provided by an embodiment of the present disclosure;
[0021] Figure 3 A schematic diagram schematically shows a contact information file provided by an embodiment of the present disclosure;
[0022] Figure 4 A schematic diagram of a contact list management system based on a multi-tree data structure provided by an embodiment of the present disclosure is shown schematically;
[0023] Figure 5 The structure block diagram of the address book management device based on the multi-tree structure provided by the embodiment of the present disclosure is schematically shown;
[0024] Figure 6 The hardware structure diagram of an electronic device is schematically shown. DETAILED DESCRIPTION
[0025] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0026] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0027] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0028] Some block diagrams and / or flow charts are shown in the accompanying drawings. It should be understood that some blocks or combinations thereof in the block diagrams and / or flow charts may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that these instructions, when executed by the processor, may create a device for implementing the functions / operations described in these block diagrams and / or flow charts.
[0029] like Figure 1 As shown, the flowchart of the address book management method based on the multi-tree structure includes S1-S2.
[0030] S1, organize the communication information contained in the address book into multiple nodes, and build a class structure for each node. The class structure includes the basic information of the node, the parent node ID, the predecessor node ID and the child node list. The basic information includes the identifier and the node type.
[0031] S2, based on the parent node ID and the predecessor node ID in the class structure, the nodes are formed into a multi-branch tree structure and displayed in the address book management system, wherein the parent node ID is the identifier of the node one level above the node, and the predecessor node ID is the identifier of the node's previous node.
[0032] The address book management system is an integrated system, which includes basic functions such as address book creation, search, editing, and deletion, as well as advanced functions such as address book import, export, backup, and recovery, which facilitates individuals or organizations to carry out refined management of contacts in daily life. Compared with the traditional flat-structured address book information management system, the present invention uses a multi-tree data structure to represent the hierarchical relationship and structure of the address book, where each node represents a contact or organizational unit, and the child nodes of the node represent the subordinate contacts or organizational units. It can better reflect the hierarchical structure and organizational relationship between the nodes in the address book, and can be faster and more efficient when searching for information on a certain node; and because of the existence of the predecessor node ID, the address book nodes at the same level can be sorted, making the node order in the address book more flexible and variable.
[0033] Figure 2 A schematic diagram schematically shows the address book node class structure provided by an embodiment of the present disclosure.
[0034] like Figure 2 As shown, this class structure not only contains the basic information of the node (Id: node unique identifier; NodeName: node name; NodeType: node type; Property: node property; Description: node description), but also contains the parent node ID (ParentId), the predecessor node ID (SortId) and all child nodes (Children), that is, the child node list.
[0035] In the disclosed embodiment, each node and the basic information corresponding to each node are imported into the address book management system; the basic information of each node is read and traversed, and the parent node ID and predecessor node ID of each node are determined based on the hierarchical relationship between the nodes in the basic information.
[0036] The system can import and export data so that users can import data from other systems or export data to a format that can be used by other systems. The address book nodes and basic information containing the attributes of each node form an address book import file. The file can contain node identifiers, node names, node types, node descriptions, and node attributes, and there is a clear hierarchical relationship between nodes.
[0037] Figure 3 A schematic diagram of a contact information file provided by an embodiment of the present disclosure is schematically shown.
[0038] like Figure 3 As shown, in this sample file, the head office is the superior unit of Department A and Department B, Department A and Department B are units of the same level, and Department A is ranked before Department B.
[0039] Furthermore, the basic information file of the address book is read to determine the hierarchical relationship between the nodes in the basic information, which can be achieved by defining the level or depth of each node.
[0040] In the disclosed embodiment, the parent node ID of each node is determined according to the priority of the node type; based on the same child node list, the predecessor node ID of the first node of each layer is made the corresponding parent node ID, and the predecessor node ID of the subsequent node of the layer is made the identifier of the previous node; the above steps are repeated until the predecessor node IDs of all nodes are assigned.
[0041] The parent node ID of each node is calculated by setting the parent node ID of each node to the node in the previous level of the node, and the parent node ID of the top node is assigned a value of -1. For example, if a node belongs to level 4, its parent node belongs to level 3. The predecessor node ID of the first node in each level is assigned the parent node ID, and the predecessor node ID of the second node is assigned the ID of the first node. For example Figure 3 In the example, the parent node ID of the head office is -1, and the predecessor node ID is -1; the parent node ID of department A is 1, and the predecessor node ID is 1; the parent node ID of department B is 1, and the predecessor node ID is 2.
[0042] Determining the parent node ID and the predecessor node ID can first classify and organize the data for easy storage and processing. Secondly, in the tree structure, the information of the parent node ID and the predecessor node ID can be used to quickly query related data and improve query efficiency. For example, to query the information of a node and all its child nodes, you only need to query the parent node ID of the node and then traverse down layer by layer. Then the determination of the parent node ID and the predecessor node ID helps to analyze the hierarchical relationship. For example, you can analyze which child nodes a node has, or which predecessor nodes and successor nodes a node has. Finally, the information of the parent node ID and the predecessor node ID can better explain the data. For example, when a node is marked as a child node of a parent node, it is easier to understand what the node represents.
[0043] In the embodiment of the present disclosure, the highest-level node in the node type is taken as the root node, and the nodes are formed into a multi-branch tree structure based on the parent node ID and the predecessor node ID in the class structure, including: visiting each node one by one, and sorting the nodes with the same parent node ID according to the coding order of the predecessor node ID; repeating the above steps until the sorting of the last layer of nodes in the multi-branch tree structure is completed.
[0044] To construct a multi-branch tree data structure by layer-order traversal, you need to first find a node with a parent node ID value of -1 in the database (in this case, the head office), then use this node as the root node, find all nodes with a parent node ID value of 1 (in this case, the root node identifier is 1) in the database, and fill them into the child node attributes of the root node in the order of the predecessor node ID value. This process is repeated until the last layer of the multi-branch tree is filled. At this point, the multi-branch tree structure of the address book management system is constructed.
[0045] Figure 4 A schematic diagram of an address book management system based on a multi-tree data structure provided by an embodiment of the present disclosure is schematically shown.
[0046] like Figure 4 As shown, the head office may include Department A, Department B, Department C, etc. As child nodes of the head office, the child nodes of Department A may include the Finance Department and the Human Resources Department, etc., while the child nodes of Department B may include the R&D Department and the Human Resources Department, etc., and so on, until a complete multi-branch tree structure is formed.
[0047] First, the multi-tree structure of the address book management system can clearly show the hierarchical relationship between contacts or companies, making the data organization more organized. For example, a head office can have multiple subsidiaries, and each subsidiary can have multiple departments. This hierarchical structure can well simulate the corporate organizational structure in the real world. And because the multi-tree structure is highly scalable, it is very convenient to add new contact or company nodes. For example, add a new company node (subsidiary) under the head office node, and then add a new contact node under the new company node, so that the address book management system can be continuously expanded. And it is very convenient to search and query operations. For example, by traversing the multi-tree, you can find all relevant information about a contact or company in the tree. At the same time, by utilizing the characteristics of the multi-tree, you can also achieve fast search and filtering functions. Finally, the multi-tree structure makes data maintenance and management relatively simple. For example, if you want to delete a contact or company node, you only need to find the node in the multi-tree and delete it, without affecting other nodes. At the same time, the multi-tree structure can also facilitate data backup and recovery operations.
[0048] In an embodiment of the present disclosure, in response to a deletion operation of a user accessing the address book management system, a node specified by the user is deleted recursively; the child node list of the specified node is traversed, and all nodes in the child node list are recursively deleted; the child nodes of all nodes in the child node list are recursively found and deleted, and all child nodes of the child nodes are continued to be recursively deleted until there are no more child nodes that need to be deleted.
[0049] Specifically, first delete the specified node, then find all nodes in the database that use the node's identifier as the parent node ID, delete these nodes, and then find the child nodes of these deleted nodes, and so on, until the last layer of the multi-branch tree is deleted. In the process of deletion, the node and node attributes will be deleted together. For example Figure 4 If you want to delete department A, department A and its subordinate departments such as finance department and human resources department will be deleted together.
[0050] For the address book management system, if you want to delete a contact or company node, you only need to find the node in the multi-tree and delete it, which will not affect other nodes and is very efficient. In addition, in the multi-tree data structure, the deletion operation can ensure the integrity of the data. If the data integrity constraint is violated when deleting a node (for example, a non-leaf node or its child nodes are deleted), the system will reject the deletion operation and prompt the corresponding error message, which ensures the consistency and integrity of the data. At the same time, in the multi-tree data structure, since each node has a unique identifier, the deletion operation can accurately find the target node and delete it, thereby avoiding data redundancy and reducing unnecessary waste of data. The address book management system based on the multi-tree data structure supports not only simple deletion operations, but also multiple complex operations. For example, when deleting a node, its child nodes can be deleted at the same time; or a node can be moved from one parent node to another parent node, etc. These operations can be easily implemented through the multi-tree data structure.
[0051] In the disclosed embodiment, after each node determines the corresponding parent node ID and predecessor node ID, the parent node ID and predecessor node ID are stored in a relational database; when each node is organized into a multi-branch tree structure, the relational database is traversed and each node is visited one by one to form a multi-branch tree structure.
[0052] Storing the parent node ID and the predecessor node ID in the database can better organize and store the relationship between nodes. Compared with the flat table structure, the use of relational databases can better express the hierarchical relationship and association relationship between nodes, making data storage and access clearer and more efficient. Relational databases usually have constraints on data consistency and integrity. By storing the parent node ID and the predecessor node ID in the database, the transaction processing and constraint mechanism of the database can be used to ensure the consistency and integrity of the data. For example, when inserting or updating node data, corresponding constraints can be set to ensure the validity of the parent node and the predecessor node. At the same time, relational databases are scalable and flexible, and can adapt to changes and developments in business needs. For example, when you need to add new node types or expand the functions of the system, you only need to add corresponding tables and fields in the database to easily support new business needs.
[0053] Furthermore, the relational database used by the storage node can be changed to a non-relational database. Using a non-relational database can make the stored data more intuitive and improve the reading speed to a certain extent, but in the scenario where nodes are frequently inserted and updated, the access efficiency will be greatly reduced.
[0054] The present disclosure manages the address book information by adopting a multi-branch tree data structure. Not only can each node have any number of child nodes, but the multi-branch tree is more efficient and flexible in certain scenarios. Moreover, in the file system and database, the multi-branch tree can better reflect the hierarchical structure and organizational relationship between the nodes in the address book, effectively reducing the height of the tree and improving the search efficiency. At the same time, the address book nodes at the same level are sorted based on the predecessor node ID, making the node order in the address book more flexible and variable.
[0055] like Figure 5 As shown, the address book management device based on the multi-tree structure of this embodiment includes a construction module 501 and a management module 502.
[0056] The construction module 501 is used to organize the communication information contained in the address book into multiple nodes and construct the class structure of each node. The class structure includes the basic information of the node, the parent node ID, the predecessor node ID and the child node list. The basic information includes the identifier and the node type.
[0057] Management module 502 is used to form a multi-branch tree structure of nodes based on the parent node ID and predecessor node ID in the class structure, and display it in the address book management system, where the parent node ID is the identifier of the node's previous node, and the predecessor node ID is the identifier of the node's previous node.
[0058] According to an embodiment of the present disclosure, any multiple modules of the construction module 501 and the management module 502 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the construction module 501 and the management module 502 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the construction module 501 and the management module 502 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0059] Figure 6 A block diagram of an electronic device for a method for managing a contact list based on a multi-tree structure according to an embodiment of the present disclosure is schematically shown.
[0060] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present invention includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0061] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.
[0062] According to an embodiment of the present invention, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0063] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0064] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0065] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiment of the present invention.
[0066] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 601. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0067] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0068] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0069] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0070] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0071] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
Claims
1. A method for managing an address book based on a multi-tree structure, characterized in that: include: Organizing the communication information contained in the address book into multiple nodes, and constructing a class structure of each node, wherein the class structure includes basic information of the node, a parent node ID, a predecessor node ID, and a child node list, and the basic information includes an identifier and a node type; Based on the parent node ID and the predecessor node ID in the class structure, the nodes are formed into a multi-branch tree structure and displayed in the address book management system, wherein the parent node ID is an identifier of the node one level above the node, and the predecessor node ID is an identifier of the node before the node; Importing each of the nodes and basic information corresponding to each of the nodes into the address book management system; Read and traverse the basic information of each of the nodes, and determine the parent node ID and predecessor node ID of each of the nodes based on the hierarchical relationship between the nodes in the basic information; specifically including: determining the parent node ID of each of the nodes according to the priority of the node type; based on the same child node list, making the predecessor node ID of the first node of each layer the corresponding parent node ID, and making the predecessor node ID of the subsequent nodes of the layer the identifier of the previous node; repeating the above steps until the predecessor node IDs of all nodes are assigned.
2. The address book management method according to claim 1, characterized in that: Also includes: In response to a deletion operation of a user accessing the address book management system, recursively deleting the node specified by the user; Traverse the child node list of the specified node and recursively delete all nodes in the child node list; Recursively find and delete the child nodes of all nodes in the child node list, and continue to recursively delete all child nodes of the child nodes until there are no more child nodes to be deleted.
3. The address book management method according to claim 1, characterized in that: Taking the highest level node in the node type as the root node, forming the nodes into a multi-branch tree structure based on the parent node ID and the predecessor node ID in the class structure includes: Visit each of the nodes one by one, and sort the nodes with the same parent node ID according to the coding order of the predecessor node ID; The above steps are repeated until the sorting of the last layer of nodes of the multi-branch tree structure is completed.
4. The address book management method according to claim 1, characterized in that: Also includes: After each of the nodes determines the corresponding parent node ID and predecessor node ID, the parent node ID and predecessor node ID are stored in a relational database; When the nodes are organized into a multi-branch tree structure, the relational database is traversed and the nodes are accessed one by one to form the multi-branch tree structure.
5. A contact list management device based on a multi-tree structure, characterized in that: include: A construction module, used to organize the communication information contained in the address book into multiple nodes, and construct a class structure of each node, wherein the class structure includes basic information of the node, a parent node ID, a predecessor node ID, and a child node list, and the basic information includes an identifier and a node type; A management module is used to form a multi-branch tree structure of the nodes based on the parent node ID and the predecessor node ID in the class structure, and display it in the address book management system, wherein the parent node ID is the identifier of the node one level above the node, and the predecessor node ID is the identifier of the node before the node; each of the nodes and the basic information corresponding to each of the nodes are imported into the address book management system; the basic information of each of the nodes is read and traversed, and the parent node ID and predecessor node ID of each of the nodes are determined based on the hierarchical relationship between the nodes in the basic information; specifically including: determining the parent node ID of each of the nodes according to the priority of the node type; based on the same child node list, making the predecessor node ID of the first node of each layer the corresponding parent node ID, and making the predecessor node ID of the subsequent nodes of the layer the identifier of the previous node; repeating the above steps until the predecessor node IDs of all nodes are assigned.
6. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, each step of the address book management method described in any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the address book management method described in any one of claims 1 to 4 is implemented.
8. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Network organization method and device based on binary tree
CN114978921A