CN1851693A - Method for realizing system resources management - Google Patents
Method for realizing system resources management Download PDFInfo
- Publication number
- CN1851693A CN1851693A CN 200510098777 CN200510098777A CN1851693A CN 1851693 A CN1851693 A CN 1851693A CN 200510098777 CN200510098777 CN 200510098777 CN 200510098777 A CN200510098777 A CN 200510098777A CN 1851693 A CN1851693 A CN 1851693A
- Authority
- CN
- China
- Prior art keywords
- node
- entity
- child
- tree
- relationship tree
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种对系统资源进行管理的实现方法,采用对象关系树技术,包括以下步骤:A、在建立对象关系树时,如果一个父实体对象的多个子实体对象属于不同资源组,则创建分别与每个资源组一一对应的虚拟对象节点,将虚拟对象节点作为父实体对象节点的子节点,将属于同一资源组的子实体对象节点作为该资源组对应的虚拟对象节点的子节点,加入到对象关系树中;B、在进行系统资源管理时,根据对象关系树上虚拟对象节点与实体对象节点的父子关系,查找到属于同一资源组的实体对象节点,进行操作。应用本发明方法,能够降低处理程序代码与具体的实体对象的相关性,方便系统的维护和扩展。
The invention discloses a method for realizing the management of system resources, adopting the object relational tree technology, including the following steps: A. When establishing the object relational tree, if multiple child entity objects of a parent entity object belong to different resource groups, then Create a virtual object node corresponding to each resource group one by one, use the virtual object node as the child node of the parent entity object node, and use the child entity object node belonging to the same resource group as the child node of the virtual object node corresponding to the resource group , added to the object relational tree; B. When performing system resource management, according to the parent-child relationship between the virtual object node and the physical object node on the object relational tree, the physical object node belonging to the same resource group is found and operated. By applying the method of the invention, the correlation between processing program codes and specific entity objects can be reduced, and system maintenance and expansion are facilitated.
Description
技术领域technical field
本发明涉及一种采用对象关系树技术对系统资源进行管理的实现方法。The invention relates to a realization method for managing system resources by adopting object relational tree technology.
背景技术Background technique
目前,对包含较多设备的大型系统,通常采用对象关系树技术,对该系统的资源进行管理。例如:通信系统就采用对象关系树技术进行系统资源的管理。At present, for a large-scale system containing many devices, the object relational tree technology is usually used to manage the resources of the system. For example: the communication system uses the object relational tree technology to manage the system resources.
以下以采用对象关系树技术对通信系统资源进行管理的方法为例,对现有技术进行说明。The prior art will be described below by taking a method for managing communication system resources using the object relational tree technology as an example.
采用对象关系树技术对通信系统资源进行管理,首先根据通信系统资源各个实体对象的父子关系列表建立对象关系树,然后通过对对象关系树的操作,来实现对通信系统资源进行管理。The communication system resources are managed by using the object relationship tree technology. Firstly, the object relationship tree is established according to the parent-child relationship list of each entity object of the communication system resources, and then the communication system resources are managed through the operation of the object relationship tree.
参见图1,图1为现有技术建立一个简单对象关系树的处理流程图。该流程包括以下步骤:Referring to FIG. 1 , FIG. 1 is a flow chart of establishing a simple object relational tree in the prior art. The process includes the following steps:
步骤101,读取实体对象父子关系列表的一个表项。
步骤102,判断该表项中的父实体对象节点是否已经在对象关系树上建立,如果是则执行步骤103;否则执行步骤104。
步骤103,在对象关系树上定位该父实体对象节点,执行步骤105。
步骤104,在对象关系树上,创建该父实体对象节点。
步骤105,将该表项中的子实体对象节点,作为该父实体对象节点的子节点,建立父子关系,加入到对象关系树上。In
步骤106,判断是否所有表项都读取完,如果是,则对象关系树建立完成,结束流程;否则返回步骤101,读取下一个表项。In
通过对对象关系树的操作,来实现对通信系统资源的管理,主要包括:对对象关系树的节点查找、节点删除、节点增加等的操作。The management of communication system resources is realized through the operation of the object relational tree, mainly including: the operation of node search, node deletion, node addition, etc. of the object relational tree.
对象关系树的节点查找:可以采取按照宽度优先的算法来查找,也可以采取按照深度优先的算法来查找,也可以采用建立索引的方法进行查找。The node search of the object relational tree: it can be searched according to the breadth-first algorithm, it can also be searched according to the depth-first algorithm, and it can also be searched by the method of indexing.
对象关系树的节点删除比较简单:就是先查找到该节点,然后将其删除,如果删除的是带有子节点的父节点,则先删除该父节点的所有子节点,再删除该父节点;如果删除的是子节点,则直接删除即可。The node deletion of the object relational tree is relatively simple: first find the node, and then delete it. If the parent node with child nodes is deleted, first delete all child nodes of the parent node, and then delete the parent node; If the deletion is a child node, it can be deleted directly.
对象关系树的节点增加:先修改实体对象的父子关系列表,再按照该列表的父子关系,查找到该增加节点的父实体对象节点,将该节点加入到对象关系树上。Adding nodes in the object relationship tree: first modify the parent-child relationship list of the entity object, and then find the parent entity object node of the added node according to the parent-child relationship in the list, and add the node to the object relationship tree.
目前,采用对象关系树技术对系统资源进行管理的方法,受到了对象关系树技术的限制。At present, the method of managing system resources by using the object relational tree technology is limited by the object relational tree technology.
假设,通信系统资源各个实体对象的父子关系列表如表1所示,
表1 Table 1
则根据该列表建立的对象关系树如图2所示,图2为采用图1所示流程建立的对象关系树示意图。The object relationship tree established according to the list is shown in FIG. 2 , and FIG. 2 is a schematic diagram of the object relationship tree established by using the process shown in FIG. 1 .
假设其中A标识基站系统资源,A1代表基站下行资源,由a11~a16标识实体对象,其中a1~a3构成一组资源池,a4~a6构成另一组资源池。A2代表基站上行资源,由a22~a23标识实体对象,a22~a23属于同一资源池。Assume that A identifies base station system resources, A1 represents base station downlink resources, and a11-a16 identify entity objects, wherein a1-a3 constitute a group of resource pools, and a4-a6 constitute another group of resource pools. A2 represents the uplink resources of the base station, and a22-a23 identify entity objects, and a22-a23 belong to the same resource pool.
在一组资源池如a1~a3中,只要可用资源不小于给定要求(假设为2)时,这样即使其中任何一个坏,都不影响整个资源池组的正常工作。上述的资源对象关系树就没有清楚体现出这点,从而需要在处理代码中来“实现”这类逻辑。In a group of resource pools such as a1-a3, as long as the available resources are not less than a given requirement (assumed to be 2), even if any one of them fails, it will not affect the normal work of the entire resource pool group. The above-mentioned resource object relationship tree does not clearly reflect this point, so this kind of logic needs to be "implemented" in the processing code.
也就是说,资源对象关系树仅仅体现了一部分实体对象之间的关系,另一部分关系,如资源池的组关系在程序的处理过程中实现,造成表达资源对象之间关系的信息分布在几处。这样,如果系统资源对象和对象关系变化时,则不仅需要修改对象关系树,还需要重新修改程序代码,不便于系统维护或扩展时的资源对象关系调整与变更;而且处理程序代码与具体的实体对象紧密相关,因此不便于系统的维护和扩展。That is to say, the resource object relationship tree only reflects the relationship between some entity objects, and another part of the relationship, such as the group relationship of the resource pool, is realized during the processing of the program, causing the information expressing the relationship between resource objects to be distributed in several places. . In this way, if the system resource object and the object relationship change, not only the object relationship tree needs to be modified, but also the program code needs to be re-modified, which is not convenient for the adjustment and change of the resource object relationship during system maintenance or expansion; and the relationship between the program code and the specific entity Objects are closely related, so it is not easy to maintain and expand the system.
另外,在实际实现时,往往为了实现上的方便,对对象树节点扇出度一般做一个通用的约定。该方案往往只选择扇出度最大的节点作为这个约定的扇出度。针对上面的例子,同时假设考虑其它节点扇出度一般为2~3,该方案就只能选择6作为这个约定的扇出度。由于一般对象关系树都是存储在内存中的,对于扇出度为2~3的节点来说,必然就浪费了一部分内存空间,例如对于图2中,假设A2的扇出宽度就是3,也只能给A2预留存储6个子节点的内存空间,显然浪费了资源。In addition, in actual implementation, for the convenience of implementation, a general agreement is generally made on the fan-out degree of object tree nodes. This solution often only selects the node with the largest fanout as the agreed fanout. For the above example, and assuming that the fan-out degree of other nodes is generally 2 to 3, this solution can only choose 6 as the agreed fan-out degree. Since the general object relational tree is stored in memory, for nodes with a fan-out degree of 2 to 3, a part of the memory space must be wasted. For example, in Figure 2, assuming that the fan-out width of A2 is 3, also Only the memory space for storing 6 child nodes can be reserved for A2, which obviously wastes resources.
发明内容Contents of the invention
有鉴于此,本发明的主要目的在于提供一种对系统资源进行管理的实现方法,应用该方法能够降低处理程序与实体对象的相关性,方便系统的维护和扩展。In view of this, the main purpose of the present invention is to provide a method for implementing system resource management, which can reduce the correlation between processing programs and entity objects, and facilitate system maintenance and expansion.
为达到上述目的,本发明的技术方案具体是这样实现的:In order to achieve the above object, the technical solution of the present invention is specifically realized in the following way:
一种对系统资源进行管理的实现方法,采用对象关系树技术,包括以下步骤:A method for implementing management of system resources, using object relational tree technology, comprising the following steps:
A、在建立对象关系树时,如果一个父实体对象的多个子实体对象属于不同资源组,则创建分别与每个资源组一一对应的虚拟对象节点,将虚拟对象节点作为父实体对象节点的子节点,将属于同一资源组的子实体对象节点作为该资源组对应的虚拟对象节点的子节点,加入到对象关系树中;A. When building an object relationship tree, if multiple sub-entity objects of a parent entity object belong to different resource groups, create a virtual object node corresponding to each resource group one by one, and use the virtual object node as the parent entity object node Sub-nodes, adding sub-entity object nodes belonging to the same resource group as sub-nodes of virtual object nodes corresponding to the resource group into the object relationship tree;
B、在进行系统资源管理时,根据对象关系树上虚拟对象节点与实体对象节点的父子关系,查找到属于同一资源组的实体对象节点,进行操作。B. When performing system resource management, according to the parent-child relationship between the virtual object node and the entity object node on the object relationship tree, the entity object node belonging to the same resource group is found and operated.
本发明中,可以预先存储实体对象父子关系列表和实体对象组关系表;所述步骤A包括:In the present invention, entity object parent-child relationship list and entity object group relationship table can be stored in advance; said step A includes:
A1、读取实体对象父子关系列表一表项,判断是否已在对象关系树上建立该表项中的父实体对象节点,如果是则找到对象关系树上该父实体对象节点,执行步骤A2;否则在对象关系树上创建该父实体对象节点;A1. Read an entry in the parent-child relationship list of the entity object, judge whether the parent entity object node in the entry has been established on the object relationship tree, if so, find the parent entity object node on the object relationship tree, and execute step A2; Otherwise, create the parent entity object node on the object relational tree;
A2、查找实体对象组关系表,判断该实体对象父子关系表项中的子实体对象是否属于一个资源组,如果是则执行步骤A3;否则确定该实体对象父子关系表项中的父实体对象节点为该子实体对象节点的父节点,将该子实体对象节点加入到对象关系树中;执行步骤A5;A2. Search the entity object group relationship table, and judge whether the child entity object in the parent-child relationship table item of the entity object belongs to a resource group, and if so, perform step A3; otherwise determine the parent entity object node in the parent-child relationship table item of the entity object As the parent node of the sub-entity object node, add the sub-entity object node into the object relationship tree; perform step A5;
A3、判断是否已在对象关系树上建立该资源组对应的虚拟对象节点,如果是则找到该虚拟对象节点执行步骤A4;否则在对象关系树上创建该资源组对应的虚拟对象节点,执行步骤A4;A3. Determine whether the virtual object node corresponding to the resource group has been established on the object relational tree, and if so, find the virtual object node and perform step A4; otherwise, create a virtual object node corresponding to the resource group on the object relational tree, and perform step A3. A4;
A4、确定该虚拟对象节点为该实体对象父子关系表项中的子实体对象节点的父节点,将该子实体对象节点加入到对象关系树中;A4. Determine that the virtual object node is the parent node of the sub-entity object node in the parent-child relationship entry of the entity object, and add the sub-entity object node to the object relationship tree;
A5、判断是否读取完所有实体对象父子关系列表的表项,如果是,则对象关系树建立完成;否则返回步骤A1,读取下一表项。A5. Determine whether the entries in the parent-child relationship list of all entity objects have been read. If yes, the object relationship tree is established; otherwise, return to step A1 and read the next entry.
该方法可以进一步包括:在节点信息中增加一个标志,实体对象节点和虚拟对象节点的节点信息中该标志为不同的数字;根据该标志判断对象关系树中的节点是否为虚拟对象节点。The method may further include: adding a flag to the node information, the flag being a different number in the node information of the entity object node and the virtual object node; judging whether the node in the object relation tree is a virtual object node according to the flag.
该方法还可以进一步包括:对对象节点类型编号分区段,每种节点类型对应一个不同号段;根据类型编号属于实体对象节点和虚拟对象节点的哪个号段来判断节点类型。The method may further include: dividing the object node type number into sections, each node type corresponds to a different number section; judging the node type according to which number section the type number belongs to between the entity object node and the virtual object node.
所述将子实体对象节点加入到对象关系树中的方法可以包括:The method for adding the sub-entity object node into the object relation tree may include:
a1、判断该子实体对象节点的父节点的扇出宽度是否已达到了预定限度,如果是则执行步骤a2;否则确定该父节点为该子实体对象节点的父节点,将该子实体对象节点加入到对象关系树中,完成加入操作;a1. Determine whether the fan-out width of the parent node of the sub-entity object node has reached a predetermined limit, and if so, perform step a2; Add to the object relational tree and complete the join operation;
a2、该父节点加入到宽度优先遍历队列中;a2. The parent node is added to the breadth-first traversal queue;
a3、取出队列中第一个对象节点,采用宽度优先的遍历算法遍历其子节点,并判断是否找到一个扇出宽度小于预定限度的影子对象节点,如果是将该子实体对象节点作为该影子对象的子节点,加入对象关系树,完成加入操作;否则执行步骤a4;a3. Take out the first object node in the queue, use the width-first traversal algorithm to traverse its child nodes, and judge whether to find a shadow object node whose fan-out width is smaller than the predetermined limit, if the child entity object node is used as the shadow object child node, join the object relational tree, and complete the join operation; otherwise, execute step a4;
a4、判断是否找到一个实体对象节点,如果是,则执行步骤a5;否则将父节点的所有子节点,按宽度优先算法加入宽度优先遍历队列,返回步骤a3;a4. Judging whether an entity object node is found, if yes, then execute step a5; otherwise, add all child nodes of the parent node to the breadth-first traversal queue according to the breadth-first algorithm, and return to step a3;
a5、创建一个影子对象节点,拆除找到的实体对象节点与父节点的父子关系;将找到的实体对象节点作为影子对象的子节点;再将影子对象节点作为上述父节点的子节点,建立与该父节点之间的父子关系;加入对象关系树,完成加入操作。a5. Create a shadow object node, remove the parent-child relationship between the found entity object node and the parent node; use the found entity object node as the child node of the shadow object; then use the shadow object node as the child node of the above-mentioned parent node, and establish a relationship with the parent node Parent-child relationship between parent nodes; join the object relational tree to complete the join operation.
该方法还可以进一步包括:在节点信息中增加一个标志,实体对象节点、虚拟对象节点和影子对象节点的节点信息该标志为不同的数字;根据该标志判断对象关系树中的节点类型。The method may further include: adding a sign to the node information, the sign is a different number for the node information of the entity object node, the virtual object node and the shadow object node; judging the node type in the object relational tree according to the sign.
该方法还可以进一步包括:对对象节点类型编号分区段,每种节点类型对应一个不同号段;根据类型编号属于实体对象节点、虚拟对象节点和影子对象节点的哪个号段来判断节点类型。The method may further include: dividing the object node type number into sections, each node type corresponds to a different number section; judging the node type according to which number section the type number belongs to among the entity object node, the virtual object node and the shadow object node.
步骤B中若对对象关系树进行节点删除操作,则可以包含以下步骤:In step B, if the node deletion operation is performed on the object relational tree, the following steps may be included:
B1、查找到要删除的对象节点;B1, finding the object node to be deleted;
B2、从对象关系树中删除该节点;B2. Delete the node from the object relational tree;
B3、判断被删除的节点的父节点是否为虚拟对象节点或影子对象节点,如果是则执行步骤B4;否则结束本次删除操作。B3. Determine whether the parent node of the deleted node is a virtual object node or a shadow object node, and if so, execute step B4; otherwise, end the deletion operation.
B4、判断删除对象节点后,该虚拟对象节点或影子对象节点是否还有子节点,如果是,则结束本次删除操作,否则将该虚拟对象节点或影子对象节点作为待删除节点,返回步骤B2。B4. After judging whether the virtual object node or shadow object node has child nodes after the object node is deleted, if so, then end the deletion operation, otherwise, use the virtual object node or shadow object node as the node to be deleted, and return to step B2 .
所述查找对象节点的方法可以为:采取按照宽度优先的算法来查找,或采取按照深度优先的算法来查找,或采用建立索引的方法进行查找。The method for searching the object node may be: searching according to a breadth-first algorithm, or using a depth-first algorithm, or using an indexing method to search.
由上述的技术方案可见,本发明的这种对系统资源进行管理的实现方法,在建立对象关系树时,增加体现系统中各个设备之间的组关系的虚拟对象节点,在进行系统资源管理时,根据对象关系树上虚拟对象节点与实体对象节点的父子关系,查找到属于同一资源组的实体对象节点,进行操作。这样,如果系统资源对象和对象关系变化时,则只需修改对象关系树,不需要重新修改程序代码,降低了处理程序代码与具体的实体对象的相关性,方便了系统的维护和扩展。It can be seen from the above-mentioned technical solution that in the method for realizing the management of system resources in the present invention, when establishing the object relationship tree, virtual object nodes that reflect the group relationship between each device in the system are added, and when system resource management is performed, virtual object nodes are added. According to the parent-child relationship between the virtual object node and the entity object node on the object relational tree, the entity object node belonging to the same resource group is found, and the operation is performed. In this way, if the system resource object and the object relationship change, only the object relation tree needs to be modified, and the program code does not need to be re-modified, which reduces the correlation between the processing program code and the specific entity object, and facilitates the maintenance and expansion of the system.
另外,本发明还可以在建立对象关系树和增加新节点时,通过增加影子对象节点,解决固定扇出宽度带来的内存空间浪费的问题。In addition, the present invention can also solve the problem of waste of memory space caused by the fixed fan-out width by adding shadow object nodes when building an object relation tree and adding new nodes.
附图说明Description of drawings
图1为现有技术建立一个简单对象关系树的处理流程图;Fig. 1 is the processing flowchart of setting up a simple object relational tree for the prior art;
图2为采用图1所示流程建立的对象关系树示意图;Fig. 2 is a schematic diagram of an object relationship tree established by adopting the process shown in Fig. 1;
图3为本发明第一较佳实施例建立对象关系树的处理流程图;Fig. 3 is the processing flowchart of establishing object relation tree in the first preferred embodiment of the present invention;
图4为采用图3示流程建立的对象关系树示意图;Fig. 4 is a schematic diagram of the object relationship tree established by adopting the process shown in Fig. 3;
图5为对图3所示对象关系数据进行删除对象节点的处理流程图。FIG. 5 is a flowchart of the process of deleting an object node from the object relationship data shown in FIG. 3 .
图6为本发明第二较佳实施例中在对象关系树上增加对象节点的处理流程图;Fig. 6 is the processing flowchart of adding object nodes on the object relational tree in the second preferred embodiment of the present invention;
图7为采用图3和图6所示流程建立的对象关系树示意图。FIG. 7 is a schematic diagram of an object relationship tree established by using the processes shown in FIG. 3 and FIG. 6 .
具体实施方式Detailed ways
为使本发明的目的、技术方案及优点更加清楚明白,以下参照附图并举实施例,对本发明进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and examples.
本发明的这种对系统资源进行管理的实现方法,在建立对象关系树时,增加体现系统中各个设备之间的组关系的虚拟对象节点,在进行系统资源管理操作时,根据虚拟对象节点确定各个设备的实体对象节点之间的组关系。In the method for realizing the management of system resources in the present invention, when establishing the object relationship tree, add virtual object nodes that reflect the group relationship between each device in the system, and when performing system resource management operations, determine according to the virtual object nodes Group relationship between entity object nodes of individual devices.
以下举两个在对通信系统资源进行管理的较佳实施例对本发明进行详细说明。The present invention will be described in detail below with two preferred embodiments of managing communication system resources.
第一较佳实施例:First preferred embodiment:
本实施例中,预先存储了通信系统资源各个实体对象父子关系列表和对象组关系表,根据这两个表来建立对象关系树。以下将实体对象父子关系列表中的实体对象在对象关系树中对应的节点称为实体对象节点。In this embodiment, the parent-child relationship list and the object group relationship table of each entity object of the communication system resource are stored in advance, and the object relationship tree is established according to these two tables. Hereinafter, the node corresponding to the entity object in the entity object parent-child relationship list in the object relationship tree is referred to as the entity object node.
参见图3,图3为本发明第一较佳实施例建立对象关系树的处理流程图。该流程包括以下步骤:Referring to FIG. 3 , FIG. 3 is a flowchart of the process of establishing an object relational tree in the first preferred embodiment of the present invention. The process includes the following steps:
步骤301,读取实体对象父子关系列表的一个表项。
步骤302,判断该表项中的父实体对象节点是否已经在对象关系树上建立,如果是则执行步骤303;否则执行步骤304。
步骤303,在对象关系树上定位该父实体对象节点,执行步骤305。
步骤304,在对象关系树上,创建该父实体对象节点。Step 304, on the object relationship tree, create the parent entity object node.
步骤305,到对象组关系表中,查找该对象父子关系列表项中的子对象是否属于某个组,如果是则执行步骤306;否则执行步骤309。
步骤306,判断在对象关系树上,是否已建立该组的虚拟对象节点,如果是,则执行步骤308;否则执行步骤307。
本实施例中,为了区分虚拟对象节点和实体对象节点,在节点信息中加入标记,根据该标记来判断是否为虚拟对象节点。In this embodiment, in order to distinguish the virtual object node from the physical object node, a mark is added to the node information, and whether it is a virtual object node is judged according to the mark.
节点信息中通常包括3类信息:Node information usually includes 3 types of information:
(1)对象节点的基本信息;如对象节点的基本定位参数;(1) The basic information of the object node; such as the basic positioning parameters of the object node;
(2)对象节点的状态信息;用于刻画对象节点的状态信息;(2) The state information of the object node; used to describe the state information of the object node;
(3)对象节点的节点关系信息,体现节点之间的基本关系;(3) The node relationship information of the object node, reflecting the basic relationship between nodes;
第1类信息对给定对象节点来说,是对象关系树中该节点区别于其它对象节点的关键信息,因此不能动态修改这些信息,即这些信息一旦初始化完成,就不能再被修改;第3类信息一般由对象节点自身按照一定的规则来维护,其体现的是对象之间的关系信息;For a given object node, the first type of information is the key information that distinguishes this node from other object nodes in the object relational tree, so this information cannot be dynamically modified, that is, once the information is initialized, it cannot be modified; the third Class information is generally maintained by the object node itself according to certain rules, which reflects the relationship information between objects;
第2类信息,反映的是对象节点运行过程中的一些状态,这些信息随着对象自身情况的变化而变化;同时也依赖于上面的第3类信息,譬如当“组关系”不满足时,可以由此设置其直接父节点相应的状态。The second type of information reflects some states during the operation of the object node, which changes with the change of the object itself; it also depends on the above third type of information, for example, when the "group relationship" is not satisfied, You can thus set the corresponding state of its immediate parent node.
对于实体对象节点、虚拟对象节点而言,两者之间在信息处理上没有什么差异。For entity object nodes and virtual object nodes, there is no difference in information processing between the two.
本实施例中是在节点信息中专门增加一个标志,表明对象节点类型。譬如在节点中标志取值分别对应:0-实体对象节点类型;1-虚拟对象节点类型。In this embodiment, a flag is specially added in the node information to indicate the object node type. For example, the flag values in the nodes correspond to: 0-entity object node type; 1-virtual object node type.
步骤307,在对象关系树上创建该组的虚拟对象节点。
步骤308,确定该虚拟对象节点为该表项中的子实体对象节点的父节点,建立父子关系,将子实体对象节点加入到对象关系树中,执行步骤310。
步骤309,确定该表项中的父实体对象节点为将该表项中的子实体对象节点的父节点,建立父子关系,将子实体对象节点加入到对象关系树中。
步骤310,判断是否所有表项都读取完,如果是,则对象关系树建立完成,结束流程;否则返回步骤301,读取下一个表项。
假设,通信系统资源各个实体对象的父子关系列表如表2所示,对象组关系表如表3所示。本实施例中,在建立实体对象的父子关系列表时,按照辈分顺序,将辈分高的父节点的表项设置在列表的前面。例如:假设A-a1-@的关系是A是a1的父节点,a1是@的父节点,在建立父子关系表格时,将A-a1的父子关系设置在在a1-@之前。这样,在建立树的过程中,就不会出现需要将@加入对象关系树,建立a1-@的父子关系时,A-a1的父子关系还没有建立的情形。
表2
表3 table 3
则根据上述两表建立的对象关系树如图4所示,图4为采用图3所示流程建立的对象关系树示意图。其中,节点A1-1和节点A1-2,就是体现组关系的虚拟对象节点。Then, the object relationship tree established according to the above two tables is shown in FIG. 4 , and FIG. 4 is a schematic diagram of the object relationship tree established by using the process shown in FIG. 3 . Among them, the node A1-1 and the node A1-2 are virtual object nodes reflecting the group relationship.
对增加了虚拟对象节点后的对象关系树的节点查找操作与现有技术相同,可以采取按照宽度优先的算法来查找,也可以采取按照深度优先的算法来查找,也可以采用建立索引的方法进行查找。The node search operation of the object relationship tree after the virtual object node is added is the same as the prior art, and can be searched according to the breadth-first algorithm, or can be searched according to the depth-first algorithm, or can be searched by the method of indexing find.
在实际应用中,假设某个组中的某个实体设备出故障,需要用同一组的其他实体设备完成该实体设备的功能,则需要查找到与故障设备对象节点属于同一组的实体对象节点进行配置等操作。In practical applications, assuming that a physical device in a certain group fails, and other physical devices in the same group need to be used to complete the function of the physical device, it is necessary to find the physical object node that belongs to the same group as the faulty device object node to perform configuration etc.
如果使用现有技术的方法,需要较复杂的程序代码来实现。而应用本发明方法,就很容易实现,只需先查找到故障设备的对象节点,再找到其父节点,如果该父节点为虚拟对象节点,则找到该虚拟对象节点其他的一个实体对象子节点即可。If the method in the prior art is used, more complicated program codes are needed to realize it. And apply the method of the present invention, just be easy to realize, only need first find out the object node of faulty equipment, then find its parent node, if this parent node is a virtual object node, then find another entity object child node of this virtual object node That's it.
对象关系树的节点删除的操作有一些改进,参见图5,图5为对图3所示对象关系数据进行删除对象节点的处理流程图。该流程包括以下步骤:There are some improvements in the node deletion operation of the object relational tree, see FIG. 5 , which is a flow chart of deleting object nodes for the object relational data shown in FIG. 3 . The process includes the following steps:
步骤501,查找到要删除的对象节点。
步骤502,从对象关系树中删除该节点。
本步骤同现有技术一样,如果删除的是带有子节点的父节点,则先删除该父节点的所有子节点,再删除该父节点;如果删除的是子节点,则直接删除即可。This step is the same as the prior art. If the deletion is a parent node with child nodes, first delete all child nodes of the parent node, and then delete the parent node; if the deletion is a child node, then delete it directly.
步骤503,判断被删除的节点的父节点是否为虚拟对象节点,如果是则执行步骤504;否则结束本次删除操作。
步骤504,判断删除该对象节点后,该虚拟对象节点是否还有其他子节点,如果是,则结束本次删除操作,否则执行步骤505。
步骤505,将该虚拟对象节点作为待删除节点,返回步骤502。
对象关系树的节点增加:先修改实体对象的父子关系列表,如果新增加的节点属于某个组,则同时修改对象组关系表,再按照该列表的父子关系和组关系,查找到该增加节点的父节点,参照图3所示建立对象关系树的流程,将该节点加入到对象关系树上。Adding nodes in the object relationship tree: first modify the parent-child relationship list of the entity object, if the newly added node belongs to a certain group, then modify the object group relationship table at the same time, and then find the added node according to the parent-child relationship and group relationship of the list The parent node of the node is added to the object relational tree with reference to the process of establishing the object relational tree shown in FIG. 3 .
第二较佳实施例:Second preferred embodiment:
本实施例中,为了解决扇出宽度受限的问题,在对象关系树中,除了增加虚拟对象节点外,还增加影子对象节点。In this embodiment, in order to solve the problem of limited fan-out width, in the object relational tree, in addition to adding virtual object nodes, shadow object nodes are also added.
在建立对象关系树过程中,根据扇出宽度需要,可以增加影子对象节点;同样,在对象关系树建立好后,需要增加新的实体对象节点时,根据扇出宽度需要,也可以增加影子对象节点。In the process of building the object relationship tree, shadow object nodes can be added according to the fan-out width requirements; similarly, after the object relationship tree is established, when new entity object nodes need to be added, shadow objects can also be added according to the fan-out width requirements node.
本实施例是对第一较佳实施例的改进。具体来说,就是对在图3所示流程中的步骤308和步骤309中,确定要增加的子节点的父节点后,将子节点加入到对象关系树前,增加了是否增加影子对象节点的处理。具体过程参见图6,图6为本发明第二较佳实施例中在对象关系树上增加对象节点的处理流程图。该流程包括以下:This embodiment is an improvement on the first preferred embodiment. Specifically, in
步骤601,确定要增加的对象节点的父节点。
步骤602,判断该父节点的扇出宽度是否已达到了预定限度k;如果是则执行步骤604;否则执行步骤603。
父节点的扇出宽度就是该父节点的子节点的个数。The fan-out width of a parent node is the number of child nodes of the parent node.
步骤603,确定该父节点为要增加的对象节点的父节点,建立父子关系,将对象节点加入到对象关系树中,完成加入操作。
步骤604,将该父节点加入到宽度优先遍历队列中。该队列为先入先出队列。
本实施例中,采用宽度优先的遍历算法,遍历子节点。该算法是一种常用的遍历方法,本实施例按照该算法执行,这里不再详细描述该算法。In this embodiment, a breadth-first traversal algorithm is used to traverse child nodes. This algorithm is a commonly used traversal method, and this embodiment is implemented according to this algorithm, and the algorithm will not be described in detail here.
步骤605,取出队列中第一个对象节点,采用宽度优先的遍历算法遍历其子节点。
步骤606,判断是否找到一个扇出宽度<k的影子对象节点,如果是则执行步骤607;否则执行步骤608。
本实施例中也可以在节点信息中专门增加一个标志,表明对象节点类型。譬如在节点中标志取值分别对应:In this embodiment, a flag can also be specially added to the node information to indicate the type of the object node. For example, the flag values in the node correspond to:
0-实体对象节点类型;0 - entity object node type;
1-虚拟对象节点类型;1- virtual object node type;
2-影子对象节点类型。2-Shadow object node type.
另外,还可以对对象节点类型编号采取分区段的方法。各区段的大小,不作约定,按照预计各区段的实际可能使用比例来分配。譬如,在采用32bit数据来表征类型号,实体对象节点、虚拟对象节点、影子对象节点按照预计使用比例为4∶2∶2。考虑到可扩展性,将最高位为1的所有编号先保留,即可进行如下分配:In addition, it is also possible to adopt a segmented approach to the object node type number. There is no agreement on the size of each section, and it is allocated according to the estimated actual possible usage ratio of each section. For example, when 32bit data is used to represent the type number, the expected use ratio of entity object nodes, virtual object nodes, and shadow object nodes is 4:2:2. Considering scalability, all numbers with the highest bit of 1 are reserved first, and the following allocation can be performed:
0xFFFFFFF0~0xFFFFFFFF 系统用于特殊定义0xFFFFFFF0~0xFFFFFFFF The system is used for special definition
0x80FFFFFF~0xFFFFFFEF 保留0x80FFFFFF~0xFFFFFFEF reserved
0x60FFFFFF~0x7FFFFFEF 用于影子对象节点的分配0x60FFFFFF~0x7FFFFEF Used for allocation of shadow object nodes
0x40FFFFFF~0x5FFFFFEF 用于虚拟对象节点的分配0x40FFFFFF~0x5FFFFEF Used for the allocation of virtual object nodes
0x00FFFFFF~0x3FFFFFEF 用于实体对象节点的分配0x00FFFFFF~0x3FFFFFEF for the allocation of entity object nodes
当然,第一较佳实施例中,也可以采用对对象节点类型编号采取分区段的方法。Of course, in the first preferred embodiment, the method of segmenting object node type numbers may also be adopted.
步骤607,将要加入的对象节点作为该影子对象的子节点,加入对象关系树,完成加入操作。In
步骤608,判断是否找到一个实体对象节点,如果是,则执行步骤609;否则执行步骤610。
步骤609,创建一个影子对象节点,拆除步骤608找到的实体对象节点与父节点的父子关系;将找到的实体对象节点和要加入的对象节点作为影子对象的子节点;再将影子对象节点作为上述父节点的子节点,建立与该父节点之间的父子关系;加入对象关系树,完成加入操作。
步骤610,将父节点的所有子节点,按宽度优先算法加入宽度优先遍历队列,返回步骤605。
假设,基站上行资源分左右半框,半框内以资源池方式工作;左右半框最大配置7块资源板。各个实体对象的父子关系列表如表4所示,对象组关系表如表5所示。
表4
表5 table 5
当限制对象树宽度为4时,按照本实施例的方法建立的对象关系树如图7所示。图7为采用图3和图6所示流程建立的对象关系树示意图。When the width of the restricted object tree is 4, the object relationship tree established according to the method of this embodiment is shown in FIG. 7 . FIG. 7 is a schematic diagram of an object relationship tree established by using the processes shown in FIG. 3 and FIG. 6 .
图7的节点中,A表示上行资源;A1,B1分别对应虚拟对象节点,分别表示左右半框的上行资源;A2,B2分别对应影子对象节点。Among the nodes in FIG. 7 , A represents uplink resources; A1 and B1 respectively correspond to virtual object nodes, respectively representing uplink resources in the left and right half boxes; A2 and B2 respectively correspond to shadow object nodes.
以左半框为例,加入A1的算法参见引入虚拟对象节点的算法;随后按照影子对象节点算法加入a1~a7对象节点,加入顺序为:Taking the left half frame as an example, the algorithm for adding A1 refers to the algorithm for introducing virtual object nodes; then add object nodes a1~a7 according to the shadow object node algorithm, and the order of adding is:
1、加入a1~a4;1. Add a1~a4;
2、加入a5时发现宽度受限,按照影子对象节点算法,找到a1并拆离其与A1的父子关系,加入A2影子对象节点,建立a1、a5与A2的父子关系;2. When a5 is added, it is found that the width is limited. According to the shadow object node algorithm, a1 is found and the parent-child relationship with A1 is separated, and the A2 shadow object node is added to establish the parent-child relationship between a1, a5 and A2;
3、加入a6、a7节点。3. Add nodes a6 and a7.
对增加了虚拟对象节点、影子对象节点后的对象关系树的节点查找操作与第一较佳实施例相同,这里不再重复说明。The node search operation for the object relation tree after adding virtual object nodes and shadow object nodes is the same as that of the first preferred embodiment, and will not be repeated here.
对象关系树的节点删除的操作与图5所示流程基本相同,只是在步骤503中,不仅需要判断是否为虚拟对象节点还要判断是否为影子对象节点,对于影子对象节点的后续处理与虚拟对象节点同样处理。The operation of deleting a node in the object relational tree is basically the same as that shown in Figure 5, except that in
对象关系树的节点增加:先修改实体对象的父子关系列表,如果新增加的节点属于某个组,则同时修改对象组关系表,再按照该列表的父子关系和组关系,查找到该增加节点的父节点,参照图3和图6所示流程,将该节点加入到对象关系树上。Adding nodes in the object relationship tree: first modify the parent-child relationship list of the entity object, if the newly added node belongs to a certain group, then modify the object group relationship table at the same time, and then find the added node according to the parent-child relationship and group relationship of the list The parent node of the node is added to the object relational tree with reference to the processes shown in FIG. 3 and FIG. 6 .
由上述的实施例可见,本发明的这种对系统资源进行管理的实现方法,降低了处理程序代码与具体的实体对象的相关性,方便了系统的维护和扩展。另外,本发明还可以在建立对象关系树和增加新节点时,通过增加影子对象节点,解决固定扇出宽度带来的内存空间浪费的问题。It can be seen from the above embodiments that the implementation method for managing system resources of the present invention reduces the correlation between processing program codes and specific entity objects, and facilitates system maintenance and expansion. In addition, the present invention can also solve the problem of waste of memory space caused by the fixed fan-out width by adding shadow object nodes when building an object relation tree and adding new nodes.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2005100987777A CN100383788C (en) | 2005-09-07 | 2005-09-07 | A Realization Method of System Resource Management |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2005100987777A CN100383788C (en) | 2005-09-07 | 2005-09-07 | A Realization Method of System Resource Management |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1851693A true CN1851693A (en) | 2006-10-25 |
| CN100383788C CN100383788C (en) | 2008-04-23 |
Family
ID=37133172
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB2005100987777A Expired - Fee Related CN100383788C (en) | 2005-09-07 | 2005-09-07 | A Realization Method of System Resource Management |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN100383788C (en) |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN100383789C (en) * | 2005-09-07 | 2008-04-23 | 华为技术有限公司 | A Realization Method of System Resource Management |
| CN101217763B (en) * | 2008-01-15 | 2011-11-30 | 中兴通讯股份有限公司 | An expanding device and method from logic tree to physical tree in fault analysis |
| CN103092889A (en) * | 2011-11-07 | 2013-05-08 | 阿里巴巴集团控股有限公司 | Determining method of entity object and establishing method and device of condition node tree |
| CN103186568A (en) * | 2011-12-28 | 2013-07-03 | 金蝶软件(中国)有限公司 | Method and system for accessing tree-structured data |
| WO2013190562A1 (en) * | 2012-06-22 | 2013-12-27 | Hewlett-Packard Development Company, L.P. | Optimal assignment of virtual machines and virtual disks using multiary tree |
| CN104217309A (en) * | 2014-09-25 | 2014-12-17 | 中国人民解放军信息工程大学 | Method and device for managing information objects of system resources |
| CN104901328A (en) * | 2015-05-21 | 2015-09-09 | 北京四方继保自动化股份有限公司 | Multi-terminal flexible DC control mode automatic identification method based on complex control network |
| CN102243660B (en) * | 2011-07-18 | 2017-07-07 | 中兴通讯股份有限公司 | A kind of data access method and equipment |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11503047B2 (en) | 2020-03-13 | 2022-11-15 | International Business Machines Corporation | Relationship-based conversion of cyber threat data into a narrative-like format |
| US12086261B2 (en) * | 2020-03-13 | 2024-09-10 | International Business Machines Corporation | Displaying cyber threat data in a narrative-like format |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7743074B1 (en) * | 2000-04-05 | 2010-06-22 | Microsoft Corporation | Context aware systems and methods utilizing hierarchical tree structures |
| US20020091819A1 (en) * | 2001-01-05 | 2002-07-11 | Daniel Melchione | System and method for configuring computer applications and devices using inheritance |
| CN100383789C (en) * | 2005-09-07 | 2008-04-23 | 华为技术有限公司 | A Realization Method of System Resource Management |
-
2005
- 2005-09-07 CN CNB2005100987777A patent/CN100383788C/en not_active Expired - Fee Related
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN100383789C (en) * | 2005-09-07 | 2008-04-23 | 华为技术有限公司 | A Realization Method of System Resource Management |
| CN101217763B (en) * | 2008-01-15 | 2011-11-30 | 中兴通讯股份有限公司 | An expanding device and method from logic tree to physical tree in fault analysis |
| CN102243660B (en) * | 2011-07-18 | 2017-07-07 | 中兴通讯股份有限公司 | A kind of data access method and equipment |
| CN103092889A (en) * | 2011-11-07 | 2013-05-08 | 阿里巴巴集团控股有限公司 | Determining method of entity object and establishing method and device of condition node tree |
| CN103092889B (en) * | 2011-11-07 | 2016-01-06 | 阿里巴巴集团控股有限公司 | The defining method of entity object, the method for building up of condition node tree and device |
| CN103186568A (en) * | 2011-12-28 | 2013-07-03 | 金蝶软件(中国)有限公司 | Method and system for accessing tree-structured data |
| WO2013190562A1 (en) * | 2012-06-22 | 2013-12-27 | Hewlett-Packard Development Company, L.P. | Optimal assignment of virtual machines and virtual disks using multiary tree |
| CN104604187A (en) * | 2012-06-22 | 2015-05-06 | 惠普发展公司,有限责任合伙企业 | Optimal assignment of virtual machines and virtual disks using multiary tree |
| CN104217309A (en) * | 2014-09-25 | 2014-12-17 | 中国人民解放军信息工程大学 | Method and device for managing information objects of system resources |
| CN104901328A (en) * | 2015-05-21 | 2015-09-09 | 北京四方继保自动化股份有限公司 | Multi-terminal flexible DC control mode automatic identification method based on complex control network |
Also Published As
| Publication number | Publication date |
|---|---|
| CN100383788C (en) | 2008-04-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN100337235C (en) | Method and apparatus for accessing database | |
| CN1851693A (en) | Method for realizing system resources management | |
| CN105808323A (en) | Virtual machine creation method and system | |
| CN106897136A (en) | A kind of method for scheduling task and device | |
| CN1917504A (en) | Method for preventing deadlock caused by accessing shared data of resources | |
| CN1929451A (en) | Method and device for solving Hash collision | |
| CN1315045C (en) | A method for implementing centralized concurrent management to cluster | |
| CN1881931A (en) | Multicast forwarding route aggregating method | |
| CN1905523A (en) | Method for implementing multi-area stream classifying | |
| CN1719769A (en) | Method for classifying received data pocket in network apparatus | |
| CN1677946A (en) | Buffer distribution method and apparatus | |
| CN1155201C (en) | A method and system for data configuration of communication equipment | |
| CN1851694A (en) | Method for realizing system resources management | |
| CN1913692A (en) | Method for loading equipment software according to allocation | |
| CN1862534A (en) | Method for managing and maintaining tatic range matching table | |
| CN1704931A (en) | Method and apparatus for providing information inquiry by the network administration system | |
| CN1798092A (en) | Fast weighted polling dispatching method, and fast weighted polling despatcher and device | |
| CN1780254A (en) | Method for using buffer area in network processor | |
| CN1610326A (en) | Multicast Address Assignment Method | |
| CN1725707A (en) | Method for managing distributed network devices | |
| CN1862502A (en) | Method and system for implementing data back-up between main-standby nodes | |
| CN1315047C (en) | A management method for cluster operations | |
| CN1744744A (en) | Mobile terminal service quality parameter mapping method | |
| CN1878123A (en) | Bit-map aggregated recursive stream sorting method and its system | |
| CN1909510A (en) | Method and system for random packet interval sampling on network |
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 | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20080423 Termination date: 20170907 |
|
| CF01 | Termination of patent right due to non-payment of annual fee |