[go: up one dir, main page]

CN112668143B - A method for dynamic visualization and automatic layout of command relationship hierarchy - Google Patents

A method for dynamic visualization and automatic layout of command relationship hierarchy Download PDF

Info

Publication number
CN112668143B
CN112668143B CN202011322788.XA CN202011322788A CN112668143B CN 112668143 B CN112668143 B CN 112668143B CN 202011322788 A CN202011322788 A CN 202011322788A CN 112668143 B CN112668143 B CN 112668143B
Authority
CN
China
Prior art keywords
command
entities
entity
unitpos
node
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.)
Active
Application number
CN202011322788.XA
Other languages
Chinese (zh)
Other versions
CN112668143A (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.)
Beijing Electromechanical Engineering Research Institute
Original Assignee
Beijing Electromechanical Engineering Research Institute
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 Beijing Electromechanical Engineering Research Institute filed Critical Beijing Electromechanical Engineering Research Institute
Priority to CN202011322788.XA priority Critical patent/CN112668143B/en
Publication of CN112668143A publication Critical patent/CN112668143A/en
Application granted granted Critical
Publication of CN112668143B publication Critical patent/CN112668143B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本发明提供了一种指挥关系层次结构动态可视化自动布局方法,在具有层级指挥关系的团体实体之间指挥关系动态变更时保持指挥关系树状层次结构可视化自动布局;所述指挥关系动态变更包括但不限于添加实体、删除实体、添加指挥关系和删除指挥关系;所述指挥关系为具有指向性的标识,从指挥实体指向被指挥实体。本发明所述的指挥关系层次结构动态可视化自动布局方法可实现具有层级指挥关系的团体实体指挥关系,在添加实体,删除实体,添加指挥关系和删除指挥关系动态变化过程中始终维持指挥关系树状层次结构的可视化自动布局,其为具有层级指挥关系的团体信息化指挥系统中指挥关系可视化建模的关键技术。

The present invention provides a method for dynamic visualization and automatic layout of a command relationship hierarchy, which maintains the visualization and automatic layout of the command relationship tree hierarchy when the command relationship between group entities with a hierarchical command relationship changes dynamically; the dynamic change of the command relationship includes but is not limited to adding entities, deleting entities, adding command relationships and deleting command relationships; the command relationship is a directional identifier, pointing from the commanding entity to the commanded entity. The method for dynamic visualization and automatic layout of the command relationship hierarchy described in the present invention can realize the command relationship of group entities with a hierarchical command relationship, and always maintains the visualization and automatic layout of the command relationship tree hierarchy during the dynamic changes of adding entities, deleting entities, adding command relationships and deleting command relationships. It is a key technology for visualization modeling of command relationships in a group informationized command system with a hierarchical command relationship.

Description

一种指挥关系层次结构动态可视化自动布局方法A method for dynamic visualization and automatic layout of command relationship hierarchy

技术领域Technical Field

本发明属于指挥关系信息化技术领域,尤其是涉及一种指挥关系层次结构动态可视化自动布局方法。The invention belongs to the technical field of command relationship informationization, and in particular relates to a command relationship hierarchical structure dynamic visualization automatic layout method.

背景技术Background Art

具有层级指挥关系的团队,如公司、学校或军队,在进行机构的运营指挥模拟时大多基于按一定比例缩小或仿真建模的实体,例如传统的军事推演、作战指挥中主要是采用沙盘作业的方式进行,根据军事想定的作战内容和要求,在按一定比例尺缩制的地形模型上,以兵棋显示作战双方情况来研练战役、战斗组织指挥,可以使作业者加深对作战理论原则的理解,提高组织指挥能力。但是,沙盘作业需要指挥员制作地形模型以及手动部署兵棋等,操作复杂。而且在作战区域较大时,沙盘作业需要采用比例尺较小的沙盘,不能详细地显示作战区域的具体情况,对指挥员及其指挥机关的使用有一定限制。另一方面,现代战争系统十分庞大并且高度复杂,通常涉及多兵种,多系统联合作战,传统的作战指挥方式已无法满足现代复杂战争系统的需求。其他具有层级指挥关系的团队(如公司、学校)同样面临着与上述情况相似的问题与需求。采用信息化技术手段,对整体态势进行可视化建模,实现复杂系统的远程高效指挥是具有层级指挥关系的团队良好运转的关键,其中,指挥关系可视化技术,特别是在指挥关系发生调整和变更后保持指挥关系可视化的树状层次结构布局是一项关键核心技术。Teams with hierarchical command relationships, such as companies, schools, or the military, mostly conduct operational command simulations based on entities that are scaled down or simulated at a certain scale. For example, traditional military simulations and combat commands are mainly conducted in the form of sand table operations. According to the combat content and requirements of military assumptions, war games are used to display the situation of both sides of the war on a terrain model scaled down at a certain scale to practice the organization and command of campaigns and battles. This can enable operators to deepen their understanding of combat theory principles and improve their organizational command capabilities. However, sand table operations require commanders to make terrain models and manually deploy war games, which is complicated to operate. Moreover, when the combat area is large, sand table operations require the use of sand tables with smaller scales, which cannot display the specific situation of the combat area in detail, and have certain restrictions on the use of commanders and their command agencies. On the other hand, modern war systems are very large and highly complex, usually involving joint operations of multiple arms and multiple systems. Traditional combat command methods can no longer meet the needs of modern complex war systems. Other teams with hierarchical command relationships (such as companies and schools) also face similar problems and needs as the above. Using information technology to visualize the overall situation and achieve efficient remote command of complex systems is the key to the smooth operation of a team with hierarchical command relationships. Command relationship visualization technology, especially the tree-like hierarchical layout that maintains visualization of command relationships after adjustments and changes to the command relationships, is a key core technology.

发明内容Summary of the invention

有鉴于此,本发明旨在提出一种指挥关系层次结构动态可视化自动布局方法,以解决采用沙盘作业需要采用比例尺较小的沙盘,不能详细地显示所属区域内的具体情况,对指挥员及指挥领导机关的使用有一定限制的问题。In view of this, the present invention aims to propose a method for dynamic visualization and automatic layout of command relationship hierarchy, so as to solve the problem that sand table operation requires the use of a smaller scale sand table, which cannot display the specific situation in the area in detail and has certain limitations on the use of commanders and command leadership organs.

为达到上述目的,本发明的技术方案是这样实现的:To achieve the above object, the technical solution of the present invention is achieved as follows:

一种指挥关系层次结构动态可视化自动布局方法,在具有层级指挥关系的团体实体之间指挥关系动态变更时保持指挥关系树状层次结构可视化自动布局;所述指挥关系动态变更包括但不限于添加实体、删除实体、添加指挥关系和删除指挥关系;所述指挥关系为具有指向性的标识,从指挥实体指向被指挥实体;A command relationship hierarchical structure dynamic visualization automatic layout method is provided, which maintains the command relationship tree-like hierarchical structure visualization automatic layout when the command relationship between group entities with hierarchical command relationship is dynamically changed; the command relationship dynamic change includes but is not limited to adding entities, deleting entities, adding command relationships and deleting command relationships; the command relationship is a directional identifier, which points from the commanding entity to the commanded entity;

所述树状层次结构可视化自动布局用于对指挥关系图中的每一个连通子图采用树形层次结构进行可视化布局显示;The tree-like hierarchical structure visualization automatic layout is used to visualize the layout of each connected subgraph in the command relationship graph using a tree-like hierarchical structure;

指挥实体布局时垂直方向上位于被指挥实体的上一个层次,水平方向上位于所有被指挥实体的中间,多个连通子图水平并列布局显示。When the commanding entity is laid out, it is located at the upper level of the commanded entity in the vertical direction and in the middle of all the commanded entities in the horizontal direction. Multiple connected subgraphs are displayed in parallel horizontal layout.

进一步的,包括如下步骤:Further, the following steps are included:

S1、采用有向图数据结构G(V,E)表示具有层级指挥关系的团体实体指挥关系,其中节点集合V表示具有层级指挥关系的团体实体,边集合E表示指挥关系;S1. A directed graph data structure G(V,E) is used to represent the command relationship of group entities with a hierarchical command relationship, where the node set V represents the group entity with a hierarchical command relationship, and the edge set E represents the command relationship;

S2、对绘图区域进行网格化,网格原点位于左上角,坐标为(0,0);S2. Grid the drawing area, with the grid origin located at the upper left corner with coordinates (0, 0);

S3、采用哈希表unitPos<key,value>记录所有具有层级指挥关系的团体实体的网格坐标,其中key表示具有层级指挥关系的团体实体的唯一标识, value为网格坐标;S3, using a hash table unitPos<key, value> to record the grid coordinates of all group entities with a hierarchical command relationship, where key represents the unique identifier of the group entity with a hierarchical command relationship, and value is the grid coordinate;

S4、在unitPos中初始化所有具有层级指挥关系的团体实体的网格坐标为(-1,-1);S4. Initialize the grid coordinates of all group entities with hierarchical command relationships in unitPos to (-1,-1);

S5、根据有向图数据结构G计算具有层级指挥关系的团体实体树状层次结构布局的网格坐标unitPos;S5, calculating the grid coordinate unitPos of the tree-like hierarchical structure layout of the group entity with a hierarchical command relationship according to the directed graph data structure G;

S6、根据具有层级指挥关系的团体实体的网格坐标unitPos在绘图区域对应坐标处可视化绘制具有层级指挥关系的团体实体及其之间的指挥关系。S6. Visually draw the group entities with the hierarchical command relationship and the command relationship between them at the corresponding coordinates in the drawing area according to the grid coordinates unitPos of the group entities with the hierarchical command relationship.

进一步的,所述指挥关系为有向箭头。Furthermore, the command relationship is a directed arrow.

进一步的,所述步骤S5中,具有层级指挥关系的团体实体树状层次结构布局的网格坐标的计算方法,具体为:Furthermore, in step S5, the method for calculating the grid coordinates of the tree-like hierarchical structure layout of the group entities with a hierarchical command relationship is specifically as follows:

S51、令startx为起始水平网格坐标,starty为起始垂直网格坐标;S51, let startx be the starting horizontal grid coordinate, and starty be the starting vertical grid coordinate;

S52、从指挥关系图G中获取最高指挥实体节点集合C,所述最高指挥实体节点是指图G中没有入射边的节点;S52, obtaining a highest command entity node set C from the command relationship graph G, wherein the highest command entity node refers to a node without incident edges in the graph G;

S53、若已遍历完集合C中的所有节点则计算过程结束,反之转到S54;S53, if all nodes in the set C have been traversed, the calculation process ends, otherwise go to S54;

S54、获取C中下一个最高指挥实体节点r;S54, obtaining the next highest command entity node r in C;

S55、以startx为起始水平网格坐标,starty为起始垂直网格坐标作为参数,计算以r为根节点的生成子树中所有节点实体的网格坐标,输出最大水平网格坐标maxx和最大垂直网格坐标maxy,所述的生成子树是指以r为根节点,由节点r及其所有连通节点构成的指挥关系图G的生成子树;S55, using startx as the starting horizontal grid coordinate and starty as the starting vertical grid coordinate as parameters, calculating the grid coordinates of all node entities in the spanning subtree with r as the root node, and outputting the maximum horizontal grid coordinate maxx and the maximum vertical grid coordinate maxy, wherein the spanning subtree refers to the spanning subtree of the command relationship graph G with r as the root node and consisting of the node r and all its connected nodes;

S56、令startx=maxx+2,转到S53。S56. Let startx=maxx+2, and go to S53.

进一步的,所述步骤S55中,生成子树中节点实体的网格坐标的计算方法包括:Furthermore, in step S55, the calculation method for generating the grid coordinates of the node entity in the subtree includes:

计算生成子树中所有节点实体的垂直网格坐标;Calculate the vertical grid coordinates of all node entities in the generated subtree;

计算生成子树中所有节点实体的水平网格坐标。Calculates the horizontal grid coordinates of all node entities in the generated subtree.

进一步的,计算生成子树中所有节点实体的垂直网格坐标的方法具体包括:Furthermore, the method for calculating the vertical grid coordinates of all node entities in the generated subtree specifically includes:

对生成子树进行先根遍历,递归计算所有节点实体的垂直网格坐标;Perform a pre-root traversal on the spanning subtree and recursively calculate the vertical grid coordinates of all node entities;

若实体e1指挥实体e2,则有unitPos[e2].y=unitPos[e1].y+2,其中unitPos[e1].y和unitPos[e2].y分别为实体e1和e2的垂直网格坐标。If entity e1 commands entity e2 , then unitPos[ e2 ].y=unitPos[ e1 ].y+2, where unitPos[ e1 ].y and unitPos[ e2 ].y are the vertical grid coordinates of entities e1 and e2 respectively.

进一步的,计算生成子树中所有节点实体的水平网格坐标的方法具体包括:Furthermore, the method for calculating the horizontal grid coordinates of all node entities in the generated subtree specifically includes:

对生成子树进行后根遍历,递归计算所有节点实体的水平网格坐标;Perform post-root traversal on the generated subtree and recursively calculate the horizontal grid coordinates of all node entities;

假设实体集合ei+1,ei+2,…ei+n为实体e的被指挥实体集合,则有:Assuming that the entity set e i+1 ,e i+2 ,…e i+n is the set of directed entities of entity e, we have:

unitPos[ei+2].x=unitPos[ei+1].x+2;unitPos[e i+2 ].x=unitPos[e i+1 ].x+2;

当n为奇数时有unitPos[e].x=unitPos[ei+n/2].x,当n为偶数时有 unitPos[e].x=(unitPos[ei-1+n/2].x+unitPos[ei+n/2].x)/2,即指挥实体位于被指挥实体水平方向中间位置;其中,unitPos[e].x为实体e的水平网格坐标。When n is an odd number, unitPos[e].x = unitPos[e i+n/2 ].x; when n is an even number, unitPos[e].x = (unitPos[e i-1+n/2 ].x + unitPos[e i+n/2 ].x)/2, that is, the commanding entity is located in the middle of the commanded entity in the horizontal direction; where unitPos[e].x is the horizontal grid coordinate of entity e.

相对于现有技术,本发明所述的指挥关系层次结构动态可视化自动布局方法具有以下优势:Compared with the prior art, the command relationship hierarchy dynamic visualization automatic layout method of the present invention has the following advantages:

本发明所述的指挥关系层次结构动态可视化自动布局方法可实现具有层级指挥关系的团体实体指挥关系,在添加实体,删除实体,添加指挥关系和删除指挥关系动态变化过程中始终维持指挥关系树状层次结构的可视化自动布局,其为具有层级指挥关系的团体信息化指挥系统中指挥关系可视化建模的关键技术。The method for dynamic visualization and automatic layout of the command relationship hierarchy described in the present invention can realize the command relationship of group entities with hierarchical command relationships, and always maintain the visualization and automatic layout of the command relationship tree hierarchy during the dynamic changes of adding entities, deleting entities, adding command relationships and deleting command relationships. It is a key technology for visual modeling of command relationships in a group information-based command system with hierarchical command relationships.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

构成本发明的一部分的附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

图1为本发明总体工作流程;Fig. 1 is the overall workflow of the present invention;

图2为实体网格坐标计算流程图;Fig. 2 is a flow chart of the calculation of the coordinates of the solid grid;

图3为垂直网格坐标递归计算流程图;FIG3 is a flow chart of recursive calculation of vertical grid coordinates;

图4为水平网格坐标递归计算流程图;FIG4 is a flow chart of horizontal grid coordinate recursive calculation;

图5为实体网格坐标计算方法示意图;FIG5 is a schematic diagram of a method for calculating coordinates of a solid grid;

图6为生成子树节点实体网格坐标计算方法示意图;FIG6 is a schematic diagram of a method for calculating coordinates of a generated subtree node entity grid;

图7为军队实体指挥关系树状层次结构自动布局效果示意图。FIG. 7 is a schematic diagram of the automatic layout effect of the tree-like hierarchical structure of the military entity command relationship.

具体实施方式DETAILED DESCRIPTION

需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

下面将参考附图并结合实施例来详细说明本发明。The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

本发明提供了一种指挥关系层次结构动态可视化自动布局方法,适用于具有层级指挥关系的团体,例如,军队、学校、公司等,下面以军队团体作为本申请的其中一个实施例,对本申请的技术方案作进一步解释说明。The present invention provides a method for dynamic visualization and automatic layout of a command relationship hierarchy, which is suitable for groups with hierarchical command relationships, such as the military, schools, companies, etc. The military group is taken as one of the embodiments of the present application to further explain the technical solution of the present application.

技术方案为(如图1、图5所示):The technical solution is (as shown in Figure 1 and Figure 5):

S1、采用有向图数据结构G(V,E)表示军队实体指挥关系,其中节点集合V表示军队实体,边集合E表示指挥关系。所述指挥关系为有向箭头,从指挥实体指向被指挥实体;S1. Use a directed graph data structure G(V,E) to represent the command relationship of military entities, where the node set V represents the military entities and the edge set E represents the command relationship. The command relationship is a directed arrow from the commanding entity to the commanded entity;

S2、对绘图区域进行网格化,网格原点位于左上角,坐标为(0,0);S2. Grid the drawing area, with the grid origin located at the upper left corner with coordinates (0, 0);

S3、采用哈希表unitPos<key,value>记录所有军队实体的网格坐标,其中key表示军队实体的唯一标识,value为网格坐标;S3. Use the hash table unitPos<key,value> to record the grid coordinates of all military entities, where key represents the unique identifier of the military entity and value is the grid coordinate;

S4、在unitPos中初始化所有军队实体的网格坐标为(-1,-1);S4. Initialize the grid coordinates of all military entities in unitPos to (-1,-1);

S5、根据有向图数据结构G计算军队实体树状层次结构布局的网格坐标unitPos;S5. Calculate the grid coordinates unitPos of the tree-like hierarchical structure layout of the military entity according to the directed graph data structure G;

S6、根据军队实体的网格坐标unitPos在绘图区域对应坐标处可视化绘制军队实体及其之间的指挥关系;S6. Visually draw the military entities and the command relationships between them at the corresponding coordinates in the drawing area according to the grid coordinates unitPos of the military entities;

如图2、图5所示,上述步骤S5所述的军队实体网格坐标计算方法为:As shown in FIG. 2 and FIG. 5 , the method for calculating the coordinates of the military entity grid described in step S5 is as follows:

S51、令startx为起始水平网格坐标,starty为起始垂直网格坐标;S51, let startx be the starting horizontal grid coordinate, and starty be the starting vertical grid coordinate;

S52、从指挥关系图G中获取最高指挥实体节点集合C,所述最高指挥实体节点是指图G中没有入射边的节点;S52, obtaining a highest command entity node set C from the command relationship graph G, wherein the highest command entity node refers to a node without incident edges in the graph G;

S53、若已遍历完集合C中的所有节点则计算过程结束,反之转到S54;S53, if all nodes in the set C have been traversed, the calculation process ends, otherwise go to S54;

S54、获取C中下一个最高指挥实体节点r;S54, obtaining the next highest command entity node r in C;

S55、以startx为起始水平网格坐标,starty为起始垂直网格坐标作为参数,计算以r为根节点的生成子树中所有节点的网格坐标,输出最大水平网格坐标maxx和最大垂直网格坐标maxy,所述的生成子树是指以r为根节点,由节点r及其所有连通节点构成的图G的生成子树;S55, using startx as the starting horizontal grid coordinate and starty as the starting vertical grid coordinate as parameters, calculating the grid coordinates of all nodes in the spanning subtree with r as the root node, and outputting the maximum horizontal grid coordinate maxx and the maximum vertical grid coordinate maxy, wherein the spanning subtree refers to the spanning subtree of the graph G with r as the root node and consisting of the node r and all its connected nodes;

S56、令startx=maxx+2,转到S53;S56, set startx=maxx+2, and go to S53;

如图6所示,上述步骤S55所述的生成子树节点实体网格坐标的计算方法为:As shown in FIG6 , the calculation method for generating the grid coordinates of the entity of the subtree node described in step S55 is:

计算生成子树中所有节点实体的垂直网格坐标;Calculate the vertical grid coordinates of all node entities in the generated subtree;

计算生成子树中所有节点实体的水平网格坐标;Calculate the horizontal grid coordinates of all node entities in the generated subtree;

如图6所示,上述生成子树垂直网格坐标计算方法为:As shown in FIG6 , the vertical grid coordinate calculation method of the above spanning subtree is:

对生成子树进行先根遍历,递归计算所有节点实体的垂直网格坐标;Perform a pre-root traversal on the spanning subtree and recursively calculate the vertical grid coordinates of all node entities;

若实体e1指挥实体e2,则有unitPos[e2].y=unitPos[e1].y+2,其中unitPos[e1].y和unitPos[e2].y分别为实体e1和e2的垂直网格坐标;If entity e1 commands entity e2, then unitPos[e2].y = unitPos[e1].y + 2, where unitPos[e1].y and unitPos[e2].y are the vertical grid coordinates of entities e1 and e2 respectively;

如图3所示,其方法流程为:As shown in Figure 3, the method flow is as follows:

S5511、令r为生成子树的根节点实体,starty1为垂直方向起始网格坐标;S5511, let r be the root node entity of the generated subtree, and starty1 be the starting grid coordinate in the vertical direction;

S5512、初始化生成子树的最大垂直网格坐标maxy1=0;S5512, initialize the maximum vertical grid coordinate maxy1 of the spanning subtree = 0;

S5513、r的网格坐标unitPos[r]若为(-1,-1)则转到S5514,否则转到S55112;S5513, if the grid coordinate unitPos[r] of r is (-1, -1), go to S5514, otherwise go to S55112;

S5514、从图G中获取r的上一级指挥实体集合P,被指挥实体集合Q;S5514. Obtain the previous level command entity set P and the commanded entity set Q of r from the graph G;

S5515、P若为空则转到S5516,否则转到S5518;S5515, if P is empty, go to S5516, otherwise go to S5518;

S5516、令r的网格坐标的y坐标为starty1,即unitPos[r].y=starty1;S5516, let the y coordinate of the grid coordinate of r be starty1, that is, unitPos[r].y=starty1;

S5517、若已完成对集合Q的遍历则转到S55118,否则转到S55114;S5517, if the traversal of the set Q has been completed, go to S55118, otherwise go to S55114;

S5518、若已完成对集合P的遍历则转到S5517,否则转到S5519;S5518, if the traversal of the set P has been completed, go to S5517, otherwise go to S5519;

S5519、取P中的下一个实体节点m;S5519, get the next entity node m in P;

S55110、若实体m网格坐标的y坐标是否大于实体r的y坐标,即 unitPos[m].y>unitPos[r].y则转到S55111,否则转到S5518;S55110. If the y coordinate of the grid coordinate of entity m is greater than the y coordinate of entity r, that is, unitPos[m].y>unitPos[r].y, then go to S55111, otherwise go to S5518;

S55111、unitPos[r].y=unitPos[m].y+2,转到S5518;S55111, unitPos[r].y=unitPos[m].y+2, go to S5518;

S55112、若starty1大于实体r网格坐标的y坐标,即starty1>unitPos[r].y则转到S55113,否则转到S5517;S55112, if starty1 is greater than the y coordinate of the entity r grid coordinate, that is, starty1>unitPos[r].y, go to S55113, otherwise go to S5517;

S55113、unitPos[r].y=starty1,转到S5517;S55113, unitPos[r].y=starty1, go to S5517;

S55114、取Q中的下一个实体节点a;S55114. Get the next entity node a in Q;

S55115、递归计算:以unitPos[r].y为起始垂直网格坐标,计算以a 为根节点的生成子树中所有节点的垂直网格坐标,输出最大垂直网格坐标 maxy2;S55115, recursive calculation: take unitPos[r].y as the starting vertical grid coordinate, calculate the vertical grid coordinates of all nodes in the spanning subtree with a as the root node, and output the maximum vertical grid coordinate maxy2;

S55116、若maxy1<maxy2则转到S55117,否则转到S5517;S55116, if maxy1<maxy2, go to S55117, otherwise go to S5517;

S55117、maxy1=maxy2,转到S5517;S55117, maxy1=maxy2, go to S5517;

S55118、输出maxy1。S55118, output maxy1.

如图6所示,上述生成子树水平网格坐标计算方法为:As shown in FIG6 , the calculation method of the horizontal grid coordinates of the above spanning subtree is:

假设实体集合(从左到右布局)ei+1,ei+2,…ei+n为实体e的被指挥实体集合,则有:Assuming that the entity set (layout from left to right) ei+1 , ei+2 , ... ei+n is the directed entity set of entity e, then:

unitPos[ei+2].x=unitPos[ei+1].x+2;unitPos[e i+2 ].x=unitPos[e i+1 ].x+2;

当n为奇数时有unitPos[e].x=unitPos[ei+n/2].x,当n为偶数时有 unitPos[e].x=(unitPos[ei-1+n/2].x+unitPos[ei+n/2].x)/2,即指挥实体位于被指挥实体水平方向中间位置;When n is an odd number, unitPos[e].x = unitPos[e i+n/2 ].x; when n is an even number, unitPos[e].x = (unitPos[e i-1+n/2 ].x + unitPos[e i+n/2 ].x)/2, that is, the commanding entity is located in the middle of the commanded entity in the horizontal direction;

其中,unitPos[e].x为实体e的水平网格坐标;Where unitPos[e].x is the horizontal grid coordinate of entity e;

如图4所示,其方法流程为:As shown in Figure 4, the method flow is as follows:

S5521、令r为生成子树的根节点实体,startx1为水平方向起始网格坐标;S5521, let r be the root node entity of the generated subtree, and startx1 be the starting grid coordinate in the horizontal direction;

S5522、初始化生成子树的最大水平网格坐标maxx1=0;S5522, initialize the maximum horizontal grid coordinate maxx1 of the spanning subtree = 0;

S5523、从图G中获取r被指挥实体集合Q;S5523. Obtain r directed entity set Q from graph G;

S5524、若Q为空则转到S5525,否则转到S5526;S5524, if Q is empty, go to S5525, otherwise go to S5526;

S5525、令r的网格坐标的x坐标为startx1,即unitPos[r].x=maxx1 =startx1;S5525, let the x coordinate of the grid coordinate of r be startx1, that is, unitPos[r].x=maxx1=startx1;

S5526、若已完成对集合Q的遍历则转到S55212,否则转到S5527;S5526. If the traversal of the set Q has been completed, go to S55212; otherwise, go to S5527;

S5527、取Q中的下一个实体节点a;S5527, get the next entity node a in Q;

S5528、递归计算:以startx1为起始水平网格坐标,计算以a为根节点的生成子树中所有节点的水平网格坐标,输出最大水平网格坐标maxx2;S5528, recursive calculation: take startx1 as the starting horizontal grid coordinate, calculate the horizontal grid coordinates of all nodes in the spanning subtree with a as the root node, and output the maximum horizontal grid coordinate maxx2;

S5529、startx1=maxx2+2;S5529, startx1 = maxx2 + 2;

S55210、若maxx1<maxx2则转到S55211,否则转到S5526;S55210, if maxx1<maxx2, go to S55211, otherwise go to S5526;

S55211、maxx1=maxx2,转到S5526;S55211, maxx1=maxx2, go to S5526;

S55212、若Q中元素的个数为奇数则转到S55213,否则转到S55214;S55212, if the number of elements in Q is odd, go to S55213, otherwise go to S55214;

S55213、令r的水平网格坐标为Q中中间元素的水平网格坐标,流程结束;S55213, let the horizontal grid coordinates of r be the horizontal grid coordinates of the middle element in Q, and the process ends;

S55214、令r的水平网格坐标为Q中中间两个元素的水平网格坐标的平均值,流程结束S55214. Let the horizontal grid coordinate of r be the average of the horizontal grid coordinates of the two middle elements in Q. The process ends.

本发明的一种指挥关系层次结构动态可视化自动布局方法,当图G发生变更时(包括添加实体、删除实体、添加指挥关系和删除指挥关系),采用上述方法重新计算军队实体的网格坐标unitPos;The present invention provides a method for automatically laying out a command relationship hierarchy structure dynamically visualized. When a graph G is changed (including adding entities, deleting entities, adding command relationships, and deleting command relationships), the above method is used to recalculate the grid coordinates unitPos of the military entity;

根据最新的网格坐标unitPos在绘图区域对应坐标处可视化绘制军队实体及其之间的指挥关系,达到如图7所示的效果。According to the latest grid coordinate unitPos, the military entities and the command relationships between them are visually drawn at the corresponding coordinates in the drawing area to achieve the effect shown in Figure 7.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及方法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

在本申请所提供的几个实施例中,应该理解到,所揭露的方法和系统,可以通过其它的方式实现。例如,以上所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。上述单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例方案的目的。In the several embodiments provided in the present application, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the division of the units described above is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The above-mentioned units may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围,其均应涵盖在本发明的权利要求和说明书的范围当中。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (4)

1.一种指挥关系层次结构动态可视化自动布局方法,其特征在于:1. A method for dynamic visualization and automatic layout of command relationship hierarchical structure, characterized by: 在具有层级指挥关系的团体实体之间指挥关系动态变更时保持指挥关系树状层次结构可视化自动布局;所述指挥关系动态变更包括但不限于添加实体、删除实体、添加指挥关系和删除指挥关系;所述指挥关系为具有指向性的标识,从指挥实体指向被指挥实体;When the command relationship between group entities with hierarchical command relationships changes dynamically, the command relationship tree-like hierarchical structure is maintained for visual automatic layout; the command relationship dynamic change includes but is not limited to adding entities, deleting entities, adding command relationships, and deleting command relationships; the command relationship is a directional identifier, from the commanding entity to the commanded entity; 所述树状层次结构可视化自动布局用于对指挥关系图中的每一个连通子图采用树形层次结构进行可视化布局显示;The tree-like hierarchical structure visualization automatic layout is used to visualize the layout of each connected subgraph in the command relationship graph using a tree-like hierarchical structure; 指挥实体布局时垂直方向上位于被指挥实体的上一个层次,水平方向上位于所有被指挥实体的中间,多个连通子图水平并列布局显示;When the commanding entity is laid out, it is located at the upper level of the commanded entity in the vertical direction and in the middle of all the commanded entities in the horizontal direction. Multiple connected subgraphs are laid out and displayed in parallel horizontally. 包括如下步骤:The steps include: S1、采用有向图数据结构G(V,E)表示具有层级指挥关系的团体实体指挥关系,其中节点集合V表示具有层级指挥关系的团体实体,边集合E表示指挥关系;S1. A directed graph data structure G(V,E) is used to represent the command relationship of group entities with a hierarchical command relationship, where the node set V represents the group entity with a hierarchical command relationship, and the edge set E represents the command relationship; S2、对绘图区域进行网格化,网格原点位于左上角,坐标为(0,0);S2. Grid the drawing area, with the grid origin located at the upper left corner with coordinates (0, 0); S3、采用哈希表unitPos<key,value>记录所有具有层级指挥关系的团体实体的网格坐标,其中key表示具有层级指挥关系的团体实体的唯一标识,value为网格坐标;S3, using a hash table unitPos<key, value> to record the grid coordinates of all group entities with a hierarchical command relationship, where key represents the unique identifier of the group entity with a hierarchical command relationship, and value is the grid coordinate; S4、在unitPos中初始化所有具有层级指挥关系的团体实体的网格坐标为(-1,-1);S4. Initialize the grid coordinates of all group entities with hierarchical command relationships in unitPos to (-1,-1); S5、根据有向图数据结构G计算具有层级指挥关系的团体实体树状层次结构布局的网格坐标unitPos;S5, calculating the grid coordinate unitPos of the tree-like hierarchical structure layout of the group entity with a hierarchical command relationship according to the directed graph data structure G; S6、根据具有层级指挥关系的团体实体的网格坐标unitPos在绘图区域对应坐标处可视化绘制具有层级指挥关系的团体实体及其之间的指挥关系;S6. Visually draw the group entities with the hierarchical command relationship and the command relationship between them at the corresponding coordinates in the drawing area according to the grid coordinates unitPos of the group entities with the hierarchical command relationship; 所述步骤S5中,具有层级指挥关系的团体实体树状层次结构布局的网格坐标的计算方法,具体为:In step S5, the method for calculating the grid coordinates of the tree-like hierarchical structure layout of the group entities with a hierarchical command relationship is specifically as follows: S51、令startx为起始水平网格坐标,starty为起始垂直网格坐标;S51, let startx be the starting horizontal grid coordinate, and starty be the starting vertical grid coordinate; S52、从指挥关系图G中获取最高指挥实体节点集合C,所述最高指挥实体节点是指图G中没有入射边的节点;S52, obtaining a highest command entity node set C from the command relationship graph G, wherein the highest command entity node refers to a node without incident edges in the graph G; S53、若已遍历完集合C中的所有节点则计算过程结束,反之转到S54;S53, if all nodes in the set C have been traversed, the calculation process ends, otherwise go to S54; S54、获取C中下一个最高指挥实体节点r;S54, obtaining the next highest command entity node r in C; S55、以startx为起始水平网格坐标,starty为起始垂直网格坐标作为参数,计算以r为根节点的生成子树中所有节点实体的网格坐标,输出最大水平网格坐标maxx和最大垂直网格坐标maxy,所述的生成子树是指以r为根节点,由节点r及其所有连通节点构成的指挥关系图G的生成子树;S55, using startx as the starting horizontal grid coordinate and starty as the starting vertical grid coordinate as parameters, calculating the grid coordinates of all node entities in the spanning subtree with r as the root node, and outputting the maximum horizontal grid coordinate maxx and the maximum vertical grid coordinate maxy, wherein the spanning subtree refers to the spanning subtree of the command relationship graph G with r as the root node and consisting of the node r and all its connected nodes; S56、令startx=maxx+2,转到S53;S56, set startx=maxx+2, and go to S53; 所述步骤S55中,生成子树中节点实体的网格坐标的计算方法包括:In step S55, the calculation method for generating the grid coordinates of the node entity in the subtree includes: 计算生成子树中所有节点实体的垂直网格坐标;Calculate the vertical grid coordinates of all node entities in the generated subtree; 计算生成子树中所有节点实体的水平网格坐标。Calculates the horizontal grid coordinates of all node entities in the generated subtree. 2.根据权利要求1所述的指挥关系层次结构动态可视化自动布局方法,其特征在于:所述指挥关系为有向箭头。2. The command relationship hierarchical structure dynamic visualization automatic layout method according to claim 1 is characterized in that: the command relationship is a directed arrow. 3.根据权利要求1所述的指挥关系层次结构动态可视化自动布局方法,其特征在于,计算生成子树中所有节点实体的垂直网格坐标的方法具体包括:3. The method for dynamic visualization and automatic layout of command relationship hierarchy structure according to claim 1 is characterized in that the method for calculating the vertical grid coordinates of all node entities in the generated subtree specifically comprises: 对生成子树进行先根遍历,递归计算所有节点实体的垂直网格坐标;Perform a pre-root traversal on the spanning subtree and recursively calculate the vertical grid coordinates of all node entities; 若实体e1指挥实体e2,则有unitPos[e2].y=unitPos[e1].y+2,其中unitPos[e1].y和unitPos[e2].y分别为实体e1和e2的垂直网格坐标。If entity e1 commands entity e2 , then unitPos[e2 ] .y=unitPos[ e1 ].y+2, where unitPos[ e1 ].y and unitPos[ e2 ].y are the vertical grid coordinates of entities e1 and e2 respectively. 4.根据权利要求1所述的指挥关系层次结构动态可视化自动布局方法,其特征在于,计算生成子树中所有节点实体的水平网格坐标的方法具体包括:4. The method for dynamic visualization and automatic layout of command relationship hierarchy structure according to claim 1 is characterized in that the method for calculating the horizontal grid coordinates of all node entities in the generated subtree specifically comprises: 对生成子树进行后根遍历,递归计算所有节点实体的水平网格坐标;Perform post-root traversal on the generated subtree and recursively calculate the horizontal grid coordinates of all node entities; 假设实体集合ei+1,ei+2,…ei+n为实体e的被指挥实体集合,则有:Assuming that the entity set e i+1 ,e i+2 ,…e i+n is the set of directed entities of entity e, we have: unitPos[ei+2].x=unitPos[ei+1].x+2;unitPos[e i+2 ].x=unitPos[e i+1 ].x+2; 当n为奇数时有unitPos[e].x=unitPos[ei+n/2].x,当n为偶数时有unitPos[e].x=(unitPos[ei-1+n/2].x+unitPos[ei+n/2].x)/2,即指挥实体位于被指挥实体水平方向中间位置;其中,unitPos[e].x为实体e的水平网格坐标。When n is an odd number, unitPos[e].x = unitPos[e i+n/2 ].x; when n is an even number, unitPos[e].x = (unitPos[e i-1+n/2 ].x + unitPos[e i+n/2 ].x)/2, that is, the commanding entity is located in the middle of the commanded entity in the horizontal direction; where unitPos[e].x is the horizontal grid coordinate of entity e.
CN202011322788.XA 2020-11-23 2020-11-23 A method for dynamic visualization and automatic layout of command relationship hierarchy Active CN112668143B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011322788.XA CN112668143B (en) 2020-11-23 2020-11-23 A method for dynamic visualization and automatic layout of command relationship hierarchy

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011322788.XA CN112668143B (en) 2020-11-23 2020-11-23 A method for dynamic visualization and automatic layout of command relationship hierarchy

Publications (2)

Publication Number Publication Date
CN112668143A CN112668143A (en) 2021-04-16
CN112668143B true CN112668143B (en) 2024-08-09

Family

ID=75402908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011322788.XA Active CN112668143B (en) 2020-11-23 2020-11-23 A method for dynamic visualization and automatic layout of command relationship hierarchy

Country Status (1)

Country Link
CN (1) CN112668143B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120180657A (en) * 2024-12-04 2025-06-20 中国人民解放军国防大学联合作战学院 Large-scale data real-time display system, method and server for war game simulation

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484754B (en) * 2016-07-28 2019-08-23 西安交通大学 Knowledge Forest Layout Method Based on Hierarchical Data and Graph Data Visualization Technology
CN108802777B (en) * 2018-06-12 2020-12-11 北京机械设备研究所 Vehicle-mounted command control method based on Beidou
CN111814281B (en) * 2020-06-22 2024-01-26 积成电子股份有限公司 An automatic drawing method of platform topology diagram based on multi-tree hierarchical layout

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
节点攻击策略下的军事通信网络结构优化算法;杨芷柔 等;系统工程与电子技术;20210731;第43卷(第7期);1-8 *

Also Published As

Publication number Publication date
CN112668143A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN106599493B (en) Visualization implementation method of BIM (building information modeling) model in three-dimensional large scene
CN105117835B (en) A kind of electric network information computer room three-dimensional visualization management platform based on B/S frameworks
CN110111410A (en) A kind of two three-dimensional pipe network data organizations and display methods based on spatial database
CN105243237B (en) A kind of construction method of assembly technology structure tree
CN114419256B (en) Urban level BIM data light weight method and system based on multistage shell extraction algorithm
CN106372293A (en) Three-dimensional reference line-based BIM creation method for building
CN104915245B (en) Realize analogue system and the integrated system and method for the operation of actual functional capability systematic unity
CN104679954A (en) Method and system for lightening BIM (Building Information Modeling) model
CN110866342A (en) Cabinet modeling method and system and electronic equipment
Wang et al. Fast Mesh Simplification Method for Three‐Dimensional Geometric Models with Feature‐Preserving Efficiency
CN114170385B (en) Method, device, medium and device for real-time generation of mesh with holes in model section
CN112668143B (en) A method for dynamic visualization and automatic layout of command relationship hierarchy
CN118036224A (en) Automatic mapping method and system for distribution network single line diagram sketch based on visual model
CN106251397B (en) Frame choosing method and system based on BIM model
CN104461496B (en) It is a kind of with or figure stratification display methods
Lipp et al. Local editing of procedural models
Zhang et al. Synthetic modeling method for large scale terrain based on hydrology
CN107480364B (en) BIM model dynamic organization method for engineering construction information management
US20250315480A1 (en) Directed graph layout method and apparatus for process editing
CN111815746B (en) Method for generating hair data based on USD system
CN118036165B (en) Automatic generation method, device and storage medium for skirt house form of high-rise building
CN113378279A (en) Building modeling method, building modeling system, electronic equipment and storage medium
Camozzato A method for growth-based procedural floor plan generation
CN109190255B (en) Three-dimensional reconstruction method for urban three-dimensional property space
CN108921950B (en) Three-dimensional fracture simulation method and related device

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