[go: up one dir, main page]

CN103124279B - The output intent of resource information and system - Google Patents

The output intent of resource information and system Download PDF

Info

Publication number
CN103124279B
CN103124279B CN201110369713.1A CN201110369713A CN103124279B CN 103124279 B CN103124279 B CN 103124279B CN 201110369713 A CN201110369713 A CN 201110369713A CN 103124279 B CN103124279 B CN 103124279B
Authority
CN
China
Prior art keywords
node
layer
resource
gravity
center
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
CN201110369713.1A
Other languages
Chinese (zh)
Other versions
CN103124279A (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.)
Weifang Cloud Computing Center Inspur Construction Management Co ltd
Original Assignee
Inspur Beijing Electronic Information Industry Co Ltd
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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201110369713.1A priority Critical patent/CN103124279B/en
Publication of CN103124279A publication Critical patent/CN103124279A/en
Application granted granted Critical
Publication of CN103124279B publication Critical patent/CN103124279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a kind of output intent and system of resource information.Described method, comprising: obtain the dependence of other resource nodes in resource in each resource node and system; For described each resource node is distributed in the position of resource hierarchy, the Resource Dependence being wherein positioned at the resource node of the i-th+1 level is positioned at the resource that level is the resource node being less than or equal to i-th, and wherein i=1,2......, N, N are positive integer; If the gap between the level residing for two resource nodes of Existence dependency relationship is 1, connects two resource nodes in each dependence, obtain the directed graph of dependence; Initiate the flow process of the directed graph exporting described dependence.

Description

资源信息的输出方法和系统Method and system for outputting resource information

技术领域 technical field

本发明涉及信息处理领域,尤其涉及一种资源信息的输出方法和系统The present invention relates to the field of information processing, in particular to a resource information output method and system

背景技术 Background technique

在高可用集群管理领域,资源是集群管理的最小单位,也是重要单元。集群的所有操作最终都会体现在资源上,而资源状态也能够最直接地反应集群的运行状态。同时,资源间的关系也是复杂的,同一个资源可能依赖于其他资源,也可能被其他资源依赖。在认识集群资源时,弄清资源间的依赖关系是至关重要的一环。In the field of high-availability cluster management, resources are the smallest and important unit of cluster management. All operations of the cluster will eventually be reflected on resources, and the status of resources can also most directly reflect the running status of the cluster. At the same time, the relationship between resources is also complex. The same resource may depend on other resources, or be depended on by other resources. When understanding cluster resources, it is crucial to clarify the dependencies between resources.

传统的资源信息表示方式是表格形式列出资源信息。这种方式虽然对资源的展示比较全面,但资源间的关系不够直观,用户往往不能直接看出各个资源间的依赖和被依赖关系,从而对集群的整体情况的认知不够全面。The traditional representation of resource information is to list resource information in tabular form. Although this method displays resources more comprehensively, the relationship between resources is not intuitive enough. Users often cannot directly see the dependencies and dependent relationships between resources, and thus have an insufficient understanding of the overall situation of the cluster.

发明内容 Contents of the invention

本发明提供一种资源信息的输出方法和系统,要解决的技术问题是如何处理节点间资源的信息使得资源间依赖关系更直观。The present invention provides a resource information output method and system, and the technical problem to be solved is how to process resource information between nodes to make the dependency between resources more intuitive.

为解决上述技术问题,本发明提供了如下技术方案:In order to solve the problems of the technologies described above, the present invention provides the following technical solutions:

(此处待权利要求核定后补)(here to be supplemented after the approval of the claims)

与现有技术相比,通过以有向图的方式输出节点间资源的依赖关系,简单且直观。Compared with the prior art, it is simple and intuitive by outputting the dependency relationship of resources between nodes in the form of a directed graph.

附图说明Description of drawings

图1为本发明提供的资源信息的输出方法实施例的流程示意图;FIG. 1 is a schematic flowchart of an embodiment of a method for outputting resource information provided by the present invention;

图2为本发明实施例提供的依赖关系的有向图的示意图;FIG. 2 is a schematic diagram of a directed graph of dependencies provided by an embodiment of the present invention;

图3为对图2所示有向图进行重心重排后得到的有向图的示意图;Fig. 3 is a schematic diagram of the directed graph obtained after rearranging the center of gravity of the directed graph shown in Fig. 2;

图4为本发明提供的资源信息的输出系统实施例的结构示意图。Fig. 4 is a schematic structural diagram of an embodiment of a system for outputting resource information provided by the present invention.

具体实施方式 detailed description

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图及具体实施例对本发明作进一步的详细描述。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined arbitrarily with each other.

图1为本发明提供的资源信息的输出方法实施例的流程示意图。图1所示方法实施例,包括:FIG. 1 is a schematic flowchart of an embodiment of a method for outputting resource information provided by the present invention. The method embodiment shown in Figure 1 includes:

步骤101、获取每个资源节点与系统中其他资源节点在资源上的依赖关系;Step 101. Obtain resource dependency between each resource node and other resource nodes in the system;

其中该依赖关系可以由用户输入方式来获取。Wherein, the dependency relationship can be obtained by user input.

步骤102、为所述每个资源节点分配在资源层次的位置,其中位于第i+1个层次的资源节点的资源依赖位于层次为小于或等于第i个的资源节点的资源,其中,i=1,2......,N,N为正整数;Step 102. Allocate a position at the resource level for each resource node, wherein the resources of the resource nodes at the i+1th level depend on the resources of the resource nodes at the level less than or equal to the i-th level, where i= 1, 2..., N, N is a positive integer;

具体来说,如果资源节点1的资源依赖资源节点2的资源,则可以称资源节点1为依赖资源节点,资源节点2为被依赖资源节点,上述生成资源层次的原则就是依赖资源节点的层次要低于被依赖的资源节点的层次。当然,某一个依赖关系中的被依赖资源节点也有可能是另一个依赖关系中的依赖资源节点,同理,某一个依赖关系中的依赖资源节点也有可能是另一个依赖关系中的被依赖资源节点,但是,不会出现相互依赖的情况。Specifically, if the resources of resource node 1 depend on the resources of resource node 2, resource node 1 can be called a dependent resource node, and resource node 2 is a dependent resource node. The level below the dependent resource node. Of course, a dependent resource node in a dependency relationship may also be a dependent resource node in another dependency relationship. Similarly, a dependent resource node in a dependency relationship may also be a dependent resource node in another dependency relationship , however, no interdependence occurs.

举例来说,资源节点与其他资源节点的关系决定该资源节点在图形中的层次位置,遵循的原则为,资源节点所在层至少为所有依赖于它的资源的下一层。For example, the relationship between a resource node and other resource nodes determines the hierarchical position of the resource node in the graph. The principle to be followed is that the layer where the resource node is located is at least the next layer of all resources that depend on it.

步骤103、获取存在依赖关系的两资源节点所处的层次之间的差距为1的一组资源节点;Step 103. Obtain a group of resource nodes whose levels of two resource nodes with dependencies are 1;

如果存在依赖关系的两资源节点所处的层次之间的差距不为1,则在两个资源所在层之间的各层上均增加一虚拟节点,使两资源节点通过该虚拟节点相连。If the gap between the layers of two resource nodes that have a dependency relationship is not 1, a virtual node is added on each layer between the layers where the two resources are located, so that the two resource nodes are connected through the virtual node.

举例来说,如果资源节点A和B存在依赖关系,如果资源节点A在第1层,资源节点B在第4层,则两资源节点所在层之间的层次为第2层和第3层,则可以在第第2层和第3层均增加一虚拟节点,资源节点A和资源节点B之间通过增加的虚拟节点相连,从而在体现了资源节点A和B之间的依赖关系的前提下,又保证了存在依赖关系的两资源节点所处的层次之间的差距为1。For example, if there is a dependency relationship between resource nodes A and B, if resource node A is on layer 1 and resource node B is on layer 4, the layers between the two resource nodes are layer 2 and layer 3, Then a virtual node can be added on both the second layer and the third layer, and resource node A and resource node B are connected through the added virtual node, so that under the premise of reflecting the dependency between resource nodes A and B , which also ensures that the gap between the levels of two resource nodes with dependencies is 1.

实际上,虚拟节点将一个关系分成两段,它将在跨层关系的中间层次中起到承上启下的作用。虚拟节点可以认为是一个虚拟的资源节点,它作为图形的一部分,连接存在跨层关系的资源节点。当然,如果存在两个关系资源间的层次差大于2,可以递归插入虚拟节点,直到不存在跨层关系。这个过程叫做图形的层次化过程,经过这一步,可以得到一个层次化的有向图。In fact, a virtual node divides a relationship into two parts, and it will play a connecting role in the middle level of the cross-level relationship. A virtual node can be considered as a virtual resource node. As a part of the graph, it connects resource nodes with cross-layer relationships. Of course, if there is a level difference between two relationship resources greater than 2, virtual nodes can be recursively inserted until there is no cross-level relationship. This process is called the hierarchical process of the graph. After this step, a hierarchical directed graph can be obtained.

步骤104、以同一依赖关系中层次差距为1为基准,连接依赖关系中两资源节点,得到依赖关系的有向图;Step 104: Based on the level gap of 1 in the same dependency relationship, connect the two resource nodes in the dependency relationship to obtain a directed graph of the dependency relationship;

步骤105、输出所述依赖关系的有向图。Step 105, outputting the directed graph of the dependency relationship.

仍以上例进行说明,层次1的资源节点A连接与该依赖关系对应的位于层次2的虚拟节点,而该位于层次2的虚拟节点连接与该依赖关系对应的位于层次3的虚拟节点,同时该位于层次3的虚拟节点又与层次4的资源节点B相连。To illustrate with the above example, the resource node A at level 1 is connected to the virtual node at level 2 corresponding to the dependency relationship, and the virtual node at level 2 is connected to the virtual node at level 3 corresponding to the dependency relationship. A virtual node at level 3 is connected to resource node B at level 4.

需要说明的是,在本实施例中,用图标表示资源节点和虚拟节点,直线表示关系。经过图形的层次化过程,可以确定图形中不再存在跨层的直线,那么,下一个问题就是如何减少图形中由于层次间直线方向不同造成的直线交叉点的个数。由于节点间的关系固定,所以每层中节点的位置决定了可视化表示时图形中交叉点的个数,以减少交叉点个数为目标,对层次中的节点位置进行排序。本实施例采用基于重心排序的布局算法,确保最终展示的图形交叉点个数是最少的。It should be noted that, in this embodiment, icons represent resource nodes and virtual nodes, and straight lines represent relationships. After the layering process of the graph, it can be determined that there are no cross-layer straight lines in the graph. Then, the next problem is how to reduce the number of straight line intersections in the graph caused by the different directions of the straight lines between layers. Since the relationship between nodes is fixed, the position of nodes in each layer determines the number of intersections in the graph when visually represented. To reduce the number of intersections as the goal, the positions of nodes in the hierarchy are sorted. This embodiment adopts a layout algorithm based on center-of-gravity sorting to ensure that the number of finally displayed graphic intersections is the least.

首先需要明确的是,图形中资源节点和虚拟节点的纵向索引为其所处的层次,最上面为第一层。而横向索引是其在层次中所处的横向的位置,从最左边位置为1,往右递增。一个节点相对于邻层的重心定义为邻层中所有与该节点有关系的节点的横向索引之和与邻层结点个数的商。First of all, it needs to be clarified that the vertical index of resource nodes and virtual nodes in the graph is the layer they are in, and the top is the first layer. The horizontal index is its horizontal position in the hierarchy, and the leftmost position is 1, increasing to the right. The center of gravity of a node relative to the adjacent layer is defined as the quotient of the sum of the horizontal indexes of all nodes related to the node in the adjacent layer and the number of nodes in the adjacent layer.

对重排的流程进行说明:Explain the reordering process:

步骤A、计算第i层节点相对于第i-1层上节点的第一重心和相对于第i+1层上节点的第二重心,设定最大排序次数,其中:Step A. Calculate the first center of gravity of the nodes on the i-th layer relative to the nodes on the i-1 layer and the second center of gravity relative to the nodes on the i+1 layer, and set the maximum number of sorting times, where:

第i层单节点的第一重心为第i-1层与该节点相连的节点的横向索引之和与第i-1层上与该节点有依赖关系的节点的总个数的商;The first center of gravity of a single node in the i-th layer is the quotient of the sum of the horizontal indexes of the nodes connected to the node in the i-1 layer and the total number of nodes on the i-1 layer that have a dependency relationship with the node;

第i层单节点的第二重心为第i+1层上节点与该节点相连的节点的横向索引之和与第i+1层上与该节点有依赖关系的节点的总个数的商;The second center of gravity of a single node in the i-th layer is the quotient of the sum of the horizontal indexes of the nodes connected to the node on the i+1 layer and the total number of nodes that have dependencies on the node on the i+1 layer;

优选的,最大排序次数一般设置为资源的总层数;Preferably, the maximum number of sorting times is generally set to the total number of layers of resources;

步骤B、按照层次i从2到N的顺序,固定第i-1层的节点,按照第i层上的第一重心从小到大进行排序,计算排序后的交叉点数;Step B, according to the order of level i from 2 to N, fix the nodes of the i-1th layer, sort according to the first center of gravity on the i-th layer from small to large, and calculate the number of cross points after sorting;

步骤C、按照层次i从2到N的顺序,调换第i层上针对于第i-1层上的第一重心值相同的节点的位置,计算排序后的交叉点数;Step C, according to the order of level i from 2 to N, exchange the positions of the nodes on the i-th layer with the same first center of gravity value on the i-1th layer, and calculate the number of cross points after sorting;

步骤D、按照层次从N-1到1的顺序,固定第i+1层的节点,按照第i层上的第二重心从小到大进行排序,计算排序后的交叉点数;Step D, according to the order of levels from N-1 to 1, fix the nodes of the i+1th layer, sort according to the second center of gravity on the i-th layer from small to large, and calculate the number of cross points after sorting;

步骤E、若B、C、D中计算得到的交叉点数为0,则保存排序结果,重排流程结束。Step E. If the number of intersection points calculated in B, C, and D is 0, the sorting result is saved, and the rearrangement process ends.

步骤F、若B、C、D循环次数达到设定的最大排序次数,则保存步骤B、C和D计算的交叉点数最小的结果,重排流程结束。Step F. If the number of cycles of B, C, and D reaches the set maximum number of sorting times, save the result of the minimum number of intersection points calculated in steps B, C, and D, and the rearrangement process ends.

在本发明实施例中,被依赖的资源节点处在层次较低,相对的,依赖的资源节点处在的层次较高。根据资源分配原则,在个数上,较低层次上每个层次的节点要比较高层次的节点要少,因此,在执行步骤B时,通过按照层次从2到N的顺序,对每层节点上的位置进行重排,得到交叉点数,在此基础上,执行步骤C,以尝试更换重心值相同的节点的位置是否可以使交叉数减少,再执行步骤E,通过更换重排顺序进一步尝试是否有交叉数最少的排列方式。In the embodiment of the present invention, the dependent resource node is at a lower level, while the dependent resource node is at a higher level. According to the principle of resource allocation, in terms of number, the number of nodes in each level at the lower level is less than that at the higher level. Rearrange the positions above to get the number of intersections. On this basis, perform step C to try to see if changing the positions of nodes with the same center of gravity can reduce the number of intersections, and then perform step E to further try whether to change the rearrangement order The arrangement with the least number of intersections.

其中上述步骤B和D的顺序可以调换,若先进行D再进行B,那么在D或B之后需加一步同方向上对相同重心点交换位置的操作。B和D分别是从两个方向调整有向图层次上的关系,这两步只需有一步的后面增加对重心相同的节点的顺序调整即可,这是为了保证不忽略调整相同重心节点后可以得到更优结果的情况,又避免每次调整顺序后都要调整重心相同节点顺序。The order of the above-mentioned steps B and D can be reversed. If D is performed first and then B is performed, then after D or B, an operation of exchanging the position of the same center of gravity in the same direction is required. B and D are to adjust the relationship on the directed graph level from two directions respectively. After these two steps, only one step needs to be added to adjust the order of the nodes with the same center of gravity. This is to ensure that the adjustment of the nodes with the same center of gravity is not ignored. In the case where better results can be obtained, it is also avoided to adjust the order of nodes with the same center of gravity every time the order is adjusted.

简单来说,上述所说的排序流程还可以被如下步骤所替换,具体为:To put it simply, the above-mentioned sorting process can also be replaced by the following steps, specifically:

步骤1、按照层次i从N-1到1的顺序,固定第i+1层的节点,按照第i层上的相对于下层节点的重心即第二重心从小到大进行排序,计算排序后的交叉点数;Step 1. According to the order of level i from N-1 to 1, fix the nodes of the i+1th layer, sort according to the center of gravity on the i-th layer relative to the lower layer nodes, that is, the second center of gravity, from small to large, and calculate the sorted number of intersections;

步骤2、按照层次i从N-1到1的顺序,调换第i层上针对于下层节点重心值相同的节点的位置,即第二重心值相同的节点的位置,计算排序后的交叉点数;Step 2. According to the order of level i from N-1 to 1, exchange the position of the node on the i-th layer with the same center of gravity value for the lower node, that is, the position of the node with the same second center of gravity value, and calculate the number of intersections after sorting;

步骤3、按照层次i从2到N的顺序,固定第i-1层的节点,按照第i层上的第一重心从小到大进行排序,计算排序后的交叉点数。Step 3. According to the order of level i from 2 to N, fix the nodes of level i-1, sort according to the first center of gravity on level i from small to large, and calculate the number of intersections after sorting.

下面以一应用实例来进行说明:The following is an application example to illustrate:

图2为本发明实施例提供的依赖关系的有向图的示意图。在图1所示图形中,有一个两层有向图,节点A依赖于节点C和节点D,节点B依赖于节点C,这样,图形中就有一个交叉点。节点的重心是相对的。一个节点相对于邻层的重心定义为所有邻层中所有与其有关系的节点的平均索引值。其中,节点A依赖于节点C和节点D,这两个节点的横向索引分别为1和2,所以,节点A相对于下层的重心值(1+2)/2=1.5。同理,节点B相对于下层的节点为C,即与B有依赖关系的节点的个数为2,而C的横向索引值为1,则B相对于下层节点的重心值为1,节点C相对于上层节点的重心是1.5,节点D相对于上层节点的重心为1。FIG. 2 is a schematic diagram of a directed graph of dependencies provided by an embodiment of the present invention. In the graph shown in Figure 1, there is a two-layer directed graph. Node A depends on nodes C and D, and node B depends on node C. In this way, there is an intersection point in the graph. The center of gravity of a node is relative. The center of gravity of a node with respect to the adjacent layer is defined as the average index value of all nodes related to it in all adjacent layers. Among them, node A depends on node C and node D, and the horizontal indexes of these two nodes are 1 and 2 respectively, so the center of gravity value of node A relative to the lower layer is (1+2)/2=1.5. Similarly, node B is C relative to the lower node, that is, the number of nodes that have a dependency relationship with B is 2, and the horizontal index value of C is 1, then the barycenter value of B relative to the lower node is 1, and node C The center of gravity relative to the upper node is 1.5, and the center of gravity of node D relative to the upper node is 1.

而基于重心的排序是指固定一层节点,对其相邻层次的节点进行重心排序。在图2中,固定第一层,对第二层节点进行排序,由于D的重心为1小于C的重心1.5,所以将C和D交换位置,得到新的有向图,即图3,即图3为对图2所示有向图进行重心重排后得到的有向图的示意图。The sorting based on the center of gravity refers to fixing a layer of nodes, and sorting the nodes of its adjacent layers by the center of gravity. In Figure 2, the first layer is fixed, and the second layer nodes are sorted. Since the center of gravity of D is 1 less than the center of gravity of C 1.5, C and D are exchanged to obtain a new directed graph, that is, Figure 3, that is FIG. 3 is a schematic diagram of a directed graph obtained by rearranging the center of gravity of the directed graph shown in FIG. 2 .

由图3可以看到,图3中的交叉点个数变为0。同样的,也可以固定第二层节点,对第一层节点进行排序,A的重心1.5大于B的重心1,将A和B对换位置,也可以得到交叉点为0的节点。It can be seen from Figure 3 that the number of intersections in Figure 3 becomes 0. Similarly, it is also possible to fix the nodes of the second layer and sort the nodes of the first layer. The center of gravity of A is 1.5 greater than the center of gravity of B. If A and B are swapped, a node with an intersection point of 0 can also be obtained.

当然,对于多层图形,则按照从上向下或者从下向上的顺序依次排序。需要特别指出的是,对于计算得到重心值相同的节点,他们的相对顺序可能会影响最终的结果,所以在完成一轮从上向下的排序后,要按照同方向对重心值相同的节点调换位置,以确定对交叉点的影响最小。Of course, for multi-layer graphics, they are sorted sequentially from top to bottom or bottom to top. It should be pointed out that for the nodes with the same center of gravity calculated, their relative order may affect the final result, so after completing a round of sorting from top to bottom, the nodes with the same center of gravity should be replaced in the same direction position to determine the least impact on the intersection.

基于重心排序的布局完成后,得到最终确定的节点的横向和纵向索引,根据将要展示的画布的尺寸,将其绘制并展示出来。将节点对应的图标和相应关系进行可视化展示,在固定和可变大小的画布中,描绘出资源节点和资源间关系,若需展示资源监控,则描述资源状态。After the layout based on the center of gravity sorting is completed, the horizontal and vertical indexes of the finalized nodes are obtained, and are drawn and displayed according to the size of the canvas to be displayed. Visually display the icons corresponding to the nodes and the corresponding relationships. On fixed and variable-sized canvases, describe the relationship between resource nodes and resources. If resource monitoring needs to be displayed, describe the resource status.

当然,在实际应用中,如果有添加资源的依赖关系,则根据新加的依赖关系,更新资源及其相关资源的层次位置,如果删除资源的依赖关系时,根据删除的依赖关系,更新资源及其相关资源的层次位置。Of course, in practical applications, if there is a dependency of adding a resource, the hierarchical position of the resource and its related resources will be updated according to the newly added dependency. If the dependency of the resource is deleted, the resource and The hierarchical location of its associated resource.

由此可以看出,本发明通过输出资源信息之间的依赖关系的有向图,直观的表示了资源间的关系。It can be seen from this that the present invention intuitively expresses the relationship between resources by outputting the directed graph of the dependency relationship between resource information.

图4为本发明提供的资源信息的输出系统实施例的结构示意图。结合图1所示方法实施例,图4所示系统实施例包括:Fig. 4 is a schematic structural diagram of an embodiment of a system for outputting resource information provided by the present invention. In combination with the method embodiment shown in Figure 1, the system embodiment shown in Figure 4 includes:

获取装置401,用于获取每个资源节点与系统中其他资源节点在资源上的依赖关系;Obtaining means 401, configured to obtain resource dependencies between each resource node and other resource nodes in the system;

第一分配装置402,与所述获取装置401相连,用于为所述每个资源节点分配在资源层次的位置,其中位于第i+1个层次的资源节点的资源依赖位于层次为小于或等于第i个的资源节点的资源,其中i=1,2......,N,N为正整数;The first allocating means 402 is connected with the obtaining means 401, and is used to allocate a resource level position for each resource node, wherein the resources of the resource nodes at the (i+1)th level depend on the level being less than or equal to The resources of the i-th resource node, where i=1, 2..., N, N is a positive integer;

连接装置403,与所述第一分配装置402相连,用于在存在依赖关系的两资源节点所处的层次之间的差距均为1时,连接各依赖关系中两资源节点,得到依赖关系的有向图;The connecting means 403 is connected to the first allocating means 402, and is used to connect the two resource nodes in each dependency relationship when the gap between the levels of the two resource nodes in which there is a dependency relationship is 1, to obtain the dependency relationship. directed graph;

输出装置404,与所述连接装置403相连,用于发起输出所述依赖关系的有向图的流程。The output device 404 is connected to the connection device 403 and configured to initiate a process of outputting the directed graph of the dependency relationship.

可选的,所述系统还包括:Optionally, the system also includes:

第二分配装置,与所述第一分配装置402和连接装置403相连,用于在存在依赖关系的两资源节点所处的层次之间的差距大于1时,在所述依赖关系中两资源节点所在层次之间一一对应的分配一个虚拟节点,再触发依赖关系的有向图的获取流程。The second allocating means is connected with the first allocating means 402 and the connecting means 403, and is used for when the difference between the levels of two resource nodes in the dependency relationship is greater than 1, the two resource nodes in the dependency relationship Allocate a virtual node in a one-to-one correspondence between the layers, and then trigger the acquisition process of the directed graph of dependencies.

具体来说,所述输出装置包括:Specifically, the output device includes:

第一计算模块,用于计算第i层节点相对于第i-1层上节点的第一重心和相对于第i+1层上节点的第二重心,设定最大排序次数,其中:第i层每个节点的第一重心为第i-1层上与该节点有依赖关系的所有节点的索引之和与第i-1层上与该节点有依赖关系的节点的总个数的商;第i层每个节点的第二重心为第i+1层上节点与该节点有依赖关系的所有节点的横向索引之和与第i+1层上与该节点有依赖关系的节点的总个数的商;The first calculation module is used to calculate the first center of gravity of the nodes on the i-th layer relative to the nodes on the i-1 layer and the second center of gravity relative to the nodes on the i+1 layer, and set the maximum number of sorting times, wherein: the i-th layer The first center of gravity of each node in the layer is the quotient of the sum of the indexes of all nodes that have a dependency relationship with this node on the i-1th layer and the total number of nodes that have a dependency relationship with this node on the i-1th layer; The second center of gravity of each node in the i-th layer is the sum of the horizontal indexes of all nodes that are dependent on the node on the i+1 layer and the total number of nodes that are dependent on the node on the i+1 layer number of quotient;

第一排序模块,用于执行排序流程,所述排序流程包括:The first sorting module is used to execute the sorting process, and the sorting process includes:

步骤1、按照层次i从2到N的顺序,固定第i-1层的节点,按照第i层上的第一重心从小到大进行排序,计算排序后的交叉点数;Step 1. According to the order of level i from 2 to N, fix the nodes of the i-1th layer, sort according to the first center of gravity on the i-th layer from small to large, and calculate the number of cross points after sorting;

步骤2、按照层次i从2到N的顺序,调换第i层上针对于第i-1层上第一重心值相同的节点的位置,计算排序后的交叉点数;Step 2. According to the order of level i from 2 to N, exchange the position of the node on the i-th level with the same first barycenter value on the i-1th level, and calculate the number of intersections after sorting;

步骤3、按照层次i从N-1到1的顺序,固定第i+1层的节点,按照第i层上的第二重心从小到大进行排序,计算排序后的交叉点数;Step 3. According to the order of level i from N-1 to 1, fix the nodes of level i+1, sort according to the second center of gravity on level i from small to large, and calculate the number of cross points after sorting;

第一输出模块,用于在步骤1、2、3中计算得到的交叉点数为0时,保存排序结果并输出,或者,在步骤1、2、3循环次数达到设定的最大排序次数时,保存步骤1、2、3中计算的交叉点数最小的结果并输出。The first output module is used to save and output the sorting results when the number of cross points calculated in steps 1, 2, and 3 is 0, or, when the number of cycles in steps 1, 2, and 3 reaches the set maximum number of sorting times, Save the result with the smallest number of intersections calculated in steps 1, 2, and 3 and output it.

具体来说,所述输出装置包括:Specifically, the output device includes:

第二计算模块,用于计算第i层节点相对于第i-1层上节点的第一重心和相对于第i+1层上节点的第二重心,设定最大排序次数,其中:第i层每个节点的第一重心为第i-1层上与该节点有依赖关系的所有节点的横向索引之和与第i-1层上与该节点有依赖关系的节点的总个数的商;第i层每个节点的第二重心为第i+1层上节点与该节点有依赖关系的所有节点的横向索引之和与第i+1层上与该节点有依赖关系的节点的总个数的商;The second calculation module is used to calculate the first center of gravity of the nodes on the i-th layer relative to the nodes on the i-1 layer and the second center of gravity relative to the nodes on the i+1 layer, and set the maximum number of sorting times, wherein: the i-th layer The first center of gravity of each node in the layer is the quotient of the sum of the horizontal indexes of all nodes that have a dependency relationship with this node on the i-1th layer and the total number of nodes that have a dependency relationship with this node on the i-1th layer ; The second center of gravity of each node in the i-th layer is the sum of the horizontal indexes of all the nodes on the i+1 layer that have a dependency relationship with this node and the sum of the nodes that have a dependency relationship with this node on the i+1 layer number of quotient;

第二排序模块,用于执行排序流程,所述排序流程包括:The second sorting module is used to execute the sorting process, and the sorting process includes:

步骤1、按照层次从N-1到1的顺序,固定第i+1层的节点,按照第i层上的第二重心从小到大进行排序,计算排序后的交叉点数;Step 1. According to the order of levels from N-1 to 1, fix the nodes of the i+1th layer, sort according to the second center of gravity on the i-th layer from small to large, and calculate the number of cross points after sorting;

步骤2、按照层次i从2到N的顺序,调换第i层上针对于第i-1层上第二重心值相同的节点的位置,计算排序后的交叉点数;Step 2. According to the order of level i from 2 to N, exchange the position of the node on the i-th layer with the same second center of gravity value on the i-1th layer, and calculate the number of cross points after sorting;

步骤3、按照层次i从2到N的顺序,固定第i-1层的节点,按照第i层上的第一重心从小到大进行排序,计算排序后的交叉点数;Step 3. According to the order of level i from 2 to N, fix the nodes of the i-1th layer, sort according to the first center of gravity on the i-th layer from small to large, and calculate the number of cross points after sorting;

第二输出模块,用于在步骤1、2、3中计算得到的交叉点数为0时,保存排序结果并输出,或者,在步骤1、2、3循环次数达到设定的最大排序次数时,保存步骤1、2、3中计算的交叉点数最小的结果并输出。The second output module is used to store and output the sorting results when the number of cross points calculated in steps 1, 2, and 3 is 0, or, when the number of cycles in steps 1, 2, and 3 reaches the set maximum number of sorting times, Save the result with the smallest number of intersections calculated in steps 1, 2, and 3 and output it.

与现有技术相比,通过有向图输出节点之间的资源依赖关系,简单且直观。Compared with the prior art, it is simple and intuitive to output resource dependencies between nodes through a directed graph.

本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。Those of ordinary skill in the art can understand that all or part of the steps of the above-mentioned embodiments can be implemented using a computer program flow, the computer program can be stored in a computer-readable storage medium, and the computer program can be run on a corresponding hardware platform (such as system, device, device, device, etc.), and when executed, includes one or a combination of the steps of the method embodiment.

可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Optionally, all or part of the steps in the above embodiments can also be implemented using integrated circuits, and these steps can be fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module accomplish. As such, the present invention is not limited to any specific combination of hardware and software.

上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/functional modules/functional units in the above embodiments can be realized by general-purpose computing devices, and they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices.

上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When each device/functional module/functional unit in the above-mentioned embodiments is realized in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, and the like.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求所述的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope described in the claims.

Claims (4)

1. an output intent for resource information, is characterized in that, comprising:
Obtain the dependence of other resource nodes in resource in each resource node and system;
For described each resource node is distributed in the position of resource hierarchy, the Resource Dependence being wherein positioned at the resource node of the i-th+1 level is positioned at the resource that level is the resource node being less than or equal to i-th, wherein i=1,2 ..., N, N are positive integer;
If the gap between the level residing for two resource nodes of Existence dependency relationship is 1, connects two resource nodes in each dependence, obtain the directed graph of dependence;
Initiate the flow process of the directed graph exporting described dependence;
Wherein, the described flow process initiating the directed graph exporting described dependence comprises:
Calculate the i-th node layer go up the first center of gravity of node relative to the i-th-1 layer and go up the second center of gravity of node relative to the i-th+1 layer, set maximum sequence number of times, wherein: the first center of gravity of i-th layer of each node is the i-th-1 layer above has with this node the horizontal index sum of all nodes of dependence and the i-th-1 layer to go up and this node has the business of total number of the node of dependence; Second center of gravity of i-th layer of each node to be the i-th+1 layer upper node with this node the have horizontal index sum of all nodes of dependence and the i-th+1 layer are gone up and this node has the business of total number of the node of dependence;
Perform sequence flow process, described sequence flow process comprises:
Step 1, according to level i from the order of 2 to N, fix the node of the i-th-1 layer, sort from small to large according to the first center of gravity on i-th layer, calculate sequence after intersection count;
Step 2, according to the order of level i from 2 to N, exchange the position of the identical node of i-th layer of upper first center-of-gravity value, the intersection calculated after sequence is counted;
Step 3, according to level i from N-1 to the order of 1, fix the node of the i-th+1 layer, sort from small to large according to the second center of gravity on i-th layer, calculate sequence after intersection count;
Or described sequence flow process comprises:
Step 1, according to level i from N-1 to the order of 1, fix the node of the i-th+1 layer, sort from small to large according to the center of gravity relative to lower level node on i-th layer i.e. the second center of gravity, calculate sequence after intersection count;
Step 2, according to level i from N-1 to the order of 1, be directed to the position of the identical node of lower level node center-of-gravity value on exchanging i-th layer, i.e. the position of the node that the second center-of-gravity value is identical, calculate sequence after intersection count;
Step 3, according to level i from the order of 2 to N, fix the node of the i-th-1 layer, sort from small to large according to the first center of gravity on i-th layer, calculate sequence after intersection count;
If it is 0 that the intersection calculated in step 1,2,3 is counted, then preserve ranking results and export, or, if step 1,2,3 cycle-indexes reach the maximum sequence number of times of setting, then preserve the intersection calculated in step 1,2,3 and to count minimum result exporting;
Wherein, described horizontal index is the position of its transverse direction residing in level, is set to 1, turns right and increase progressively from leftmost bit.
2. method according to claim 1, is characterized in that, described method also comprises:
If the gap between the level residing for two resource nodes of Existence dependency relationship is greater than 1, in described dependence, distribute a dummy node one to one between two resource node place levels, then trigger the acquisition flow process of directed graph of dependence.
3. an output system for resource information, is characterized in that, comprising:
Acquisition device, for obtaining the dependence of other resource nodes in resource in each resource node and system;
First distributor, for being distributed in the position of resource hierarchy for described each resource node, the Resource Dependence being wherein positioned at the resource node of the i-th+1 level is positioned at the resource that level is the resource node being less than or equal to i-th, wherein i=1,2 ..., N, N are positive integer;
Jockey, when being 1 for the gap between the level residing for two resource nodes of Existence dependency relationship, connecting two resource nodes in each dependence, obtains the directed graph of dependence;
Output device, for initiating the flow process of the directed graph exporting described dependence;
Wherein, described output device comprises:
First computing module, for calculating the first center of gravity of the i-th node layer upper node relative to the i-th-1 layer and going up the second center of gravity of node relative to the i-th+1 layer, sets maximum sequence number of times, wherein:
First center of gravity of i-th layer of each node is the i-th-1 layer above has with this node the horizontal index sum of all nodes of dependence and the i-th-1 layer to go up and this node has the business of total number of the node of dependence; Second center of gravity of i-th layer of each node to be the i-th+1 layer upper node with this node the have horizontal index sum of all nodes of dependence and the i-th+1 layer are gone up and this node has the business of total number of the node of dependence;
First order module, for performing sequence flow process, described sequence flow process comprises:
Step 1, according to level i from the order of 2 to N, fix the node of the i-th-1 layer, sort from small to large according to the first center of gravity on i-th layer, calculate sequence after intersection count;
Step 2, according to the order of level i from 2 to N, be directed to the position of the identical node of the i-th-1 layer upper first center-of-gravity value on exchanging i-th layer, the intersection calculated after sequence is counted;
Step 3, according to level i from N-1 to the order of 1, fix the node of the i-th+1 layer, sort from small to large according to the second center of gravity on i-th layer, calculate sequence after intersection count;
First output module, intersection for calculating in step 1,2,3 is counted when being 0, preserves ranking results and also exports, or, step 1,2,3 cycle-indexes reach the maximum sequence number of times of setting time, preserve the intersection calculated in step 1,2,3 and to count minimum result exporting;
Or described output device comprises:
Second computing module, for calculating the first center of gravity of the i-th node layer upper node relative to the i-th-1 layer and going up the second center of gravity of node relative to the i-th+1 layer, set maximum sequence number of times, wherein: the first center of gravity of i-th layer of each node is the i-th-1 layer above has with this node the horizontal index sum of all nodes of dependence and the i-th-1 layer to go up and this node has the business of total number of the node of dependence; Second center of gravity of i-th layer of each node to be the i-th+1 layer upper node with this node the have horizontal index sum of all nodes of dependence and the i-th+1 layer are gone up and this node has the business of total number of the node of dependence;
Second order module, for performing sequence flow process, described sequence flow process comprises:
Step 1, according to level from N-1 to the order of 1, fix the node of the i-th+1 layer, sort from small to large according to the second center of gravity on i-th layer, calculate sequence after intersection count;
Step 2, according to the order of level i from N-1 to 1, be directed to the position of the identical node of i-th layer of second center-of-gravity value on exchanging the i-th+1 layer, the intersection calculated after sequence is counted;
Step 3, according to level i from the order of 2 to N, fix the node of the i-th-1 layer, sort from small to large according to the first center of gravity on i-th layer, calculate sequence after intersection count;
Second output module, intersection for calculating in step 1,2,3 is counted when being 0, preserves ranking results and also exports, or, step 1,2,3 cycle-indexes reach the maximum sequence number of times of setting time, preserve the intersection calculated in step 1,2,3 and to count minimum result exporting;
Wherein, described horizontal index is the position of its transverse direction residing in level, is set to 1, turns right and increase progressively from leftmost bit.
4. system according to claim 3, is characterized in that, described system also comprises:
Second distributor, when being greater than 1 for the gap between the level residing for two resource nodes of Existence dependency relationship, in described dependence, distribute a dummy node one to one between two resource node place levels, then trigger the acquisition flow process of directed graph of dependence.
CN201110369713.1A 2011-11-18 2011-11-18 The output intent of resource information and system Active CN103124279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110369713.1A CN103124279B (en) 2011-11-18 2011-11-18 The output intent of resource information and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110369713.1A CN103124279B (en) 2011-11-18 2011-11-18 The output intent of resource information and system

Publications (2)

Publication Number Publication Date
CN103124279A CN103124279A (en) 2013-05-29
CN103124279B true CN103124279B (en) 2015-12-02

Family

ID=48455132

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110369713.1A Active CN103124279B (en) 2011-11-18 2011-11-18 The output intent of resource information and system

Country Status (1)

Country Link
CN (1) CN103124279B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426556B (en) * 2014-09-19 2020-07-31 北京华大九天软件有限公司 Visual analysis method for layer relation in layout design rule file
CN109327484B (en) * 2017-07-31 2021-09-28 北京嘀嘀无限科技发展有限公司 Method and device for acquiring characteristic value set, server and storage medium
CN110690997B (en) * 2019-10-10 2024-07-05 深圳前海微众银行股份有限公司 Node formatting method, device, equipment and readable storage medium
CN117135046B (en) * 2023-10-26 2024-01-12 北京中企慧云科技有限公司 Target resource configuration method, device, equipment and medium based on node association degree

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710866A (en) * 2005-06-30 2005-12-21 西安交通大学 Intrusion detection method based on call stack diagram in Linux environment
CN101035023A (en) * 2007-03-07 2007-09-12 华为技术有限公司 Network structure topology layout method and network management device
CN101040486A (en) * 2004-10-12 2007-09-19 国际商业机器公司 Automatic topology formation method, system and program product in dynamic distributed environment
CN101681275A (en) * 2007-05-17 2010-03-24 国际商业机器公司 Scalable performance-based volume allocation in large storage controller collections
CN101702655A (en) * 2009-10-27 2010-05-05 北京星网锐捷网络技术有限公司 Layout method and system of network topological diagram

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030154266A1 (en) * 2000-09-01 2003-08-14 Mark Bobick Server system and method for discovering digital assets in enterprise information systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101040486A (en) * 2004-10-12 2007-09-19 国际商业机器公司 Automatic topology formation method, system and program product in dynamic distributed environment
CN1710866A (en) * 2005-06-30 2005-12-21 西安交通大学 Intrusion detection method based on call stack diagram in Linux environment
CN101035023A (en) * 2007-03-07 2007-09-12 华为技术有限公司 Network structure topology layout method and network management device
CN101681275A (en) * 2007-05-17 2010-03-24 国际商业机器公司 Scalable performance-based volume allocation in large storage controller collections
CN101702655A (en) * 2009-10-27 2010-05-05 北京星网锐捷网络技术有限公司 Layout method and system of network topological diagram

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
UML类图层次化自动布图算法;王晓博 等;《软件学报》;20090630(第6期);全文 *

Also Published As

Publication number Publication date
CN103124279A (en) 2013-05-29

Similar Documents

Publication Publication Date Title
CN105573660B (en) Method and apparatus for improving the performance of sub-clustering disk array
CN102968503B (en) The data processing method of Database Systems and Database Systems
US9280370B2 (en) System structure management device, system structure management method, and program
CN103858103B (en) For resource management and the method and system of resource allocation
US9250965B2 (en) Resource allocation for migration within a multi-tiered system
WO2021189695A1 (en) Distributed database dynamic expansion method and apparatus, and device and storage medium
US20110276649A1 (en) Method for Efficient Partition and Replication of Social-Based Applications
CN105373480A (en) ABTest system shunt optimizing method and system
CN103124279B (en) The output intent of resource information and system
CN113383364B (en) Method, electronic equipment, system and medium for selecting nodes of verifier
CN105210059B (en) A kind of data processing method and system
CN105302838B (en) Classification method, lookup method and equipment
US10133763B2 (en) Isolation of concurrent operations on tree-based data structures
CN108829738A (en) Date storage method and device in a kind of ceph
CN110362854B (en) An automatic processing method and device for fault tree graphical modeling node layout
CN108572978A (en) Method and computer system of the structure for the inverted index structure of block chain
CN108037977A (en) Management method, equipment, computer media and the system of virtual machine resource
WO2017068438A1 (en) Concurrent bulk processing of tree-based data structures
CN107222565A (en) A kind of network dividing method and system
CN111865683B (en) Method, device, equipment and storage medium for virtual gateway version gray release
CN112396514A (en) Quota updating method, device, equipment and computer readable storage medium
CN104331263B (en) Front-end display method and device for a large amount of spatial data
CN117749740A (en) Port matching method and device based on two-stage arbitration strategy
CN117538726A (en) Dimension fusion parallel fault simulation method and system for digital circuit
JP6278908B2 (en) Management device and software component grouping method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20180827

Address after: 200436 Room 411, No. three, JIANGCHANG Road, Jingan District, Shanghai, 411

Patentee after: SHANGHAI INSPUR CLOUD CALCULATING SERVICE CO.,LTD.

Address before: 100085 floor 1, C 2-1, No. 2, Shang Di Road, Haidian District, Beijing.

Patentee before: INSPUR (BEIJING) ELECTRONIC INFORMATION INDUSTRY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221102

Address after: 261100 Rooms 303-304, Floor 3, Building 5, Weifang Headquarters Base Phase I, No. 2998, Beihai Road, Hanting District, Weifang City, Shandong Province

Patentee after: Weifang Cloud Computing Center (Inspur) Construction Management Co.,Ltd.

Address before: 200436 Room 411, No. three, JIANGCHANG Road, Jingan District, Shanghai, 411

Patentee before: SHANGHAI INSPUR CLOUD CALCULATING SERVICE CO.,LTD.