WO2018023933A1 - 一种生成思维导图的方法和装置 - Google Patents

一种生成思维导图的方法和装置 Download PDF

Info

Publication number
WO2018023933A1
WO2018023933A1 PCT/CN2016/113383 CN2016113383W WO2018023933A1 WO 2018023933 A1 WO2018023933 A1 WO 2018023933A1 CN 2016113383 W CN2016113383 W CN 2016113383W WO 2018023933 A1 WO2018023933 A1 WO 2018023933A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
file
information
child
current
Prior art date
Application number
PCT/CN2016/113383
Other languages
English (en)
French (fr)
Inventor
朱龙飞
Original Assignee
广州视睿电子科技有限公司
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 广州视睿电子科技有限公司 filed Critical 广州视睿电子科技有限公司
Publication of WO2018023933A1 publication Critical patent/WO2018023933A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/904Browsing; Visualisation therefor

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and apparatus for generating a mind map.
  • the present invention provides a method and apparatus for generating a mind map to facilitate rapid generation of mind maps by importing files of various formats.
  • the embodiment of the present invention adopts the following technical solutions:
  • an embodiment of the present invention provides a method for generating a mind map, including:
  • the node is added according to the location information to generate a mind map.
  • the embodiment of the present invention further provides a device for generating a mind map, including:
  • a file import parsing module configured to import a pre-made formatted file, parse the file, and obtain name information, parent node information, and a set of child nodes of each node;
  • a location information calculation module configured to calculate location information of each node according to the name information, parent node information, and a set of child nodes;
  • the mind map generating module adds the node according to the location information to generate a mind map.
  • the name information, the parent node information, and the child node set of each node are obtained by parsing the file of the set format, and the location of each node is calculated according to the name information, the parent node information, and the child node set of each node.
  • the information is added to the corresponding node according to the location information to generate a mind map;
  • the technical solution can support generating a mind map by parsing the set general format file, and the location information of each node does not need to be included in the file.
  • the file is highly editable and can be edited without mind maps.
  • FIG. 1 is a schematic flow chart of a method for generating a mind map according to Embodiment 1 of the present invention
  • FIG. 2A is a schematic flowchart of a method for generating a mind map according to Embodiment 2 of the present invention
  • FIG. 2B is a schematic flowchart of calculating location information of each node layer by layer by using a breadth-first algorithm according to Embodiment 2 of the present invention
  • FIG. 2C is a schematic flowchart of a queue operation process according to Embodiment 2 of the present invention.
  • FIG. 2D is a schematic structural diagram of a mind map according to Embodiment 2 of the present invention.
  • FIG. 3 is a schematic structural diagram of an apparatus for generating a mind map according to Embodiment 3 of the present invention.
  • FIG. 4A is a schematic structural diagram of an apparatus for generating a mind map according to Embodiment 4 of the present invention.
  • FIG. 4B is a schematic structural diagram of a location information calculation module according to Embodiment 4 of the present invention.
  • FIG. 1 is a schematic flowchart of a method for generating a mind map according to Embodiment 1 of the present invention.
  • the method of this embodiment can be applied to a scenario for establishing a mind map, which can be executed by a terminal such as a smartphone, a tablet computer, and a computer.
  • the mind map also called the mind map, is an effective graphical thinking tool for expressing empiric thinking.
  • the method for generating a mind map may include the following steps:
  • S110 Import a file in a pre-made format, parse the file, and obtain name information, parent node information, and a collection of child nodes of each node.
  • a file prepared in a pre-made general format is imported.
  • the file in a common format includes files in a format such as xml, json, and html, and the imported file is parsed to obtain name information, parent node information, and child node sets of each node.
  • the parent node information of the node may be empty, for example, the parent node does not exist in the root node, and the child node set of the node may be an empty set, for example, the child node set of the leaf node is an empty set.
  • S120 Calculate location information of each node according to the name information, the parent node information, and the child node set.
  • the position information of each node in the page displaying the mind map may be calculated by an algorithm such as a breadth-first algorithm and a depth-first algorithm.
  • Embodiment 2 of the present invention provides an optional implementation manner of calculating a node position by using a breadth-first algorithm, and details of how to calculate a node position are not described herein.
  • the corresponding node is inserted and inserted at the corresponding position of the page to generate a mind map. It should be noted here that as the node is inserted, the mind map is updated, and the content of the mind map is updated accordingly.
  • a file of a pre-made format is imported, a file is parsed, name information of each node, parent node information, and a set of child nodes are obtained, and each name is calculated according to the name information, the parent node information, and the child node set.
  • the location information of the nodes adding nodes according to the location information, generating a mind map; generating a mind map by parsing the set general format file, and the file does not need to include the location information of each node, thereby avoiding generating a mind map
  • the file is highly editable and can be edited without a mind map.
  • FIG. 2A is a schematic flowchart diagram of a method for generating a mind map according to Embodiment 2 of the present invention.
  • the main difference between this embodiment and the first embodiment is that the content of the definition data model is added, and the content of the file in the set format is added according to the data model.
  • the optional implementation of the above S120 is added.
  • the method for generating a mind map may include the following steps:
  • the data model of the mind map can be defined first.
  • a mind map is a tool that presents various levels of topics with mutual affiliation and related hierarchical relationships, so the data model can be defined as: a combination of a root node and a collection of multiple child nodes.
  • the root node includes corresponding name information and a set of child nodes.
  • the child node also includes corresponding name information and a set of child nodes, and the child node further includes corresponding parent node information.
  • S220 Create a file in a format according to a data model.
  • the content to be displayed may be added at each node defined in the data model, and saved as a file of a common format, taking an xml format file as an example, the root node
  • the tag is named RootNode
  • the tag of the child node is named Node.
  • the node When the child node set of a node is not an empty set, the node also contains the Children attribute, and each element in the Children is also a Node.
  • S230 Import a file in a pre-made set format, parse the file, and obtain name information, parent node information, and a set of child nodes of each node.
  • xml format file when parsing the imported xml file, use xml
  • the parsing method of the format file is parsed, and the root node RootNode and the corresponding name information and the child node set are obtained according to the preset label in the xml format file, and each child node Node and corresponding name information, parent node information, and child node set are obtained.
  • S240 Calculate location information of each node according to the name information, the parent node information, and the child node set.
  • the location information of each node can be calculated layer by layer by the breadth-first algorithm, and the specific process is as follows:
  • Step A Initialize the queue, and put a root node in the queue
  • Step B When the queue is non-empty, step C is performed; when the queue is empty, the operation is ended;
  • Step C The coordinate system is established by taking the leftmost center position of the page as the coordinate origin, the horizontal direction as the horizontal axis, and the vertical direction as the vertical axis, and the current node (to be inserted into the node) is obtained from the out queue to determine whether the parent node of the current node exists. If it does not exist, it is determined that the current node is the root node, the preset current node is displayed at the coordinate origin, and step E is performed; if yes, it is determined that the current node is not the root node, according to the location information of the parent node of the current node, and the current node. The number of inserted child nodes of the parent node calculates the current position that the current node should be inserted, presets the current node to insert the display at the current position and connects with the parent node of the current node, and performs step D;
  • step C the method of establishing a coordinate system may be different in different mind mapping tools.
  • some mind mapping tools may also specify that the rightmost center position of the page is the coordinate origin. Or stipulate that the uppermost position of the page is the coordinate origin, etc.
  • the spacing of each node specified in different mind mapping tools is generally different;
  • Step D dynamically calculating corresponding position information of other nodes, and dynamically adjusting positions of other nodes according to corresponding position information
  • step D in order to maintain the coordination of the overall layout when displaying the mind map, according to the style habit of extending the mind map to the right, firstly, the position of other child nodes in the parent node of the current node needs to be adjusted, and then the position of each node is adjusted layer by layer from the parent node of the current node parent node, and the ideas of other nodes are adjusted. It is to adjust the position of each node layer by layer;
  • Step E If the child node set of the current node is a non-empty set, all the child nodes in the child node set of the current node are put into the queue one by one, and the process returns to step C; if the child node set of the current node is an empty set, Then return to step B.
  • FIG. 2D To better illustrate the process of calculating the location information of each node layer by layer according to the breadth-first algorithm according to the name information, the parent node information, and the child node set according to the embodiment of the present invention, refer to FIG. 2D, the flow in FIG. 2D, and the foregoing steps.
  • the contents of A to E are overall consistent.
  • node N enters the queue; determine that the queue is non-empty, node N dequeue, determine that node N is the root node and includes child node N1 and child node N2, node N1 and node N2 enters the queue, and the node N is placed at the leftmost center position of the page; the queue is determined to be non-empty, the node N1 is dequeued, and it is determined that N1 is not the root node, the parent node of N1 is N, there is no child node, and the node N1 is placed.
  • the first child node of the root node N is displayed; the queue is non-empty, the node N2 is dequeued, and it is determined that N2 is not the root node, and the parent node of N2 is N, including the child node N21 and the child node N22, the node N21 and the node N22.
  • a general format is created according to a predefined data model.
  • the file parsing the file, obtaining the name information of each node, the parent node information, and the child node set, and calculating the location information of each node by the breadth-first algorithm according to the name information, the parent node information, and the child node set, and adding the node according to the location information.
  • Generating a mind map generating a mind map by parsing a set general format file created according to a predefined data model, and the location information of each node need not be included in the file, thereby avoiding manually adding one by one when generating the mind map
  • the node is in trouble, and the file is very editable and can be edited without mind mapping.
  • a method for generating a mind map, and a device for generating a mind map according to an embodiment of the present invention belong to a general inventive concept, and details not specifically described in an embodiment of a device for generating a mind map, Reference may be made to an embodiment of the above method of generating a mind map.
  • FIG. 3 is a schematic structural diagram of an apparatus for generating a mind map according to Embodiment 3 of the present invention.
  • the apparatus 300 for generating a mind map may include the following contents:
  • the file import parsing module 310 is configured to import a file in a pre-made format, parse the file, and obtain name information, parent node information, and a set of child nodes of each node.
  • the location information calculation module 320 is configured to calculate location information of each node according to the name information, the parent node information, and the set of child nodes.
  • the mind map generating module 330 is configured to add a node according to the location information to generate a mind map.
  • the location information calculation module 320 is specifically configured to calculate location information of each node layer by layer according to the name information, the parent node information, and the child node set by using a breadth-first algorithm.
  • the above format file includes format files such as xml, json, and html.
  • the file of the pre-made format is imported, and the file is parsed.
  • the name information, the parent node information, and the child node set of each node are calculated according to the name information, the parent node information, and the child node set, and the location information of each node is calculated, and the node is added according to the location information to generate a mind map;
  • the general format file is used to generate the mind map, and the location information of each node does not need to be included in the file, thereby avoiding the trouble of manually adding nodes one by one when generating the mind map, and the file is highly editable and does not require a mind guide.
  • the diagram can also be edited.
  • FIG. 4A is a schematic structural diagram of an apparatus for generating a mind map according to Embodiment 4 of the present invention.
  • the apparatus 400 for generating a mind map may include the following contents:
  • a data model definition module 410 configured to define a data model, wherein the data model includes a root node and a plurality of child node sets;
  • the file creation module 420 is configured to create a file in a format according to the data model.
  • the file import parsing module 430 is configured to import a file of a pre-made set format, parse the file, and obtain name information, parent node information, and a set of child nodes of each node.
  • the location information calculation module 440 is configured to calculate location information of each node according to the name information, the parent node information, and the set of child nodes.
  • the mind map generating module 450 is configured to add a node according to the location information to generate a mind map.
  • the file import parsing module 430 is specifically configured to: import a file in a pre-made format, parse the file, obtain the root node name information and the child node set according to the preset label, and name information of each child node, the parent node. Information and collection of child nodes.
  • the location information calculation module 440 may include the following content:
  • the initialization sub-module 441 is used to initialize the queue, and the root node is placed in the queue.
  • a queue judging sub-module 442 configured to add a sub-module when the queue is non-empty; When it is empty, the operation ends.
  • the node adding sub-module 443 is configured to establish a coordinate system by using the leftmost center position of the page as the coordinate origin, the horizontal direction as the horizontal axis, and the vertical direction as the vertical axis, and the current node is obtained by the out queue, and the parent node of the current node is determined to exist. If it does not exist, it is determined that the current node is the root node, the preset current node is displayed at the coordinate origin, and the following queue update sub-module 445 is run; if yes, it is determined that the current node is not the root node, according to the location of the current node's parent node.
  • the information, and the number of inserted child nodes of the parent node of the current node calculate the current position that the current node should be inserted, preset the current node to insert the display at the current position and connect with the parent node of the current node, and run the following dynamic adjustment submodule 444 .
  • the dynamic adjustment sub-module 444 is configured to dynamically calculate corresponding location information of other nodes, and dynamically adjust the positions of other nodes according to the corresponding location information.
  • the queue update sub-module 445 is configured to: if the child node set of the current node is a non-empty set, put all the child nodes in the current node's child node set into the queue one by one, and run the above node to add the sub-module 443; The set of child nodes is an empty set, and the above-mentioned queue judgment sub-module 442 is executed.
  • a file with a common format is created, a file is parsed, and name information, parent node information, and child node sets of each node are obtained, according to the name information and the parent node information.
  • a set of child nodes calculating position information of each node by a breadth-first algorithm, adding a node according to the position information, generating a mind map; generating a mind map by parsing a set general format file created according to a predefined data model, and the The file does not need to contain the location information of each node, avoiding the trouble of manually adding nodes one by one when generating the mind map, and the file is highly editable and can be edited without mind map.

Landscapes

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

Abstract

一种生成思维导图的方法和装置,所述生成思维导图的方法包括:导入预先制作的设定格式的文件,解析文件,获得每个节点的名称信息、父节点信息和子节点集合(S110);根据名称信息、父节点信息和子节点集合,计算每个节点的位置信息(S120);根据位置信息添加节点,生成思维导图(S130)。通过解析设定的通用格式文件来生成思维导图,且该文件中无需包含每个节点的位置信息,避免在生成思维导图时,逐个手动添加节点的麻烦,同时该文件的可编辑性很强,无需思维导图也可进行编辑。

Description

一种生成思维导图的方法和装置 技术领域
本发明涉及计算机技术领域,尤其涉及一种生成思维导图的方法和装置。
背景技术
目前市面上有较多思维导图软件,比如XMind、iMindMap及百度脑图等,这些软件构建思维导图主要有两种方式:一是打开相应软件后,通过快捷键或右键的方式添加一个个节点生成思维导图;二是通过打开软件支持的格式的文档来生成思维导图。
针对上述第一种方式,通过添加一个个节点生成思维导图,这种方式生成速度较慢,需要依赖具体的思维导图工具进行编辑,不利于制作这种自由性强、组织性强的思维工具;针对上述第二种方式,通过打开特定格式的文档来生成思维导图,这种方式对文档格式要求较高,必须是软件本身保存的格式,或者是目前主流思维导图工具保存的格式,因此在解析其他非主流思维导图工具保存的文档时,成本较高,不同工具定位的文件格式不尽相同,无法覆盖到目前大部分的思维导图工具,只能兼容主流厂商的思维导图工具。
发明内容
为解决相关技术问题,本发明提供一种生成思维导图的方法和装置,以方便通过导入的各种格式的文件快速生成思维导图。
为实现上述目的,本发明实施例采用如下技术方案:
第一方面,本发明实施例提供了一种生成思维导图的方法,包括:
导入预先制作的设定格式的文件,解析所述文件,获得每个节点的名称信息、父节点信息和子节点集合;
根据所述名称信息、父节点信息和子节点集合,计算每个节点的位置信息;
根据所述位置信息添加所述节点,生成思维导图。
第二方面,本发明实施例还对应提供了一种生成思维导图的装置,包括:
文件导入解析模块,用于导入预先制作的设定格式的文件,解析所述文件,获得每个节点的名称信息、父节点信息和子节点集合;
位置信息计算模块,用于根据所述名称信息、父节点信息和子节点集合,计算每个节点的位置信息;
思维导图生成模块,根据所述位置信息添加所述节点,生成思维导图。
本发明实施例提供的技术方案带来的有益效果:
本技术方案中,通过解析设定格式的文件,获得每个节点的名称信息、父节点信息和子节点集合,并根据每个节点的名称信息、父节点信息和子节点集合,计算每个节点的位置信息,根据位置信息在相应的位置添加相应的节点,生成思维导图;本技术方案可支持通过解析设定的通用格式文件来生成思维导图,且该文件中无需包含每个节点的位置信息,避免在生成思维导图时,逐个手动添加节点的麻烦,同时该文件的可编辑性很强,无需思维导图也可进行编辑。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对本发明实施例描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是 本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据本发明实施例的内容和这些附图获得其他的附图。
图1是本发明实施例一提供的一种生成思维导图的方法的流程示意图;
图2A是本发明实施例二提供的一种生成思维导图的方法的流程示意图;
图2B是本发明实施例二提供的一种通过广度优先算法逐层计算每个节点的位置信息的流程示意图;
图2C是本发明实施例二提供的队列操作流程示意图;
图2D是本发明实施例二提供的一种思维导图的结构示意图;
图3是本发明实施例三提供的一种生成思维导图的装置的架构示意图;
图4A是本发明实施例四提供的一种生成思维导图的装置的架构示意图;
图4B是本发明实施例四提供的位置信息计算模块的架构示意图。
具体实施方式
为使本发明解决的技术问题、采用的技术方案和达到的技术效果更加清楚,下面将结合附图对本发明实施例的技术方案作进一步的详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
实施例一
请参考图1,其是本发明实施例一提供的一种生成思维导图的方法的流程示意图。本实施例的方法可以应用于建立思维导图的场景,可以由智能手机、平板电脑和计算机等终端来执行。思维导图又叫心智图,是一种表达发射性思维的有效的图形思维工具。
该生成思维导图的方法,可以包括如下步骤:
S110:导入预先制作的设定格式的文件,解析文件,获得每个节点的名称信息、父节点信息和子节点集合。
示例性的,导入预先制作的通用格式的文件,通用格式的文件包括例如xml、json和html等格式的文件,对导入的文件进行解析,获得每个节点的名称信息、父节点信息和子节点集合。需要说明的是,节点的父节点信息可以为空不存在,例如根节点不存在父节点,节点的子节点集合可以为空集,例如叶子节点的子节点集合为空集。
S120:根据名称信息、父节点信息和子节点集合,计算每个节点的位置信息。
示例性的,根据上述解析获得的每个节点的名称信息、父节点信息和子节点集合,可以通过广度优先算法、深度优先算法等算法计算每个节点在显示思维导图的页面中的位置信息。本发明实施例二提供了一种采用广度优先算法计算节点位置的可选实施方式,在此对具体如何计算节点位置不加以赘述。
S130:根据位置信息添加节点,生成思维导图。
示例性的,根据上述S120计算出的节点的位置信息,在页面的相应位置处插入添加相应的节点,生成思维导图。在此需要说明的是,随着节点的插入,思维导图处于更新状态,思维导图的内容也会相应地更新。
综上,在本技术方案中,导入预先制作的设定格式的文件,解析文件,获得每个节点的名称信息、父节点信息和子节点集合,根据名称信息、父节点信息和子节点集合,计算每个节点的位置信息,根据位置信息添加节点,生成思维导图;通过解析设定的通用格式文件来生成思维导图,且该文件中无需包含每个节点的位置信息,避免在生成思维导图时,逐个手动添加节点的麻烦,同 时该文件的可编辑性很强,无需思维导图也可进行编辑。
实施例二
请参考图2A和图2B,其中,图2A是本发明实施例二提供的一种生成思维导图的方法的流程示意图。本实施例与实施例一的主要区别在于,增加了定义数据模型的内容,及增加了根据数据模型,制作设定格式的文件的内容,本增加了上述S120的可选的实施方式。
该生成思维导图的方法,可以包括如下步骤:
S210:定义数据模型。
示例性的,为兼容不同的通用格式,可以先定义思维导图的数据模型。思维导图是一个将各级主题用相互隶属关系与相关的层级关系来呈现的工具,因此该数据模型可以定义成:一个根节点和多个子节点集合的组合。其中,根节点包括相应的名称信息和子节点集合,同理,子节点也包括相应的名称信息和子节点集合,子节点还包括相应的父节点信息。
S220:根据数据模型,制作设定格式的文件。
示例性的,根据上述预先定义好的数据模型,可以在数据模型中定义的各节点处添加相应要显示的内容,保存为设定的通用格式的文件,以xml格式文件为例,根节点的标签名为RootNode,子节点的标签名为Node,当某个节点的子节点集合不为空集时,则该节点还包含Children属性,Children中的每个元素同时也是一个Node。
S230:导入预先制作的设定格式的文件,解析文件,获得每个节点的名称信息、父节点信息和子节点集合。
示例性的,以导入xml格式文件为例,在解析导入的xml文件时,采用xml 格式文件的解析方法来解析,根据xml格式文件中预设的标签获得根节点RootNode及相应的名称信息和子节点集合,获得每个子节点Node及相应的名称信息、父节点信息和子节点集合。
S240:根据名称信息、父节点信息和子节点集合,计算每个节点的位置信息。
示例性的,结合图2B和图2C,根据名称信息、父节点信息和子节点集合,可以通过广度优先算法逐层计算每个节点的位置信息,且具体流程如下:
步骤A、初始化队列,在队列中放入根节点;
步骤B、当队列为非空时,执行步骤C;当队列为空时,则结束操作;
步骤C、以页面最左侧居中位置为坐标原点、水平方向为横轴及竖直方向为纵轴建立坐标系,出队列获得当前节点(待插入节点),判断当前节点的父节点是否存在,若不存在,则确定当前节点为根节点,预置当前节点在坐标原点显示,执行步骤E;若存在,则确定当前节点不为根节点,根据当前节点的父节点的位置信息,及当前节点的父节点的已插入子节点个数计算当前节点应插入的当前位置,预置当前节点在当前位置插入显示并与当前节点的父节点连接,执行步骤D;
需要说明的是,在步骤C中,在不同的思维导图工具中,建立坐标系的方法可能会不一样,例如,有的思维导图工具也可能规定页面最右侧居中位置为坐标原点,或规定页面最上端居中位置为坐标原点等,此外,不同思维导图工具中规定各节点的间距一般也不相同;
步骤D、动态计算其他节点的相应位置信息,根据相应位置信息相应地动态调整其他节点的位置;
需要说明的是,在步骤D中,为保持显示思维导图时整体布局的协调性, 根据向右扩展思维导图的风格习惯,首先需要调整当前节点的父节点中其他子节点的位置,然后从当前节点父节点的父节点开始向上逐层调整各节点的位置,调整其他节点的思路是向下逐层调整各节点的位置;
步骤E、若当前节点的子节点集合为非空集合,则将当前节点的子节点集合中的全部子节点逐个放入到队列,返回执行步骤C;若当前节点的子节点集合为空集,则返回步骤B。
为更好地说明本发明实施例的根据名称信息、父节点信息和子节点集合,通过广度优先算法逐层计算每个节点的位置信息的过程,请参考图2D,图2D中的流程与上述步骤A至步骤E的内容整体上是一致的。
具体的实施过程请参考图2C和图2D,初始化一个队列;节点N入队;确定队列非空,节点N出队,确定节点N为根节点并包括子节点N1和子节点N2,节点N1和节点N2入队,将节点N置于页面最左侧居中位置显示;确定队列非空,节点N1出队,确定N1不为根节点,N1的父节点为N,没有子节点,将节点N1置于根节点N的第一个子节点位置处显示;确定队列非空,节点N2出队,确定N2不为根节点,N2的父节点为N,包括子节点N21和子节点N22,节点N21和节点N22入队,将节点N2置于根节点N的第二个子节点位置处显示;确定队列非空,节点N21出队,确定N21不为根节点,N21的父节点为N2,没有子节点,将节点N21置于节点N2的第一个子节点位置处显示;确定队列非空,节点N22出队,确定N22不为根节点,N22的父节点为N2,没有子节点,将节点N22置于节点N2的第二个子节点位置处显示;确定队列为空,结束操作。
S250:根据位置信息添加节点,生成思维导图。
综上,在本技术方案中,根据预先定义好的数据模型,制作设定通用格式 的文件,解析文件,获得每个节点的名称信息、父节点信息和子节点集合,根据名称信息、父节点信息和子节点集合,通过广度优先算法计算每个节点的位置信息,根据位置信息添加节点,生成思维导图;通过解析根据预先定义的数据模型制作的设定通用格式文件来生成思维导图,且该文件中无需包含每个节点的位置信息,避免在生成思维导图时,逐个手动添加节点的麻烦,同时该文件的可编辑性很强,无需思维导图也可进行编辑。
以下为本发明实施例提供的一种生成思维导图的装置的实施例。本发明实施例的一种生成思维导图的方法,和一种生成思维导图的装置属于一个总的发明构思,在一种生成思维导图的装置的实施例中未详尽描述的细节内容,可以参考上述一种生成思维导图的方法的实施例。
实施例三
请参考图3,其是本发明实施例三提供的一种生成思维导图的装置的架构示意图。该一种生成思维导图的装置300,可以包括如下内容:
文件导入解析模块310,用于导入预先制作的设定格式的文件,解析文件,获得每个节点的名称信息、父节点信息和子节点集合。
位置信息计算模块320,用于根据名称信息、父节点信息和子节点集合,计算每个节点的位置信息。
思维导图生成模块330,用于根据位置信息添加节点,生成思维导图。
其中,位置信息计算模块320,具体用于:根据名称信息、父节点信息和子节点集合,通过广度优先算法逐层计算每个节点的位置信息。
其中,上述设定格式文件包括xml、json和html等格式文件。
综上,在本技术方案中,导入预先制作的设定格式的文件,解析文件,获 得每个节点的名称信息、父节点信息和子节点集合,根据名称信息、父节点信息和子节点集合,计算每个节点的位置信息,根据位置信息添加节点,生成思维导图;通过解析设定的通用格式文件来生成思维导图,且该文件中无需包含每个节点的位置信息,避免在生成思维导图时,逐个手动添加节点的麻烦,同时该文件的可编辑性很强,无需思维导图也可进行编辑。
实施例四
请参考图4A和图4B,其中,图4A是本发明实施例四提供的一种生成思维导图的装置的架构示意图。该一种生成思维导图的装置400,可以包括如下内容:
数据模型定义模块410,用于定义数据模型,其中,数据模型包括一个根节点和多个子节点集合;
文件制作模块420,用于根据数据模型,制作设定格式的文件。
文件导入解析模块430,用于导入预先制作的设定格式的文件,解析文件,获得每个节点的名称信息、父节点信息和子节点集合。
位置信息计算模块440,用于根据名称信息、父节点信息和子节点集合,计算每个节点的位置信息。
思维导图生成模块450,用于根据位置信息添加节点,生成思维导图。
其中,文件导入解析模块430,具体用于:导入预先制作的设定格式的文件,解析文件,根据预设的标签获得根节点的名称信息和子节点集合,及每个子节点的名称信息、父节点信息和子节点集合。
其中,如图4B所示,位置信息计算模块440,可以包括如下内容:
初始化子模块441,用于初始化队列,在队列中放入根节点。
队列判断子模块442,用于当队列为非空时,运行节点添加子模块;当队列 为空时,则结束操作。
节点添加子模块443,用于以页面最左侧居中位置为坐标原点、水平方向为横轴及竖直方向为纵轴建立坐标系,出队列获得当前节点,判断当前节点的父节点是否存在,若不存在,则确定当前节点为根节点,预置当前节点在坐标原点显示,运行下述队列更新子模块445;若存在,则确定当前节点不为根节点,根据当前节点的父节点的位置信息,及当前节点的父节点的已插入子节点个数计算当前节点应插入的当前位置,预置当前节点在当前位置插入显示并与当前节点的父节点连接,运行下述动态调整子模块444。
动态调整子模块444,用于动态计算其他节点的相应位置信息,根据相应位置信息相应地动态调整其他节点的位置。
队列更新子模块445,用于若当前节点的子节点集合为非空集合,则将当前节点的子节点集合中的全部子节点逐个放入到队列,运行上述节点添加子模块443;若当前节点的子节点集合为空集,则运行上述队列判断子模块442。
综上,在本技术方案中,根据预先定义好的数据模型,制作设定通用格式的文件,解析文件,获得每个节点的名称信息、父节点信息和子节点集合,根据名称信息、父节点信息和子节点集合,通过广度优先算法计算每个节点的位置信息,根据位置信息添加节点,生成思维导图;通过解析根据预先定义的数据模型制作的设定通用格式文件来生成思维导图,且该文件中无需包含每个节点的位置信息,避免在生成思维导图时,逐个手动添加节点的麻烦,同时该文件的可编辑性很强,无需思维导图也可进行编辑。
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员 会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。

Claims (10)

  1. 一种生成思维导图的方法,其特征在于,包括:
    导入预先制作的设定格式的文件,解析所述文件,获得每个节点的名称信息、父节点信息和子节点集合;
    根据所述名称信息、父节点信息和子节点集合,计算每个节点的位置信息;
    根据所述位置信息添加所述节点,生成思维导图。
  2. 如权利要求1所述的方法,其特征在于,在所述导入预先制作的设定格式的文件之前,还包括:
    定义数据模型,其中,所述数据模型包括一个根节点和多个子节点集合;
    根据所述数据模型,制作设定格式的文件。
  3. 如权利要求1所述的方法,其特征在于,所述根据所述名称信息、父节点信息和子节点集合,计算每个节点的位置信息,包括:
    根据所述名称信息、父节点信息和子节点集合,通过广度优先算法逐层计算每个节点的位置信息。
  4. 如权利要求3所述的方法,其特征在于,所述导入预先制作的设定格式的文件,解析所述文件,获得每个节点的名称信息、父节点信息和子节点集合,包括:
    导入预先制作的设定格式的文件,解析所述文件,根据预设的标签获得根节点的名称信息和子节点集合,及每个子节点的名称信息、父节点信息和子节点集合;
    所述根据所述名称信息、父节点信息和子节点集合,通过广度优先算法逐层计算每个节点的位置信息,包括:
    步骤A、初始化队列,在所述队列中放入所述根节点;
    步骤B、当所述队列为非空时,执行步骤C;当所述队列为空时,则结束 操作;
    步骤C、以页面最左侧居中位置为坐标原点、水平方向为横轴及竖直方向为纵轴建立坐标系,出队列获得当前节点,判断当前节点的父节点是否存在,若不存在,则确定当前节点为根节点,预置当前节点在所述坐标原点显示,执行步骤E;若存在,则确定当前节点不为根节点,根据当前节点的父节点的位置信息,及当前节点的父节点的已插入子节点个数计算当前节点应插入的当前位置,预置当前节点在所述当前位置插入显示并与当前节点的父节点连接,执行步骤D;
    步骤D、动态计算其他节点的相应位置信息,根据所述相应位置信息相应地动态调整其他节点的位置;
    步骤E、若当前节点的子节点集合为非空集合,则将当前节点的子节点集合中的全部子节点逐个放入到所述队列,返回执行步骤C;若当前节点的子节点集合为空集,则返回步骤B。
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述设定格式文件包括xml格式文件、json格式文件和html格式文件。
  6. 一种生成思维导图的装置,其特征在于,包括:
    文件导入解析模块,用于导入预先制作的设定格式的文件,解析所述文件,获得每个节点的名称信息、父节点信息和子节点集合;
    位置信息计算模块,用于根据所述名称信息、父节点信息和子节点集合,计算每个节点的位置信息;
    思维导图生成模块,用于根据所述位置信息添加所述节点,生成思维导图。
  7. 如权利要求6所述的装置,其特征在于,还包括:
    数据模型定义模块,用于定义数据模型,其中,所述数据模型包括一个根 节点和多个子节点集合;
    文件制作模块,用于根据所述数据模型,制作设定格式的文件。
  8. 如权利要求6所述的装置,其特征在于,所述位置信息计算模块,具体用于:
    根据所述名称信息、父节点信息和子节点集合,通过广度优先算法逐层计算每个节点的位置信息。
  9. 如权利要求8所述的装置,其特征在于,所述文件导入解析模块,具体用于:
    导入预先制作的设定格式的文件,解析所述文件,根据预设的标签获得根节点的名称信息和子节点集合,及每个子节点的名称信息、父节点信息和子节点集合;
    所述位置信息计算模块,包括:
    初始化子模块,用于初始化队列,在所述队列中放入所述根节点;
    队列判断子模块,用于当所述队列为非空时,运行节点添加子模块;当所述队列为空时,则结束操作;
    节点添加子模块,用于以页面最左侧居中位置为坐标原点、水平方向为横轴及竖直方向为纵轴建立坐标系,出队列获得当前节点,判断当前节点的父节点是否存在,若不存在,则确定当前节点为根节点,预置当前节点在所述坐标原点显示,运行队列更新子模块;若存在,则确定当前节点不为根节点,根据当前节点的父节点的位置信息,及当前节点的父节点的已插入子节点个数计算当前节点应插入的当前位置,预置当前节点在所述当前位置插入显示并与当前节点的父节点连接,运行动态调整子模块;
    动态调整子模块,用于动态计算其他节点的相应位置信息,根据所述相应 位置信息相应地动态调整其他节点的位置;
    队列更新子模块,用于若当前节点的子节点集合为非空集合,则将当前节点的子节点集合中的全部子节点逐个放入到所述队列,运行节点添加子模块;若当前节点的子节点集合为空集,则运行队列判断子模块。
  10. 如权利要求6-9任一项所述的装置,其特征在于,所述设定格式文件包括xml格式文件、json格式文件和html格式文件。
PCT/CN2016/113383 2016-08-03 2016-12-30 一种生成思维导图的方法和装置 WO2018023933A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610634505.2 2016-08-03
CN201610634505.2A CN106294664B (zh) 2016-08-03 2016-08-03 一种生成思维导图的方法和装置

Publications (1)

Publication Number Publication Date
WO2018023933A1 true WO2018023933A1 (zh) 2018-02-08

Family

ID=57665215

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113383 WO2018023933A1 (zh) 2016-08-03 2016-12-30 一种生成思维导图的方法和装置

Country Status (2)

Country Link
CN (1) CN106294664B (zh)
WO (1) WO2018023933A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078217A (zh) * 2019-11-18 2020-04-28 浙江大搜车软件技术有限公司 脑图生成方法、装置和计算机可读存储介质
CN113050933A (zh) * 2021-06-02 2021-06-29 上海钛米机器人股份有限公司 脑图数据处理方法、装置、设备及存储介质
CN113205881A (zh) * 2021-06-02 2021-08-03 中国人民解放军军事科学院军事医学研究院 基于思维导图的OpenEHR原型与模板自动生成方法
CN116071028A (zh) * 2023-03-07 2023-05-05 徐工汉云技术股份有限公司 设备监控流程图生成方法、装置、电子设备和存储介质

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107885713B (zh) * 2017-11-28 2021-12-14 广州视源电子科技股份有限公司 文件格式转换方法、装置、设备和存储介质
CN109324722B (zh) * 2018-07-23 2021-04-06 广州视源电子科技股份有限公司 思维导图的节点添加方法、装置、设备及存储介质
CN109241279B (zh) * 2018-07-27 2022-11-22 联想(北京)有限公司 一种生成思维导图的方法和电子设备
CN109740122B (zh) * 2018-12-11 2023-08-29 中国联合网络通信集团有限公司 思维导图用例文件的转换方法及装置
CN111383298A (zh) * 2018-12-27 2020-07-07 广州市久邦数码科技有限公司 一种思维导图的转换方法及装置
CN109933766B (zh) * 2019-03-13 2023-07-28 腾讯科技(深圳)有限公司 文件生成方法、装置及存储介质
CN110110305A (zh) * 2019-04-02 2019-08-09 北京大麦地信息技术有限公司 一种在线绘制思维导图的方法及装置
CN112036807A (zh) * 2020-07-27 2020-12-04 正方软件股份有限公司 一种基于思维导图的培养方案制定方法
CN112925928A (zh) * 2021-03-25 2021-06-08 深圳市商汤科技有限公司 数据处理方法及装置、电子设备及计算机可读存储介质
CN113392225A (zh) * 2021-06-07 2021-09-14 李超 一种思维导图的生成方法、系统以及电子设备
CN113628301A (zh) * 2021-08-11 2021-11-09 杭州安恒信息技术股份有限公司 一种基于vue的思维脑图绘制方法及相关装置
CN114048356B (zh) * 2022-01-12 2022-06-17 广东粤港澳大湾区硬科技创新研究院 一种知识录入方法、装置及存储介质
WO2023159569A1 (zh) * 2022-02-28 2023-08-31 京东方科技集团股份有限公司 显示系统、轨迹点序列的处理方法、存储介质、设备
CN115963974A (zh) * 2023-01-13 2023-04-14 广州朗国电子科技股份有限公司 一种思维导图生成方法、装置及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6618723B1 (en) * 2000-11-22 2003-09-09 Clear Direction, Inc. Interpersonal development communications system and directory
CN103176896A (zh) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 一种测试用例的生成方法及装置
CN104915410A (zh) * 2015-06-04 2015-09-16 福建天晴数码有限公司 一种思维导图保存及加载方法、保存及加载系统
CN105653650A (zh) * 2015-12-28 2016-06-08 湖北工业大学 一种基于d3的研讨系统思维导图及其开发方法
CN105760447A (zh) * 2016-02-03 2016-07-13 网易(杭州)网络有限公司 思维导图的处理方法、服务器和客户端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6618723B1 (en) * 2000-11-22 2003-09-09 Clear Direction, Inc. Interpersonal development communications system and directory
CN103176896A (zh) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 一种测试用例的生成方法及装置
CN104915410A (zh) * 2015-06-04 2015-09-16 福建天晴数码有限公司 一种思维导图保存及加载方法、保存及加载系统
CN105653650A (zh) * 2015-12-28 2016-06-08 湖北工业大学 一种基于d3的研讨系统思维导图及其开发方法
CN105760447A (zh) * 2016-02-03 2016-07-13 网易(杭州)网络有限公司 思维导图的处理方法、服务器和客户端

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078217A (zh) * 2019-11-18 2020-04-28 浙江大搜车软件技术有限公司 脑图生成方法、装置和计算机可读存储介质
CN113050933A (zh) * 2021-06-02 2021-06-29 上海钛米机器人股份有限公司 脑图数据处理方法、装置、设备及存储介质
CN113205881A (zh) * 2021-06-02 2021-08-03 中国人民解放军军事科学院军事医学研究院 基于思维导图的OpenEHR原型与模板自动生成方法
CN116071028A (zh) * 2023-03-07 2023-05-05 徐工汉云技术股份有限公司 设备监控流程图生成方法、装置、电子设备和存储介质
CN116071028B (zh) * 2023-03-07 2023-06-02 徐工汉云技术股份有限公司 设备监控流程图生成方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN106294664A (zh) 2017-01-04
CN106294664B (zh) 2018-04-13

Similar Documents

Publication Publication Date Title
WO2018023933A1 (zh) 一种生成思维导图的方法和装置
US10885056B2 (en) Data standardization techniques
CN106874247B (zh) 一种报表生成方法及装置
CN106156025A (zh) 一种数据标注的管理方法及装置
WO2019134340A1 (zh) 薪资计算方法、应用服务器及计算机可读存储介质
US20140040863A1 (en) Documentation generation for web apis based on byte code analysis
US20190377728A1 (en) Method and system for data analysis with visualization
JP2014520342A (ja) 実行ページの動的更新
US20150178263A1 (en) System and Method for Constructing Markup Language Templates and Input Data Structure Specifications
US9529791B1 (en) Template and content aware document and template editing
CN112131289B (zh) 数据处理方法、装置、电子设备及存储介质
CN110874367A (zh) 结构化查询语言语句的可视化方法和装置
US20150348278A1 (en) Dynamic font engine
US20150254211A1 (en) Interactive data manipulation using examples and natural language
CN110955803A (zh) 基于图数据库的关系图谱的绘制方法、装置、设备及介质
CN110909168B (zh) 知识图谱的更新方法和装置、存储介质及电子装置
KR102574306B1 (ko) 동적 조판
CN107515866B (zh) 一种数据操作方法、装置和系统
CN113626223A (zh) 一种接口调用方法和装置
US8762398B2 (en) Method of integrating data of XML document with database on web
WO2015031610A1 (en) Method and apparatus for generating health quality metrics
US9189486B2 (en) Autonomic generation of document structure in a content management system
CN112463261B (zh) 接口调用方法、装置、电子设备、介质及产品
CN103914293A (zh) 生成页面的方法及服务器
CN112560490A (zh) 知识图谱关系抽取方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16911528

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16911528

Country of ref document: EP

Kind code of ref document: A1