WO2016070564A1 - Method and apparatus for allocating resource identifiers in network management system - Google Patents

Method and apparatus for allocating resource identifiers in network management system Download PDF

Info

Publication number
WO2016070564A1
WO2016070564A1 PCT/CN2015/075861 CN2015075861W WO2016070564A1 WO 2016070564 A1 WO2016070564 A1 WO 2016070564A1 CN 2015075861 W CN2015075861 W CN 2015075861W WO 2016070564 A1 WO2016070564 A1 WO 2016070564A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
value
resource identifier
identifiers
identifier
Prior art date
Application number
PCT/CN2015/075861
Other languages
French (fr)
Chinese (zh)
Inventor
赵文斌
程江鹏
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016070564A1 publication Critical patent/WO2016070564A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/04Wireless resource allocation

Definitions

  • This paper relates to the field of communication technologies, and in particular, to a method and device for resource identifier allocation in a network management system.
  • the Packet Transport Network is a transport network suitable for packet services.
  • the service carried on the PTN tunnel pseudowire is its main transmission content and is also an important service deployment of the operator.
  • the network management system provides important protection and provides good human-machine interface operation for the PTN technology to be applied to the operator's deployment network.
  • multiple types of service resource identifiers are required to be uniformly configured (that is, unified coding is adopted). Therefore, when the network management system creates multiple types of services, the allocation of multiple types of service resource identifiers is generally as follows: resource identifiers are based on different device types. And the service type is automatically allocated. In the process of resource identifier allocation, the resource identifier-related array is generally generated according to the range supported by the service type, and the array is traversed according to a certain allocation algorithm, and the memory and time required for the resource identifier allocation processed by the network management system are used by the resource. The scope of the identity assignment is determined.
  • the method for allocating the resource identifier has the following disadvantages: 1. Although different types of services also support allocation of a large range of resource identifiers, the range that can be used is actually relatively small. Once the number of resource identifiers exceeds a certain value, the allocated data is allocated. The memory of a certain process of the NMS may be exhausted, causing the resource ID assignment to fail. 2. The fixed allocation of the full range of arrays in the network management system will waste a lot of memory space and consume allocation time, which is not conducive to the allocation of resource identifiers in a wide range. These shortcomings will make the performance of the network management system less stable, reliable and maintainable.
  • the embodiment of the invention provides a method and a device for allocating resource identifiers in a network management system, so as to solve the technical problem of how to avoid a small range of resource identification allocation of the network management system and a slow allocation.
  • the embodiment of the present invention provides a method for allocating resource identifiers in a network management system, and the method for allocating resource identifiers in the network management system includes the following steps:
  • the step of performing resource allocation of the service resource according to the quantity, the value range, and the used resource identifier includes:
  • the resource identifier is used as the allocated resource identifier until the number of the allocated resource identifiers reaches the value.
  • the resource identifiers starting from the random number to the maximum value of the value range and starting from the minimum value of the value range to the random number Comparing with the used resource identifier; if the resource identifier is different from the used resource identifier, the resource identifier is used as the allocated resource identifier until the number of allocated resource identifiers reaches the value
  • the quantities include:
  • the first resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value;
  • the second value between the random number and the random number is started.
  • the resource identifiers are compared one by one with the used resource identifiers;
  • the second resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
  • the method further includes:
  • the step of obtaining a value range of the resource identifier of the resource type supported by the system, and searching for all the used resource identifiers in the value range includes:
  • an embodiment of the present invention further provides an apparatus for allocating resource identifiers in a network management system, where the apparatus for allocating resource identifiers in the network management system includes:
  • the obtaining module is configured to obtain a resource type of the service resource to be allocated and a quantity of the resource identifier, and obtain a resource type supported by the system according to the resource type;
  • a search module configured to obtain a value range of the resource identifier of the resource type supported by the system, and find all the used resource identifiers in the value range;
  • the allocation module is configured to allocate the resource identifier to the service resource according to the value, the value range, and the used resource identifier.
  • the allocation module includes:
  • Generating a unit configured to generate a random number within the range of values
  • a comparison unit configured to set a resource identifier starting from the random number to a maximum value of the value range and starting from a minimum value of the value range to the random number The used resource identifier is compared;
  • an allocation unit configured to: if the resource identifier is different from the used resource identifier, use the resource identifier as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
  • the comparing unit includes a first comparing subunit and a second comparing subunit, where the allocating unit comprises a first assigning subunit and a second assigning subunit, wherein:
  • a first comparison subunit configured to compare a first resource identifier that starts from the random number to a maximum value of the value range, and compares the used resource identifiers one by one;
  • a first allocation subunit configured to: if the first resource identifier is different from the used resource identifier, use the first resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values;
  • a second comparison subunit configured to: if the number of resource identifiers allocated between the random number and the maximum value does not reach the value, the minimum value of the value range is used as a starting point Description Comparing the second resource identifiers between the random numbers to the used resource identifiers one by one;
  • a second allocation subunit configured to: if the second resource identifier is different from the used resource identifier, use the second resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values.
  • the allocating module further includes:
  • the prompting unit is configured to perform an abnormal prompt and exit if the number of allocated resource identifiers does not reach the value.
  • the searching module is configured to obtain service data that has been used by the resource type supported by the system, and obtain a corresponding resource identifier according to the service data.
  • an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the method described in any one of the foregoing.
  • a method and a device for allocating resource identifiers in a network management system according to an embodiment of the present invention.
  • a resource identifier is allocated in a network management system, the value of the resource type supported by the system and the used resource identifier are allocated to the required service resources.
  • the number of resource identifiers because only the memory space of the used resource identifiers is required to be applied, the allocation of the resource identifiers is too large to be allocated, the space occupied by the memory is greatly reduced, and the allocation speed is faster, and the network management system can be improved. Performance.
  • FIG. 1 is a schematic flowchart of a method for resource identifier allocation in a network management system according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a refinement process of an embodiment of allocating resource identifiers to the service resources according to the value, the value range, and the used resource identifiers;
  • FIG. 3 is a schematic diagram of a refinement process of another embodiment of the resource allocation of the service resource according to the value, the value range, and the used resource identifier;
  • FIG. 4 is a schematic diagram of functional modules of a device for resource identifier allocation in a network management system according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a refinement function module of an embodiment of the distribution module of FIG. 4;
  • FIG. 6 is a schematic diagram of a refinement function module of another embodiment of the distribution module of FIG. 4.
  • An embodiment of the present invention provides a method for allocating resource identifiers in a network management system.
  • a method for resource identifier allocation in the network management system includes:
  • step S101 the resource type of the service resource to be allocated and the value of the resource identifier are obtained, and the resource type supported by the system is obtained according to the resource type.
  • the value range of the resource identifiers of all types of service resources supported by the network management system is preset. Resource IDs are sorted during the assignment process. Assume that the network management system supports three types of service resources: A type, B type, and C type. The value ranges of the resource identifiers are 1-500, 100001-4000000, 20000001-100000000. These service resources and corresponding value ranges are preset in the network management system.
  • the value of the resource identifier of the service resource to be allocated is specified and input by the user, and may be any positive integer.
  • Step S102 Obtain a value range of the resource identifier of the resource type supported by the system, and search for all used resource identifiers in the value range.
  • the value range of the resource identifier of the resource type supported by the system is obtained. If the resource type supported by the system is A, the value ranges from 1 to 500.
  • the search for all used resource identifiers includes: querying data of each type of service (such as Ethernet service, ATM service, etc.), from the network management system.
  • each type of service such as Ethernet service, ATM service, etc.
  • the service that has used the identifier value of the resource type is queried, and if it is abnormal, it quits; if it is normal, the identification of the used service is calculated from the queried business data, and the resource identifier of the service is stripped out and generated.
  • a collection of resource identifiers which are then sorted to a collection of generated resource identifiers for later lookup operations.
  • Step S103 Perform resource element assignment on the service resource according to the value, the value range, and the used resource identifier.
  • the memory space of the used resource identifier is applied in the network management system, and the related binary tree search algorithm is used to compare the resource identifiers in the range of values with the used resource identifiers, and optionally in the range of values.
  • a resource identifier as a starting value can be a random value
  • the starting value is a used resource identifier
  • the starting value is +1
  • the value added by 1 is compared with the used resource identifier, if If this value is not found in the used resource ID, this value is the available resource ID, record this value, and continue searching for the next value until the user specifies the specified number of resource ID sets.
  • an exception prompt is displayed, prompting the user to fail to allocate a specified number of resource identifiers, that is, if the user requests to allocate 10 resource identifiers, but within a range of values.
  • the memory space of the array determined by the minimum to maximum range of the resource identifier is not required. If the minimum to maximum range of the resource identifier exceeds a certain value, the applied memory space may have hundreds of megabits, possibly The memory space of a certain process of the network management system is exhausted; in this embodiment, it is not necessary to apply for the memory space within the minimum to maximum range of the resource identifier, and only the memory space of the used resource identifier is required to be applied, and the memory space is generally very Smaller, only a few thousand bits, therefore, the memory usage of this embodiment is small and the allocation is faster.
  • the present embodiment allocates a certain number of resource identifiers according to the value range of the resource types supported by the system and the used resource identifiers. Applying for the memory space of the resource identifier is used. Therefore, the scope of the resource identifier cannot be allocated too much, and the space occupied by the memory is greatly reduced, and the allocation speed is faster, which can improve the performance of the network management system.
  • the foregoing step S103 includes:
  • Step S1031 Generate a random number in the range of values
  • Step S1032 starting with the random number and starting with the maximum value of the value range and starting with the minimum value of the value range to the resource identifier between the random number and the Has made Compare with resource identifiers;
  • Step S1033 If the resource identifier is different from the used resource identifier, the resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
  • a random number is generated, and the random number is greater than the minimum value and smaller than the maximum value.
  • the random number is assigned as the initial value of the allocation.
  • the starting value is compared with the used resource identifier. If the starting value is different from the used resource identifier, the starting value can be used for allocation and recording. , the starting value has been used, can not be used for allocation; then skip the starting value, and then compare until the number of allocated resource identifiers reaches the value.
  • the allocation may be performed between a random value and a maximum value, and then distributed between a minimum value and a random number, or first between a minimum value and a random number, and then at a random value to a maximum value. Assign values between values.
  • steps S1032 and S1033 include:
  • the first resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value;
  • the second value between the random number and the random number is started.
  • the resource identifiers are compared one by one with the used resource identifiers;
  • the second resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
  • the allocation between the random value and the maximum value, and then the best distribution between the minimum value and the random number can improve the hit rate of the allocation and achieve fast allocation.
  • the random number is assigned as the initial value of the allocation.
  • the starting value ie, the first resource identifier
  • the starting value is compared with the used resource identifier. If the starting value is different from the used resource identifier, the starting value is available. Assign, record, if the same, the starting value has been used, can not be used for allocation; then the starting value is +1, and then compared until the number of allocated resource identifiers reaches the value.
  • the value of the resource identifier of type A is 1-500
  • the random number is 301 of 1-500
  • 301 is used as the starting value of the subsequent operation.
  • the values are taken within this range, such as 301, 302, 303...500, and each value is compared with the used resource identifier, and then the next value needs to be increased by 1, ie 302, 302 is then compared to the used resource identifier.
  • the role of the random number in this embodiment is to avoid the following possible scenarios: if the minimum value is the initial value, if a resource identifier is assigned, and the resource identifier is sent to the device, the allocation is performed again. , the same resource identifier will be assigned, and the device will be given an error again, thus entering an infinite loop. If a random number is set, it is guaranteed that even if a certain resource identifier is sent to the device, the random number at the next allocation is different from the previous random number, so that the previously assigned resource identifier is skipped, thereby avoiding entering the dead. cycle.
  • the initial value is a random number
  • the pre-stored value when the resource identifier is allocated is not needed, and the query of the database is reduced, so that the allocation of the resource identifier can be accelerated, and the rapid allocation can be realized.
  • the value range needs to be changed, which may be from the minimum value range.
  • the value from the beginning to the random number ie, the second resource identifier
  • the minimum value is different from the used resource identifier, the minimum value can be used for allocation and recording. If they are the same, the minimum value has already been used and cannot be used for allocation; then the minimum value is +1 and then compared until the number of allocated resource identifiers reaches the value.
  • the resource identifier of type A is in the range of 1-500 and the random number is 301 in 1-500
  • the value is taken in 1-300. First, compare 1 with the used resource identifier, and then take the next one. The value needs to be increased by 1, ie 2, to compare 2 with the used resource identifier.
  • the foregoing step S103 further includes: step S1034, if the number of allocated resource identifiers does not reach the value. At the time, an exception prompt is given and exits.
  • the network management system When all the values in the range of values are still not obtained, the network management system directly performs an abnormal prompt and exits. If you need to obtain 400 resource identifiers in the range of 1 to 500, and the number of used resource identifiers exceeds 100, the network management system will throw an exception and exit.
  • An embodiment of the present invention further provides a device for allocating resource identifiers in a network management system.
  • the device for allocating resource identifiers in the network management system includes:
  • the obtaining module 101 is configured to obtain the resource type of the service resource to be allocated and the value of the resource identifier, and obtain the resource type supported by the system according to the resource type;
  • the value range of the resource identifiers of all types of service resources supported by the network management system is preset. Resource IDs are sorted during the assignment process. Assume that the network management system supports three types of service resources: A type, B type, and C type. The value ranges of the resource identifiers are 1-500, 100001-4000000, 20000001-100000000. These service resources and corresponding value ranges are preset in the network management system.
  • the value of the resource identifier of the service resource to be allocated is specified and input by the user, and may be any positive integer.
  • the search module 102 is configured to obtain a value range of the resource identifier of the resource type supported by the system, and find all the used resource identifiers in the value range.
  • the value range of the resource identifier of the resource type supported by the system is obtained. If the resource type supported by the system is A, the value ranges from 1 to 500.
  • the search for all used resource identifiers includes: querying data of each type of service (such as Ethernet service, ATM service, etc.), from the network management system.
  • each type of service such as Ethernet service, ATM service, etc.
  • the service that has used the identifier value of the resource type is queried, and if it is abnormal, it quits; if it is normal, the used service identifier is calculated from the queried business data, and the resource identifier of the service is stripped off, and the resource is generated.
  • a collection of identities and then sorts the collection of generated resource identities to facilitate later lookup operations.
  • the allocating module 103 is configured to allocate the resource identifier to the service resource according to the value, the value range, and the used resource identifier.
  • the memory space of the used resource identifier is applied in the network management system, and the related binary tree search algorithm is used to compare the resource identifiers in the range of values with the used resource identifiers, and optionally in the range of values.
  • a resource identifier is used as the starting value (can be a random value). If the starting value is the used resource identifier, the starting value is +1, and then the value after adding 1 is used with the used resource. The ID is compared. If the value is not found in the used resource ID, this value is the available resource ID. Record this value and continue searching for the next value until the user specifies the specified number of resource ID sets.
  • an exception prompt is displayed, prompting the user to fail to allocate a specified number of resource identifiers, that is, if the user requests to allocate 10 resource identifiers, but within a range of values.
  • the memory space of the array determined by the minimum to maximum range of the resource identifier is not required. If the minimum to maximum range of the resource identifier exceeds a certain value, the applied memory space may have hundreds of megabits, possibly The memory space of a certain process of the network management system is exhausted; in this embodiment, it is not necessary to apply for the memory space within the minimum to maximum range of the resource identifier, and only the memory space of the used resource identifier is required to be applied, and the memory space is generally very Smaller, only a few thousand bits, therefore, the memory usage of this embodiment is small and the allocation is faster.
  • the distribution module 103 includes:
  • the generating unit 1031 is configured to generate a random number within the value range
  • the comparing unit 1032 is configured to set the resource identifiers starting from the random number to the maximum value of the value range and starting from the minimum value of the value range to the random number Compare with the used resource identifier;
  • the allocating unit 1033 is configured to: if the resource identifier is different from the used resource identifier, use the resource identifier as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
  • a random number is generated, and the random number is greater than the minimum value and smaller than the maximum value.
  • the random number is assigned as the initial value of the allocation.
  • the starting value is compared with the used resource identifier. If the starting value is different from the used resource identifier, the starting value can be used for allocation and recording. , the starting value has been used, can not be used for allocation; then skip the starting value, and then compare until the number of allocated resource identifiers reaches the value.
  • the allocation can be performed between random values and maximum values, and then at the minimum value to The number of machines is allocated, or first between the minimum and the random number, and then between the random value and the maximum value.
  • the comparing unit 1032 includes a first comparing subunit and a second comparing subunit
  • the allocating unit 1033 includes a first assigning subunit and a second assigning subunit, wherein:
  • a first comparison subunit configured to compare a first resource identifier that starts from the random number to a maximum value of the value range, and compares the used resource identifiers one by one;
  • a first allocation subunit configured to: if the first resource identifier is different from the used resource identifier, use the first resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values;
  • a second comparison subunit configured to: if the number of resource identifiers allocated between the random number and the maximum value does not reach the value, the minimum value of the value range is used as a starting point Comparing the second resource identifiers between the random numbers to the used resource identifiers one by one;
  • a second allocation subunit configured to: if the second resource identifier is different from the used resource identifier, use the second resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values.
  • the random number is assigned as the initial value of the allocation.
  • the starting value ie, the first resource identifier
  • the starting value is compared with the used resource identifier. If the starting value is different from the used resource identifier, the starting value is available. Assign, record, if the same, the starting value has been used, can not be used for allocation; then the starting value is +1, and then compared until the number of allocated resource identifiers reaches the value.
  • the value of the resource identifier of type A is 1-500
  • the random number is 301 of 1-500
  • 301 is used as the starting value of the subsequent operation.
  • the values are taken within this range, such as 301, 302, 303...500, and each value is compared with the used resource identifier, and then the next value needs to be increased by 1, ie 302, 302 is then compared to the used resource identifier.
  • the role of the random number in this embodiment is to avoid the following possible scenarios: if the minimum value is the initial value, if a resource identifier is assigned, and the resource identifier is sent to the device, the allocation is performed again. , the same resource identifier will be assigned, and the device will be given an error again, thus entering an infinite loop. If a random number is set, it is guaranteed that even if a certain resource identifier is sent to the device, the random number at the next allocation is different from the previous random number, so that the previously assigned resource identifier is skipped, thereby avoiding entering the dead. cycle.
  • the initial value is a random number
  • the pre-stored value when the resource identifier is allocated is not needed, and the query of the database is reduced, so that the allocation of the resource identifier can be accelerated, and the rapid allocation can be realized.
  • the value range needs to be changed, which may be from the minimum value range.
  • the value from the beginning to the random number ie, the second resource identifier
  • the minimum value is different from the used resource identifier, the minimum value can be used for allocation and recording. If they are the same, the minimum value has already been used and cannot be used for allocation; then the minimum value is +1 and then compared until the number of allocated resource identifiers reaches the value.
  • the resource identifier of type A is in the range of 1-500 and the random number is 301 in 1-500
  • the value is taken in 1-300. First, compare 1 with the used resource identifier, and then take the next one. The value needs to be increased by 1, ie 2, to compare 2 with the used resource identifier.
  • the allocating module 103 further includes: a prompting unit, configured to: if the number of allocated resource identifiers does not reach the When the number of values is described, an exception prompt is issued and exits.
  • the network management system When all the values in the range of values are still not obtained, the network management system directly performs an abnormal prompt and exits. If you need to obtain 400 resource identifiers in the range of 1 to 500, and the number of used resource identifiers exceeds 100, the network management system will throw an exception and exit.
  • all or part of the steps of the foregoing embodiments may also be implemented by using an integrated circuit, and the steps may be separately fabricated into integrated circuit modules, or multiple modules thereof or The steps are made into a single integrated circuit module.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the foregoing technical solution avoids the problem that the resource identifier is too large to be allocated due to the resource identifier, and the space occupied by the memory is greatly reduced, and the allocation speed is faster, and the performance of the network management system can be improved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A method and apparatus for allocating resource identifiers in a network management system. The method for allocating resource identifiers in a network management system comprises the following steps: acquiring resource types of service resources to be allocated and the number of values of resource identifiers, and acquiring resource types supported by the system according to the resource types; acquiring a value range of resource identifiers of the resource types supported by the system, and searching for all used resource identifiers in the value range; and allocating resource identifiers for the service resources according to the number of values, the value range and the used resource identifiers. The technical solution can greatly reduce the occupied memory space and increase the allocation speed for resource identifier allocation in a large range.

Description

网管***中资源标识分配的方法及装置Method and device for resource identification allocation in network management system 技术领域Technical field
本文涉及通信技术领域,尤其涉及一种网管***中资源标识分配的方法及装置。This paper relates to the field of communication technologies, and in particular, to a method and device for resource identifier allocation in a network management system.
背景技术Background technique
分组传送网(Packet Transport Network,PTN)是一适合分组业务的传送网,承载于PTN隧道伪线之上的业务是其主要传送内容,也是运营商重要业务部署。The Packet Transport Network (PTN) is a transport network suitable for packet services. The service carried on the PTN tunnel pseudowire is its main transmission content and is also an important service deployment of the operator.
网管***为PTN技术更好地应用到运营商的部署网络中提供重要保障及提供良好的人机界面操作。目前,多种类型的业务资源标识要求进行统一配置(即采取统一编码),因此网管***在创建多类业务时,对多种类型的业务资源标识的分配一般如下:资源标识根据不同的设备类型及业务类型自动分配,资源标识分配过程中,一般根据业务类型支持的范围生成资源标识相关的数组,按一定的分配算法遍历此数组,网管***处理的资源标识分配所需要的内存及时间由资源标识分配的范围决定。The network management system provides important protection and provides good human-machine interface operation for the PTN technology to be applied to the operator's deployment network. At present, multiple types of service resource identifiers are required to be uniformly configured (that is, unified coding is adopted). Therefore, when the network management system creates multiple types of services, the allocation of multiple types of service resource identifiers is generally as follows: resource identifiers are based on different device types. And the service type is automatically allocated. In the process of resource identifier allocation, the resource identifier-related array is generally generated according to the range supported by the service type, and the array is traversed according to a certain allocation algorithm, and the memory and time required for the resource identifier allocation processed by the network management system are used by the resource. The scope of the identity assignment is determined.
上述资源标识分配的方法存在以下不足:1、虽然不同类型的业务也支持较大范围的资源标识的分配,但可使用的范围实际比较小,一旦资源标识的数量超过一定值,则分配的数据可能将网管***某一进程内存耗完,导致资源标识分配失败。2、网管***中采用固定分配全范围的数组会使得很多内存空间浪费且消耗分配时间,不利于大范围内的资源标识分配。这些不足都会使得网管***的稳定性、可靠性及可维护性等方面的性能较差。The method for allocating the resource identifier has the following disadvantages: 1. Although different types of services also support allocation of a large range of resource identifiers, the range that can be used is actually relatively small. Once the number of resource identifiers exceeds a certain value, the allocated data is allocated. The memory of a certain process of the NMS may be exhausted, causing the resource ID assignment to fail. 2. The fixed allocation of the full range of arrays in the network management system will waste a lot of memory space and consume allocation time, which is not conducive to the allocation of resource identifiers in a wide range. These shortcomings will make the performance of the network management system less stable, reliable and maintainable.
发明内容Summary of the invention
本发明实施例提供了一种网管***中资源标识分配的方法及装置,以解决如何避免网管***资源标识分配的范围小且分配慢的技术问题。The embodiment of the invention provides a method and a device for allocating resource identifiers in a network management system, so as to solve the technical problem of how to avoid a small range of resource identification allocation of the network management system and a slow allocation.
为实现上述目的,本发明实施例提供一种网管***中资源标识分配的方法,所述网管***中资源标识分配的方法包括以下步骤: To achieve the above objective, the embodiment of the present invention provides a method for allocating resource identifiers in a network management system, and the method for allocating resource identifiers in the network management system includes the following steps:
获取所需要分配的业务资源的资源类型及资源标识的取值数量,根据所述资源类型获取***支持的资源类型;Obtaining a resource type of the service resource to be allocated and a value of the resource identifier, and acquiring a resource type supported by the system according to the resource type;
获取所述***支持的资源类型的资源标识的取值范围,在所述取值范围中查找所有的已使用资源标识;Obtaining a value range of the resource identifier of the resource type supported by the system, and searching for all the used resource identifiers in the value range;
根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配。Allocating resource identifiers to the service resources according to the number of values, the range of values, and the used resource identifiers.
可选地,所述根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配的步骤包括:Optionally, the step of performing resource allocation of the service resource according to the quantity, the value range, and the used resource identifier includes:
在所述取值范围内生成一随机数;Generating a random number within the range of values;
将以所述随机数为起始至所述取值范围的最大值之间及以所述取值范围的最小值为起始至所述随机数之间的资源标识逐一与所述已使用资源标识进行比较;And the resource identifiers starting from the random number to the maximum value of the value range and starting from the minimum value of the value range to the random number one by one and the used resource Identification for comparison;
若所述资源标识与所述已使用资源标识不同,则将所述资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。If the resource identifier is different from the used resource identifier, the resource identifier is used as the allocated resource identifier until the number of the allocated resource identifiers reaches the value.
可选地,所述将以所述随机数为起始至所述取值范围的最大值之间及以所述取值范围的最小值为起始至所述随机数之间的资源标识逐一与所述已使用资源标识进行比较;若所述资源标识与所述已使用资源标识不同,则将所述资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量包括:Optionally, the resource identifiers starting from the random number to the maximum value of the value range and starting from the minimum value of the value range to the random number Comparing with the used resource identifier; if the resource identifier is different from the used resource identifier, the resource identifier is used as the allocated resource identifier until the number of allocated resource identifiers reaches the value The quantities include:
将以所述随机数为起始至所述取值范围的最大值之间的第一资源标识逐一与所述已使用资源标识进行比较;And comparing, by the random number, a first resource identifier between a maximum value of the value range and the used resource identifier;
若所述第一资源标识与所述已使用资源标识不同,则将所述第一资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量;If the first resource identifier is different from the used resource identifier, the first resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value;
若在所述随机数至最大值之间所分配的资源标识的数量未达到所述取值数量时,将以所述取值范围的最小值为起始至所述随机数之间的第二资源标识逐一与所述已使用资源标识进行比较;If the number of resource identifiers allocated between the random number and the maximum value does not reach the value, the second value between the random number and the random number is started. The resource identifiers are compared one by one with the used resource identifiers;
若所述第二资源标识与所述已使用资源标识不同,则将所述第二资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。And if the second resource identifier is different from the used resource identifier, the second resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
可选地,所述方法还包括:Optionally, the method further includes:
若所分配的资源标识的数量未达到所述取值数量时,进行异常提示并退 出。If the number of allocated resource identifiers does not reach the value, perform an exception prompt and retreat Out.
可选地,获取所述***支持的资源类型的资源标识的取值范围,在所述取值范围中查找所有的已使用资源标识的步骤包括:Optionally, the step of obtaining a value range of the resource identifier of the resource type supported by the system, and searching for all the used resource identifiers in the value range includes:
获取所述***支持的资源类型已经使用的业务数据,根据所述业务数据获取对应的资源标识。Obtaining the service data that has been used by the resource type supported by the system, and acquiring the corresponding resource identifier according to the service data.
此外,为实现上述目的,本发明实施例还提供一种网管***中资源标识分配的装置,所述网管***中资源标识分配的装置包括:In addition, in order to achieve the above object, an embodiment of the present invention further provides an apparatus for allocating resource identifiers in a network management system, where the apparatus for allocating resource identifiers in the network management system includes:
获取模块,设置为获取所需要分配的业务资源的资源类型及资源标识的取值数量,根据所述资源类型获取***支持的资源类型;The obtaining module is configured to obtain a resource type of the service resource to be allocated and a quantity of the resource identifier, and obtain a resource type supported by the system according to the resource type;
查找模块,设置为获取所述***支持的资源类型的资源标识的取值范围,在所述取值范围中查找所有的已使用资源标识;a search module, configured to obtain a value range of the resource identifier of the resource type supported by the system, and find all the used resource identifiers in the value range;
分配模块,设置为根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配。The allocation module is configured to allocate the resource identifier to the service resource according to the value, the value range, and the used resource identifier.
可选地,所述分配模块包括:Optionally, the allocation module includes:
生成单元,设置为在所述取值范围内生成一随机数;Generating a unit, configured to generate a random number within the range of values;
比较单元,设置为将以所述随机数为起始至所述取值范围的最大值之间及以所述取值范围的最小值为起始至所述随机数之间的资源标识逐一与所述已使用资源标识进行比较;a comparison unit, configured to set a resource identifier starting from the random number to a maximum value of the value range and starting from a minimum value of the value range to the random number The used resource identifier is compared;
分配单元,设置为若所述资源标识与所述已使用资源标识不同,则将所述资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。And an allocation unit, configured to: if the resource identifier is different from the used resource identifier, use the resource identifier as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
可选地,所述比较单元包括第一比较子单元及第二比较子单元,所述分配单元包括第一分配子单元及第二分配子单元,其中:Optionally, the comparing unit includes a first comparing subunit and a second comparing subunit, where the allocating unit comprises a first assigning subunit and a second assigning subunit, wherein:
第一比较子单元,设置为将以所述随机数为起始至所述取值范围的最大值之间的第一资源标识逐一与所述已使用资源标识进行比较;a first comparison subunit, configured to compare a first resource identifier that starts from the random number to a maximum value of the value range, and compares the used resource identifiers one by one;
第一分配子单元,设置为若所述第一资源标识与所述已使用资源标识不同,则将所述第一资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量;a first allocation subunit, configured to: if the first resource identifier is different from the used resource identifier, use the first resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values;
第二比较子单元,设置为若在所述随机数至最大值之间所分配的资源标识的数量未达到所述取值数量时,将以所述取值范围的最小值为起始至所述 随机数之间的第二资源标识逐一与所述已使用资源标识进行比较;a second comparison subunit, configured to: if the number of resource identifiers allocated between the random number and the maximum value does not reach the value, the minimum value of the value range is used as a starting point Description Comparing the second resource identifiers between the random numbers to the used resource identifiers one by one;
第二分配子单元,设置为若所述第二资源标识与所述已使用资源标识不同,则将所述第二资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。a second allocation subunit, configured to: if the second resource identifier is different from the used resource identifier, use the second resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values.
可选地,所述分配模块还包括:Optionally, the allocating module further includes:
提示单元,设置为若所分配的资源标识的数量未达到所述取值数量时,进行异常提示并退出。The prompting unit is configured to perform an abnormal prompt and exit if the number of allocated resource identifiers does not reach the value.
可选地,所述查找模块是设置为获取所述***支持的资源类型已经使用的业务数据,根据所述业务数据获取对应的资源标识。Optionally, the searching module is configured to obtain service data that has been used by the resource type supported by the system, and obtain a corresponding resource identifier according to the service data.
此外,为实现上述目的,本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述任一项所述的方法。In addition, in order to achieve the above object, an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the method described in any one of the foregoing.
本发明实施例一种网管***中资源标识分配的方法及装置,在网管***中分配资源标识时,根据***支持的资源类型的取值范围及已使用资源标识为所需要分配的业务资源分配一定数量的资源标识,由于只需要申请已使用资源标识的内存空间,因此不会因资源标识支持的范围过大而无法进行分配,大大减少内存占用的空间,且分配速度更快,能够提高网管***的性能。A method and a device for allocating resource identifiers in a network management system according to an embodiment of the present invention. When a resource identifier is allocated in a network management system, the value of the resource type supported by the system and the used resource identifier are allocated to the required service resources. The number of resource identifiers, because only the memory space of the used resource identifiers is required to be applied, the allocation of the resource identifiers is too large to be allocated, the space occupied by the memory is greatly reduced, and the allocation speed is faster, and the network management system can be improved. Performance.
附图概述BRIEF abstract
图1为本发明实施例的网管***中资源标识分配的方法的流程示意图;1 is a schematic flowchart of a method for resource identifier allocation in a network management system according to an embodiment of the present invention;
图2为图1中根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配一实施例的细化流程示意图;2 is a schematic diagram of a refinement process of an embodiment of allocating resource identifiers to the service resources according to the value, the value range, and the used resource identifiers;
图3为图1中根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配另一实施例的细化流程示意图;FIG. 3 is a schematic diagram of a refinement process of another embodiment of the resource allocation of the service resource according to the value, the value range, and the used resource identifier;
图4为本发明实施例的网管***中资源标识分配的装置功能模块示意图;4 is a schematic diagram of functional modules of a device for resource identifier allocation in a network management system according to an embodiment of the present invention;
图5为图4中分配模块一实施例的细化功能模块示意图; 5 is a schematic diagram of a refinement function module of an embodiment of the distribution module of FIG. 4;
图6为图4中分配模块另一实施例的细化功能模块示意图。6 is a schematic diagram of a refinement function module of another embodiment of the distribution module of FIG. 4.
本发明的较佳实施方式Preferred embodiment of the invention
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明实施例提供一种网管***中资源标识分配的方法,参照图1,在该实施例中,该网管***中资源标识分配的方法包括:An embodiment of the present invention provides a method for allocating resource identifiers in a network management system. Referring to FIG. 1, in this embodiment, a method for resource identifier allocation in the network management system includes:
步骤S101,获取所需要分配的业务资源的资源类型及资源标识的取值数量,根据所述资源类型获取***支持的资源类型;In step S101, the resource type of the service resource to be allocated and the value of the resource identifier are obtained, and the resource type supported by the system is obtained according to the resource type.
本实施例中,预设置网管***所支持的所有类型的业务资源的资源标识的取值范围。资源标识在分配的过程中经过排序。假设本网管***支持的业务资源有三类,分别为A类型,B类型及C类型,它们的资源标识的取值范围分别为1-500,100001-4000000,20000001-100000000。将这些业务资源及对应的取值范围预置于网管***中。In this embodiment, the value range of the resource identifiers of all types of service resources supported by the network management system is preset. Resource IDs are sorted during the assignment process. Assume that the network management system supports three types of service resources: A type, B type, and C type. The value ranges of the resource identifiers are 1-500, 100001-4000000, 20000001-100000000. These service resources and corresponding value ranges are preset in the network management system.
获取所需要分配的业务资源的资源类型,判断网管***中是否有持该资源类型的业务资源。如果不是本网管***支持的资源类型,例如为D类型时,则直接退出分配。Obtain the resource type of the service resource to be allocated, and determine whether there is a service resource of the resource type in the network management system. If it is not the resource type supported by the network management system, for example, it is D type, it will directly exit the allocation.
本实施例中,所需要分配的业务资源的资源标识的取值数量为用户所指定并输入的,其可以为任意正整数。In this embodiment, the value of the resource identifier of the service resource to be allocated is specified and input by the user, and may be any positive integer.
步骤S102,获取所述***支持的资源类型的资源标识的取值范围,在所述取值范围中查找所有的已使用资源标识;Step S102: Obtain a value range of the resource identifier of the resource type supported by the system, and search for all used resource identifiers in the value range.
本实施例中,获取所述***支持的资源类型的资源标识的取值范围,如***支持的资源类型为A类型,其取值范围为1-500。In this embodiment, the value range of the resource identifier of the resource type supported by the system is obtained. If the resource type supported by the system is A, the value ranges from 1 to 500.
由于网管***中资源类型繁多,且同一类型下可能分别存储于不同的数据库表格,因此查找所有的已使用资源标识包括:查询每类业务(如以太网业务,ATM业务等)数据,从网管***的数据库中查询出此资源类型已经使用的标识值的业务,如果异常,则退出;如果正常,从查询出的业务数据中算出这些已使用的业务的标识,并剥离出业务的资源标识,生成资源标识的集合,然后对生成的资源标识的集合进行排序,以便于之后查找运算。 Because the network management system has many types of resources, and the same type may be stored in different database tables, the search for all used resource identifiers includes: querying data of each type of service (such as Ethernet service, ATM service, etc.), from the network management system. In the database, the service that has used the identifier value of the resource type is queried, and if it is abnormal, it quits; if it is normal, the identification of the used service is calculated from the queried business data, and the resource identifier of the service is stripped out and generated. A collection of resource identifiers, which are then sorted to a collection of generated resource identifiers for later lookup operations.
步骤S103,根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配。Step S103: Perform resource element assignment on the service resource according to the value, the value range, and the used resource identifier.
本实施例中,在网管***中申请已使用资源标识的内存空间,采用相关的二叉树搜索算法,将取值范围中的资源标识逐一与已使用资源标识进行比较,可选地将取值范围中的一资源标识作为起始值(可以是一随机值),如果此起始值为已使用资源标识,则起始值+1,再将加1后的值与已使用资源标识进行比较,如果已使用资源标识中未搜索到此值,则此值为可用的资源标识,将此值记录下来,并继续搜索查找下一值,直到查询到用户指定数目的资源标识集合。In this embodiment, the memory space of the used resource identifier is applied in the network management system, and the related binary tree search algorithm is used to compare the resource identifiers in the range of values with the used resource identifiers, and optionally in the range of values. a resource identifier as a starting value (can be a random value), if the starting value is a used resource identifier, the starting value is +1, and then the value added by 1 is compared with the used resource identifier, if If this value is not found in the used resource ID, this value is the available resource ID, record this value, and continue searching for the next value until the user specifies the specified number of resource ID sets.
另外,如果在此取值范围内还未查询到用户指定数目的资源标识,则进行异常提示,提示用户无法分配指定数目的资源标识,即如果用户要求分配10个资源标识,而取值范围内只有8个资源标识可用使用时,则最后用户得到的提示是无法分配足够多的资源标识。In addition, if the user-specified number of resource identifiers have not been queried within the range of values, an exception prompt is displayed, prompting the user to fail to allocate a specified number of resource identifiers, that is, if the user requests to allocate 10 resource identifiers, but within a range of values When only 8 resource identifiers are available for use, the last user gets a hint that it is not possible to allocate enough resource identifiers.
本实施例中,不需要申请由资源标识的最小到最大值范围决定的数组的内存空间,如果资源标识的最小到最大值范围超出一定值时,申请的内存空间可能有上百兆比特,可能会将网管***的某一进程内存空间耗尽;而本实施例无须申请资源标识的最小到最大值范围内的内存空间,只需要申请已使用资源标识的内存空间即可,此内存空间一般很较小,只有几千比特,因此,本实施例内存占用小,分配更快。In this embodiment, the memory space of the array determined by the minimum to maximum range of the resource identifier is not required. If the minimum to maximum range of the resource identifier exceeds a certain value, the applied memory space may have hundreds of megabits, possibly The memory space of a certain process of the network management system is exhausted; in this embodiment, it is not necessary to apply for the memory space within the minimum to maximum range of the resource identifier, and only the memory space of the used resource identifier is required to be applied, and the memory space is generally very Smaller, only a few thousand bits, therefore, the memory usage of this embodiment is small and the allocation is faster.
与相关技术相比,本实施例在网管***中分配资源标识时,根据***支持的资源类型的取值范围及已使用资源标识为所需要分配的业务资源分配一定数量的资源标识,由于只需要申请已使用资源标识的内存空间,因此不会因资源标识支持的范围过大而无法进行分配,大大减少内存占用的空间,且分配速度更快,能够提高网管***的性能。Compared with the related art, when the resource identifier is allocated in the network management system, the present embodiment allocates a certain number of resource identifiers according to the value range of the resource types supported by the system and the used resource identifiers. Applying for the memory space of the resource identifier is used. Therefore, the scope of the resource identifier cannot be allocated too much, and the space occupied by the memory is greatly reduced, and the allocation speed is faster, which can improve the performance of the network management system.
在一可选的实施例中,如图2所示,在上述图1的实施例的基础上,上述步骤S103包括:In an optional embodiment, as shown in FIG. 2, based on the foregoing embodiment of FIG. 1, the foregoing step S103 includes:
步骤S1031,在所述取值范围内生成一随机数;Step S1031: Generate a random number in the range of values;
步骤S1032,将以所述随机数为起始至所述取值范围的最大值之间及以所述取值范围的最小值为起始至所述随机数之间的资源标识逐一与所述已使 用资源标识进行比较;Step S1032, starting with the random number and starting with the maximum value of the value range and starting with the minimum value of the value range to the resource identifier between the random number and the Has made Compare with resource identifiers;
步骤S1033,若所述资源标识与所述已使用资源标识不同,则将所述资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。Step S1033: If the resource identifier is different from the used resource identifier, the resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
本实施例中,根据***支持的资源类型的取值范围,以此取值范围的最小值及最大值为依据,生成随机数,该随机数大于最小值而小于最大值。In this embodiment, according to the value range of the resource type supported by the system, based on the minimum value and the maximum value of the value range, a random number is generated, and the random number is greater than the minimum value and smaller than the maximum value.
以随机数为分配的起始值进行分配,首先将起始值与已使用资源标识进行比较,如果起始值与已使用资源标识不同,则该起始值可用于分配,进行记录,如果相同,则该起始值已经被使用,不能用于分配;然后跳过该起始值,再进行比较,直至所分配的资源标识的数量达到取值数量。The random number is assigned as the initial value of the allocation. First, the starting value is compared with the used resource identifier. If the starting value is different from the used resource identifier, the starting value can be used for allocation and recording. , the starting value has been used, can not be used for allocation; then skip the starting value, and then compare until the number of allocated resource identifiers reaches the value.
本实施例可以先在随机值至最大值之间进行分配,然后再在最小值至随机数之间进行分配,或者先在在最小值至随机数之间进行分配,然后在在随机值至最大值之间进行分配。In this embodiment, the allocation may be performed between a random value and a maximum value, and then distributed between a minimum value and a random number, or first between a minimum value and a random number, and then at a random value to a maximum value. Assign values between values.
在一可选的实施例中,上述步骤S1032和S1033包括:In an optional embodiment, the foregoing steps S1032 and S1033 include:
将以所述随机数为起始至所述取值范围的最大值之间的第一资源标识逐一与所述已使用资源标识进行比较;And comparing, by the random number, a first resource identifier between a maximum value of the value range and the used resource identifier;
若所述第一资源标识与所述已使用资源标识不同,则将所述第一资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量;If the first resource identifier is different from the used resource identifier, the first resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value;
若在所述随机数至最大值之间所分配的资源标识的数量未达到所述取值数量时,将以所述取值范围的最小值为起始至所述随机数之间的第二资源标识逐一与所述已使用资源标识进行比较;If the number of resource identifiers allocated between the random number and the maximum value does not reach the value, the second value between the random number and the random number is started. The resource identifiers are compared one by one with the used resource identifiers;
若所述第二资源标识与所述已使用资源标识不同,则将所述第二资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。And if the second resource identifier is different from the used resource identifier, the second resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
其中,以先在随机值至最大值之间进行分配,然后再在最小值至随机数之间进行分配最佳,可以提高分配的命中率,达到快速分配。Among them, the allocation between the random value and the maximum value, and then the best distribution between the minimum value and the random number can improve the hit rate of the allocation and achieve fast allocation.
以随机数为分配的起始值进行分配,首先将起始值(即第一资源标识)与已使用资源标识进行比较,如果起始值与已使用资源标识不同,则该起始值可用于分配,进行记录,如果相同,则该起始值已经被使用,不能用于分配;然后将起始值+1,再进行比较,直至所分配的资源标识的数量达到取值数量。 The random number is assigned as the initial value of the allocation. First, the starting value (ie, the first resource identifier) is compared with the used resource identifier. If the starting value is different from the used resource identifier, the starting value is available. Assign, record, if the same, the starting value has been used, can not be used for allocation; then the starting value is +1, and then compared until the number of allocated resource identifiers reaches the value.
例如A类型的资源标识的取值范围为1-500,随机数为1-500中的301,将301做为之后运算的起始值。从随机数301开始,到500为止,在此范围内进行取值,如301,302,303……500,并将每个值与已使用资源标识进行比较,然后下个取值需要增加1,即302,将302再与已使用资源标识进行比较。For example, the value of the resource identifier of type A is 1-500, the random number is 301 of 1-500, and 301 is used as the starting value of the subsequent operation. Starting from the random number 301 and up to 500, the values are taken within this range, such as 301, 302, 303...500, and each value is compared with the used resource identifier, and then the next value needs to be increased by 1, ie 302, 302 is then compared to the used resource identifier.
本实施例的随机数的作用是为了避免以下可能存在的场景:如从最小值为起始值进行分配,如果分配了某一资源标识,而此资源标识下发到设备报错,再次进行分配时,则还将分配同一资源标识,再次下发设备还报错,这样进入死循环。而设置了随机数,则可保证即使即值某个资源标识下发至设备报错,但下次分配时的随机数与之前随机数不同,这样就跳过之前分配的资源标识,从而避免进入死循环。The role of the random number in this embodiment is to avoid the following possible scenarios: if the minimum value is the initial value, if a resource identifier is assigned, and the resource identifier is sent to the device, the allocation is performed again. , the same resource identifier will be assigned, and the device will be given an error again, thus entering an infinite loop. If a random number is set, it is guaranteed that even if a certain resource identifier is sent to the device, the random number at the next allocation is different from the previous random number, so that the previously assigned resource identifier is skipped, thereby avoiding entering the dead. cycle.
另外,本实施例由于起始值为随机数,不需要进行查询资源标识分配时的预存值,减少数据库的查询,可以加快资源标识的分配,实现快速分配。In addition, in this embodiment, since the initial value is a random number, the pre-stored value when the resource identifier is allocated is not needed, and the query of the database is reduced, so that the allocation of the resource identifier can be accelerated, and the rapid allocation can be realized.
本实施例中,如果从随机数至取值范围的最大值之间仍未能得到用户指定的资源标识的取值数量时,则需要更换取值范围,可以从取值范围的最小值为起始至随机数之间进行取值(即第二资源标识),首先将最小值与已使用资源标识进行比较,如果最小值与已使用资源标识不同,则该最小值可用于分配,进行记录,如果相同,则该最小值已经被使用,不能用于分配;然后将最小值+1,再进行比较,直至所分配的资源标识的数量达到取值数量。In this embodiment, if the number of values of the resource identifier specified by the user is not obtained from the random number to the maximum value of the value range, the value range needs to be changed, which may be from the minimum value range. The value from the beginning to the random number (ie, the second resource identifier) is first compared with the used resource identifier. If the minimum value is different from the used resource identifier, the minimum value can be used for allocation and recording. If they are the same, the minimum value has already been used and cannot be used for allocation; then the minimum value is +1 and then compared until the number of allocated resource identifiers reaches the value.
例如A类型的资源标识的取值范围为1-500,随机数为1-500中的301,则在1-300中进行取值,首先将1与已使用资源标识进行比较,然后下个取值需要增加1,即2,将2再与已使用资源标识进行比较。For example, if the resource identifier of type A is in the range of 1-500 and the random number is 301 in 1-500, the value is taken in 1-300. First, compare 1 with the used resource identifier, and then take the next one. The value needs to be increased by 1, ie 2, to compare 2 with the used resource identifier.
在一可选的实施例中,如图3所示,在上述图2的实施例的基础上,上述步骤S103还包括:步骤S1034,若所分配的资源标识的数量未达到所述取值数量时,进行异常提示并退出。In an optional embodiment, as shown in FIG. 3, on the basis of the foregoing embodiment of FIG. 2, the foregoing step S103 further includes: step S1034, if the number of allocated resource identifiers does not reach the value. At the time, an exception prompt is given and exits.
当比较完取值范围内的所有值仍未能得到用户指定的资源标识的取值数量时,则网管***直接进行异常提示且退出。如在取值范围1-500内需要获取400个资源标识,而已经使用的资源标识超过了100个,此时网管***会抛异常并退出。 When all the values in the range of values are still not obtained, the network management system directly performs an abnormal prompt and exits. If you need to obtain 400 resource identifiers in the range of 1 to 500, and the number of used resource identifiers exceeds 100, the network management system will throw an exception and exit.
本发明实施例还提供了一种网管***中资源标识分配的装置,如图4所示,在该实施例中,所述网管***中资源标识分配的装置包括:An embodiment of the present invention further provides a device for allocating resource identifiers in a network management system. As shown in FIG. 4, in this embodiment, the device for allocating resource identifiers in the network management system includes:
获取模块101,设置为获取所需要分配的业务资源的资源类型及资源标识的取值数量,根据所述资源类型获取***支持的资源类型;The obtaining module 101 is configured to obtain the resource type of the service resource to be allocated and the value of the resource identifier, and obtain the resource type supported by the system according to the resource type;
本实施例中,预设置网管***所支持的所有类型的业务资源的资源标识的取值范围。资源标识在分配的过程中经过排序。假设本网管***支持的业务资源有三类,分别为A类型,B类型及C类型,它们的资源标识的取值范围分别为1-500,100001-4000000,20000001-100000000。将这些业务资源及对应的取值范围预置于网管***中。In this embodiment, the value range of the resource identifiers of all types of service resources supported by the network management system is preset. Resource IDs are sorted during the assignment process. Assume that the network management system supports three types of service resources: A type, B type, and C type. The value ranges of the resource identifiers are 1-500, 100001-4000000, 20000001-100000000. These service resources and corresponding value ranges are preset in the network management system.
获取所需要分配的业务资源的资源类型,判断网管***中是否有持该资源类型的业务资源。如果不是本网管***支持的资源类型,例如为D类型时,则直接退出分配。Obtain the resource type of the service resource to be allocated, and determine whether there is a service resource of the resource type in the network management system. If it is not the resource type supported by the network management system, for example, it is D type, it will directly exit the allocation.
本实施例中,所需要分配的业务资源的资源标识的取值数量为用户所指定并输入的,其可以为任意正整数。In this embodiment, the value of the resource identifier of the service resource to be allocated is specified and input by the user, and may be any positive integer.
查找模块102,设置为获取所述***支持的资源类型的资源标识的取值范围,在所述取值范围中查找所有的已使用资源标识;The search module 102 is configured to obtain a value range of the resource identifier of the resource type supported by the system, and find all the used resource identifiers in the value range.
本实施例中,获取所述***支持的资源类型的资源标识的取值范围,如***支持的资源类型为A类型,其取值范围为1-500。In this embodiment, the value range of the resource identifier of the resource type supported by the system is obtained. If the resource type supported by the system is A, the value ranges from 1 to 500.
由于网管***中资源类型繁多,且同一类型下可能分别存储于不同的数据库表格,因此查找所有的已使用资源标识包括:查询每类业务(如以太网业务,ATM业务等)数据,从网管***的数据库中查询出此资源类型已经使用的标识值的业务,如果异常,则退出;如果正常,从查询出的业务数据中算出这些已使用的业务标识,并剥离出业务的资源标识,生成资源标识的集合,然后对生成的资源标识的集合进行排序,以便于之后查找运算。Because the network management system has many types of resources, and the same type may be stored in different database tables, the search for all used resource identifiers includes: querying data of each type of service (such as Ethernet service, ATM service, etc.), from the network management system. In the database, the service that has used the identifier value of the resource type is queried, and if it is abnormal, it quits; if it is normal, the used service identifier is calculated from the queried business data, and the resource identifier of the service is stripped off, and the resource is generated. A collection of identities, and then sorts the collection of generated resource identities to facilitate later lookup operations.
分配模块103,设置为根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配。The allocating module 103 is configured to allocate the resource identifier to the service resource according to the value, the value range, and the used resource identifier.
本实施例中,在网管***中申请已使用资源标识的内存空间,采用相关的二叉树搜索算法,将取值范围中的资源标识逐一与已使用资源标识进行比较,可选地将取值范围中的一资源标识作为起始值(可以是一随机值),如果此起始值为已使用资源标识,则起始值+1,再将加1后的值与已使用资源 标识进行比较,如果已使用资源标识中未搜索到此值,则此值为可用的资源标识,将此值记录下来,并继续搜索查找下一值,直到查询到用户指定数目的资源标识集合。In this embodiment, the memory space of the used resource identifier is applied in the network management system, and the related binary tree search algorithm is used to compare the resource identifiers in the range of values with the used resource identifiers, and optionally in the range of values. A resource identifier is used as the starting value (can be a random value). If the starting value is the used resource identifier, the starting value is +1, and then the value after adding 1 is used with the used resource. The ID is compared. If the value is not found in the used resource ID, this value is the available resource ID. Record this value and continue searching for the next value until the user specifies the specified number of resource ID sets.
另外,如果在此取值范围内还未查询到用户指定数目的资源标识,则进行异常提示,提示用户无法分配指定数目的资源标识,即如果用户要求分配10个资源标识,而取值范围内只有8个资源标识可用使用时,则最后用户得到的提示是无法分配足够多的资源标识。In addition, if the user-specified number of resource identifiers have not been queried within the range of values, an exception prompt is displayed, prompting the user to fail to allocate a specified number of resource identifiers, that is, if the user requests to allocate 10 resource identifiers, but within a range of values When only 8 resource identifiers are available for use, the last user gets a hint that it is not possible to allocate enough resource identifiers.
本实施例中,不需要申请由资源标识的最小到最大值范围决定的数组的内存空间,如果资源标识的最小到最大值范围超出一定值时,申请的内存空间可能有上百兆比特,可能会将网管***的某一进程内存空间耗尽;而本实施例无须申请资源标识的最小到最大值范围内的内存空间,只需要申请已使用资源标识的内存空间即可,此内存空间一般很较小,只有几千比特,因此,本实施例内存占用小,分配更快。In this embodiment, the memory space of the array determined by the minimum to maximum range of the resource identifier is not required. If the minimum to maximum range of the resource identifier exceeds a certain value, the applied memory space may have hundreds of megabits, possibly The memory space of a certain process of the network management system is exhausted; in this embodiment, it is not necessary to apply for the memory space within the minimum to maximum range of the resource identifier, and only the memory space of the used resource identifier is required to be applied, and the memory space is generally very Smaller, only a few thousand bits, therefore, the memory usage of this embodiment is small and the allocation is faster.
在一可选的实施例中,如图5所示,在上述图4的实施例的基础上,所述分配模块103包括:In an optional embodiment, as shown in FIG. 5, on the basis of the foregoing embodiment of FIG. 4, the distribution module 103 includes:
生成单元1031,设置为在所述取值范围内生成一随机数;The generating unit 1031 is configured to generate a random number within the value range;
比较单元1032,设置为将以所述随机数为起始至所述取值范围的最大值之间及以所述取值范围的最小值为起始至所述随机数之间的资源标识逐一与所述已使用资源标识进行比较;The comparing unit 1032 is configured to set the resource identifiers starting from the random number to the maximum value of the value range and starting from the minimum value of the value range to the random number Compare with the used resource identifier;
分配单元1033,设置为若所述资源标识与所述已使用资源标识不同,则将所述资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。The allocating unit 1033 is configured to: if the resource identifier is different from the used resource identifier, use the resource identifier as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
本实施例中,根据***支持的资源类型的取值范围,以此取值范围的最小值及最大值为依据,生成随机数,该随机数大于最小值而小于最大值。In this embodiment, according to the value range of the resource type supported by the system, based on the minimum value and the maximum value of the value range, a random number is generated, and the random number is greater than the minimum value and smaller than the maximum value.
以随机数为分配的起始值进行分配,首先将起始值与已使用资源标识进行比较,如果起始值与已使用资源标识不同,则该起始值可用于分配,进行记录,如果相同,则该起始值已经被使用,不能用于分配;然后跳过该起始值,再进行比较,直至所分配的资源标识的数量达到取值数量。The random number is assigned as the initial value of the allocation. First, the starting value is compared with the used resource identifier. If the starting value is different from the used resource identifier, the starting value can be used for allocation and recording. , the starting value has been used, can not be used for allocation; then skip the starting value, and then compare until the number of allocated resource identifiers reaches the value.
本实施例可以先在随机值至最大值之间进行分配,然后再在最小值至随 机数之间进行分配,或者先在在最小值至随机数之间进行分配,然后在在随机值至最大值之间进行分配。In this embodiment, the allocation can be performed between random values and maximum values, and then at the minimum value to The number of machines is allocated, or first between the minimum and the random number, and then between the random value and the maximum value.
在一可选的实施例中,比较单元1032包括第一比较子单元及第二比较子单元,分配单元1033包括第一分配子单元及第二分配子单元,其中:In an optional embodiment, the comparing unit 1032 includes a first comparing subunit and a second comparing subunit, and the allocating unit 1033 includes a first assigning subunit and a second assigning subunit, wherein:
第一比较子单元,设置为将以所述随机数为起始至所述取值范围的最大值之间的第一资源标识逐一与所述已使用资源标识进行比较;a first comparison subunit, configured to compare a first resource identifier that starts from the random number to a maximum value of the value range, and compares the used resource identifiers one by one;
第一分配子单元,设置为若所述第一资源标识与所述已使用资源标识不同,则将所述第一资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量;a first allocation subunit, configured to: if the first resource identifier is different from the used resource identifier, use the first resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values;
第二比较子单元,设置为若在所述随机数至最大值之间所分配的资源标识的数量未达到所述取值数量时,将以所述取值范围的最小值为起始至所述随机数之间的第二资源标识逐一与所述已使用资源标识进行比较;a second comparison subunit, configured to: if the number of resource identifiers allocated between the random number and the maximum value does not reach the value, the minimum value of the value range is used as a starting point Comparing the second resource identifiers between the random numbers to the used resource identifiers one by one;
第二分配子单元,设置为若所述第二资源标识与所述已使用资源标识不同,则将所述第二资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。a second allocation subunit, configured to: if the second resource identifier is different from the used resource identifier, use the second resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values.
以随机数为分配的起始值进行分配,首先将起始值(即第一资源标识)与已使用资源标识进行比较,如果起始值与已使用资源标识不同,则该起始值可用于分配,进行记录,如果相同,则该起始值已经被使用,不能用于分配;然后将起始值+1,再进行比较,直至所分配的资源标识的数量达到取值数量。The random number is assigned as the initial value of the allocation. First, the starting value (ie, the first resource identifier) is compared with the used resource identifier. If the starting value is different from the used resource identifier, the starting value is available. Assign, record, if the same, the starting value has been used, can not be used for allocation; then the starting value is +1, and then compared until the number of allocated resource identifiers reaches the value.
例如A类型的资源标识的取值范围为1-500,随机数为1-500中的301,将301做为之后运算的起始值。从随机数301开始,到500为止,在此范围内进行取值,如301,302,303……500,并将每个值与已使用资源标识进行比较,然后下个取值需要增加1,即302,将302再与已使用资源标识进行比较。For example, the value of the resource identifier of type A is 1-500, the random number is 301 of 1-500, and 301 is used as the starting value of the subsequent operation. Starting from the random number 301 and up to 500, the values are taken within this range, such as 301, 302, 303...500, and each value is compared with the used resource identifier, and then the next value needs to be increased by 1, ie 302, 302 is then compared to the used resource identifier.
本实施例的随机数的作用是为了避免以下可能存在的场景:如从最小值为起始值进行分配,如果分配了某一资源标识,而此资源标识下发到设备报错,再次进行分配时,则还将分配同一资源标识,再次下发设备还报错,这样进入死循环。而设置了随机数,则可保证即使即值某个资源标识下发至设备报错,但下次分配时的随机数与之前随机数不同,这样就跳过之前分配的资源标识,从而避免进入死循环。 The role of the random number in this embodiment is to avoid the following possible scenarios: if the minimum value is the initial value, if a resource identifier is assigned, and the resource identifier is sent to the device, the allocation is performed again. , the same resource identifier will be assigned, and the device will be given an error again, thus entering an infinite loop. If a random number is set, it is guaranteed that even if a certain resource identifier is sent to the device, the random number at the next allocation is different from the previous random number, so that the previously assigned resource identifier is skipped, thereby avoiding entering the dead. cycle.
另外,本实施例由于起始值为随机数,不需要进行查询资源标识分配时的预存值,减少数据库的查询,可以加快资源标识的分配,实现快速分配。In addition, in this embodiment, since the initial value is a random number, the pre-stored value when the resource identifier is allocated is not needed, and the query of the database is reduced, so that the allocation of the resource identifier can be accelerated, and the rapid allocation can be realized.
本实施例中,如果从随机数至取值范围的最大值之间仍未能得到用户指定的资源标识的取值数量时,则需要更换取值范围,可以从取值范围的最小值为起始至随机数之间进行取值(即第二资源标识),首先将最小值与已使用资源标识进行比较,如果最小值与已使用资源标识不同,则该最小值可用于分配,进行记录,如果相同,则该最小值已经被使用,不能用于分配;然后将最小值+1,再进行比较,直至所分配的资源标识的数量达到取值数量。In this embodiment, if the number of values of the resource identifier specified by the user is not obtained from the random number to the maximum value of the value range, the value range needs to be changed, which may be from the minimum value range. The value from the beginning to the random number (ie, the second resource identifier) is first compared with the used resource identifier. If the minimum value is different from the used resource identifier, the minimum value can be used for allocation and recording. If they are the same, the minimum value has already been used and cannot be used for allocation; then the minimum value is +1 and then compared until the number of allocated resource identifiers reaches the value.
例如A类型的资源标识的取值范围为1-500,随机数为1-500中的301,则在1-300中进行取值,首先将1与已使用资源标识进行比较,然后下个取值需要增加1,即2,将2再与已使用资源标识进行比较。For example, if the resource identifier of type A is in the range of 1-500 and the random number is 301 in 1-500, the value is taken in 1-300. First, compare 1 with the used resource identifier, and then take the next one. The value needs to be increased by 1, ie 2, to compare 2 with the used resource identifier.
在一可选的实施例中,如图6所示,在上述图5的实施例的基础上,所述分配模块103还包括:提示单元,设置为若所分配的资源标识的数量未达到所述取值数量时,进行异常提示并退出。In an optional embodiment, as shown in FIG. 6, on the basis of the foregoing embodiment of FIG. 5, the allocating module 103 further includes: a prompting unit, configured to: if the number of allocated resource identifiers does not reach the When the number of values is described, an exception prompt is issued and exits.
当比较完取值范围内的所有值仍未能得到用户指定的资源标识的取值数量时,则网管***直接进行异常提示且退出。如在取值范围1-500内需要获取400个资源标识,而已经使用的资源标识超过了100个,此时网管***会抛异常并退出。When all the values in the range of values are still not obtained, the network management system directly performs an abnormal prompt and exits. If you need to obtain 400 resource identifiers in the range of 1 to 500, and the number of used resource identifiers exceeds 100, the network management system will throw an exception and exit.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如***、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或 步骤制作成单个集成电路模块来实现。Optionally, all or part of the steps of the foregoing embodiments may also be implemented by using an integrated circuit, and the steps may be separately fabricated into integrated circuit modules, or multiple modules thereof or The steps are made into a single integrated circuit module.
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
工业实用性Industrial applicability
上述技术方案避免了因资源标识支持的范围过大而无法进行资源标识分配的问题,大大减少内存占用的空间,且分配速度更快,能够提高网管***的性能。 The foregoing technical solution avoids the problem that the resource identifier is too large to be allocated due to the resource identifier, and the space occupied by the memory is greatly reduced, and the allocation speed is faster, and the performance of the network management system can be improved.

Claims (11)

  1. 一种网管***中资源标识分配的方法,所述方法包括以下步骤:A method for resource identifier allocation in a network management system, the method comprising the following steps:
    获取所需要分配的业务资源的资源类型及资源标识的取值数量,根据所述资源类型获取***支持的资源类型;Obtaining a resource type of the service resource to be allocated and a value of the resource identifier, and acquiring a resource type supported by the system according to the resource type;
    获取所述***支持的资源类型的资源标识的取值范围,在所述取值范围中查找所有的已使用资源标识;Obtaining a value range of the resource identifier of the resource type supported by the system, and searching for all the used resource identifiers in the value range;
    根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配。Allocating resource identifiers to the service resources according to the number of values, the range of values, and the used resource identifiers.
  2. 如权利要求1所述的网管***中资源标识分配的方法,其中,所述根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配的步骤包括:The method for allocating resource identifiers in the network management system according to claim 1, wherein the step of assigning resource identifiers to the service resources according to the number of values, the range of values, and the used resource identifiers includes:
    在所述取值范围内生成一随机数;Generating a random number within the range of values;
    将以所述随机数为起始至所述取值范围的最大值之间及以所述取值范围的最小值为起始至所述随机数之间的资源标识逐一与所述已使用资源标识进行比较;And the resource identifiers starting from the random number to the maximum value of the value range and starting from the minimum value of the value range to the random number one by one and the used resource Identification for comparison;
    若所述资源标识与所述已使用资源标识不同,则将所述资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。If the resource identifier is different from the used resource identifier, the resource identifier is used as the allocated resource identifier until the number of the allocated resource identifiers reaches the value.
  3. 如权利要求2所述的网管***中资源标识分配的方法,其中,所述将以所述随机数为起始至所述取值范围的最大值之间及以所述取值范围的最小值为起始至所述随机数之间的资源标识逐一与所述已使用资源标识进行比较;若所述资源标识与所述已使用资源标识不同,则将所述资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量包括:The method for allocating resource identifiers in a network management system according to claim 2, wherein said starting from said random number to a maximum value of said range of values and a minimum value of said range of values Comparing the resource identifiers starting from the random number with the used resource identifiers one by one; if the resource identifiers are different from the used resource identifiers, using the resource identifiers as the allocated resource identifiers Until the number of allocated resource identifiers reaches the stated value, including:
    将以所述随机数为起始至所述取值范围的最大值之间的第一资源标识逐一与所述已使用资源标识进行比较;And comparing, by the random number, a first resource identifier between a maximum value of the value range and the used resource identifier;
    若所述第一资源标识与所述已使用资源标识不同,则将所述第一资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量;If the first resource identifier is different from the used resource identifier, the first resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value;
    若在所述随机数至最大值之间所分配的资源标识的数量未达到所述取值 数量时,将以所述取值范围的最小值为起始至所述随机数之间的第二资源标识逐一与所述已使用资源标识进行比较;If the number of resource identifiers allocated between the random number and the maximum value does not reach the value When the quantity is compared, the second resource identifier starting from the minimum value of the value range to the random number is compared with the used resource identifier one by one;
    若所述第二资源标识与所述已使用资源标识不同,则将所述第二资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。And if the second resource identifier is different from the used resource identifier, the second resource identifier is used as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
  4. 如权利要求2所述的网管***中资源标识分配的方法,其中,所述方法还包括:The method for allocating resource identifiers in a network management system according to claim 2, wherein the method further comprises:
    若所分配的资源标识的数量未达到所述取值数量时,进行异常提示并退出。If the number of allocated resource identifiers does not reach the value, the exception prompts and exits.
  5. 如权利要求1所述的网管***中资源标识分配的方法,其中,获取所述***支持的资源类型的资源标识的取值范围,在所述取值范围中查找所有的已使用资源标识的步骤包括:The method for allocating resource identifiers in a network management system according to claim 1, wherein the obtaining a range of resource identifiers of resource types supported by the system, and searching for all used resource identifiers in the value range include:
    获取所述***支持的资源类型已经使用的业务数据,根据所述业务数据获取对应的资源标识。Obtaining the service data that has been used by the resource type supported by the system, and acquiring the corresponding resource identifier according to the service data.
  6. 一种网管***中资源标识分配的装置,所述装置包括:A device for allocating resource identifiers in a network management system, the device comprising:
    获取模块,设置为获取所需要分配的业务资源的资源类型及资源标识的取值数量,根据所述资源类型获取***支持的资源类型;The obtaining module is configured to obtain a resource type of the service resource to be allocated and a quantity of the resource identifier, and obtain a resource type supported by the system according to the resource type;
    查找模块,设置为获取所述***支持的资源类型的资源标识的取值范围,在所述取值范围中查找所有的已使用资源标识;a search module, configured to obtain a value range of the resource identifier of the resource type supported by the system, and find all the used resource identifiers in the value range;
    分配模块,设置为根据所述取值数量、取值范围及已使用资源标识对所述业务资源进行资源标识的分配。The allocation module is configured to allocate the resource identifier to the service resource according to the value, the value range, and the used resource identifier.
  7. 如权利要求6所述的网管***中资源标识分配的装置,其中,所述分配模块包括:The apparatus for allocating resource identifiers in a network management system according to claim 6, wherein the allocation module comprises:
    生成单元,设置为在所述取值范围内生成一随机数;Generating a unit, configured to generate a random number within the range of values;
    比较单元,设置为将以所述随机数为起始至所述取值范围的最大值之间及以所述取值范围的最小值为起始至所述随机数之间的资源标识逐一与所述已使用资源标识进行比较; a comparison unit, configured to set a resource identifier starting from the random number to a maximum value of the value range and starting from a minimum value of the value range to the random number The used resource identifier is compared;
    分配单元,设置为若所述资源标识与所述已使用资源标识不同,则将所述资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。And an allocation unit, configured to: if the resource identifier is different from the used resource identifier, use the resource identifier as the allocated resource identifier, until the number of the allocated resource identifiers reaches the value.
  8. 如权利要求7所述的网管***中资源标识分配的装置,其中,所述比较单元包括第一比较子单元及第二比较子单元,所述分配单元包括第一分配子单元及第二分配子单元,其中:The apparatus for allocating resource identifiers in a network management system according to claim 7, wherein the comparing unit comprises a first comparing subunit and a second comparing subunit, the allocating unit comprising a first assigning subunit and a second assigning sub Unit, where:
    第一比较子单元,设置为将以所述随机数为起始至所述取值范围的最大值之间的第一资源标识逐一与所述已使用资源标识进行比较;a first comparison subunit, configured to compare a first resource identifier that starts from the random number to a maximum value of the value range, and compares the used resource identifiers one by one;
    第一分配子单元,设置为若所述第一资源标识与所述已使用资源标识不同,则将所述第一资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量;a first allocation subunit, configured to: if the first resource identifier is different from the used resource identifier, use the first resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values;
    第二比较子单元,设置为若在所述随机数至最大值之间所分配的资源标识的数量未达到所述取值数量时,将以所述取值范围的最小值为起始至所述随机数之间的第二资源标识逐一与所述已使用资源标识进行比较;a second comparison subunit, configured to: if the number of resource identifiers allocated between the random number and the maximum value does not reach the value, the minimum value of the value range is used as a starting point Comparing the second resource identifiers between the random numbers to the used resource identifiers one by one;
    第二分配子单元,设置为若所述第二资源标识与所述已使用资源标识不同,则将所述第二资源标识作为所分配的资源标识,直至所分配的资源标识的数量达到所述取值数量。a second allocation subunit, configured to: if the second resource identifier is different from the used resource identifier, use the second resource identifier as the allocated resource identifier, until the number of allocated resource identifiers reaches the The number of values.
  9. 如权利要求7所述的网管***中资源标识分配的装置,其中,所述分配模块还包括:The apparatus for allocating resource identifiers in a network management system according to claim 7, wherein the distribution module further comprises:
    提示单元,设置为若所分配的资源标识的数量未达到所述取值数量时,进行异常提示并退出。The prompting unit is configured to perform an abnormal prompt and exit if the number of allocated resource identifiers does not reach the value.
  10. 如权利要求6所述的网管***中资源标识分配的装置,其中,The apparatus for allocating resource identifiers in a network management system according to claim 6, wherein
    所述查找模块,是设置为获取所述***支持的资源类型已经使用的业务数据,根据所述业务数据获取对应的资源标识。The search module is configured to obtain service data that has been used by the resource type supported by the system, and obtain a corresponding resource identifier according to the service data.
  11. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1~5中任一项所述的方法。 A computer storage medium having stored therein computer executable instructions for performing the method of any one of claims 1 to 5.
PCT/CN2015/075861 2014-11-05 2015-04-03 Method and apparatus for allocating resource identifiers in network management system WO2016070564A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410618049.3A CN105610593B (en) 2014-11-05 2014-11-05 Method and device for distributing resource identification in network management system
CN201410618049.3 2014-11-05

Publications (1)

Publication Number Publication Date
WO2016070564A1 true WO2016070564A1 (en) 2016-05-12

Family

ID=55908476

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/075861 WO2016070564A1 (en) 2014-11-05 2015-04-03 Method and apparatus for allocating resource identifiers in network management system

Country Status (2)

Country Link
CN (1) CN105610593B (en)
WO (1) WO2016070564A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302858A (en) * 2016-08-31 2017-01-04 郑州众智科技股份有限公司 A kind of method of unit parallel controller random assortment communication ID
CN108509535B (en) * 2018-03-15 2020-12-01 烽火通信科技股份有限公司 Resource ID management system and method based on interval
CN110245017B (en) * 2019-05-29 2024-03-26 华为技术有限公司 Resource identifier allocation method and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719793A (en) * 2004-07-08 2006-01-11 华为技术有限公司 Method for allocating channel resources
CN101291512A (en) * 2007-04-18 2008-10-22 华为技术有限公司 Downlink resource indicating method and device
US20100124215A1 (en) * 2008-11-14 2010-05-20 Kabushiki Kaisha Toshiba Transmitter, remote controller and transmission method
CN104125109A (en) * 2013-04-27 2014-10-29 ***通信集团山东有限公司 Method of determining network resource state and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102195957B (en) * 2010-03-19 2014-03-05 华为技术有限公司 Resource sharing method, device and system
CN102487382B (en) * 2010-12-02 2015-05-06 ***通信集团上海有限公司 Resource providing method, apparatus thereof and system thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719793A (en) * 2004-07-08 2006-01-11 华为技术有限公司 Method for allocating channel resources
CN101291512A (en) * 2007-04-18 2008-10-22 华为技术有限公司 Downlink resource indicating method and device
US20100124215A1 (en) * 2008-11-14 2010-05-20 Kabushiki Kaisha Toshiba Transmitter, remote controller and transmission method
CN104125109A (en) * 2013-04-27 2014-10-29 ***通信集团山东有限公司 Method of determining network resource state and device

Also Published As

Publication number Publication date
CN105610593A (en) 2016-05-25
CN105610593B (en) 2020-06-16

Similar Documents

Publication Publication Date Title
US10757106B2 (en) Resource access control method and device
CN107667503B (en) Resource management techniques for heterogeneous resource clouds
US10430332B2 (en) System and method for performance tuning of garbage collection algorithms
CN107241281B (en) Data processing method and device
US9699028B2 (en) Method and device for updating client
CN105045871B (en) Data aggregate querying method and device
WO2019019400A1 (en) Task distributed processing method, device, storage medium and server
CN106407207B (en) Real-time newly-added data updating method and device
US8843632B2 (en) Allocation of resources between web services in a composite service
CN104486129B (en) The method and system of application service quality are ensured under distributed environment
CN108600034B (en) Service pressure management method, device, equipment, system and storage medium
BR112017005646B1 (en) COMPOSITE PARTITION FUNCTIONS
CN111813805A (en) Data processing method and device
US10530845B1 (en) Shuffle sharded load balancing
CN104866339A (en) Distributed persistent management method, system and device of FOTA data
CN112016030B (en) Message pushing method, device, server and computer storage medium
US20040015976A1 (en) Optimized distributed resource management system with digital signature
WO2016070564A1 (en) Method and apparatus for allocating resource identifiers in network management system
JP2023089891A (en) Cluster capacity expansion method and device
CN110868435B (en) Bare metal server scheduling method and device and storage medium
CN111382206A (en) Data storage method and device
US10671636B2 (en) In-memory DB connection support type scheduling method and system for real-time big data analysis in distributed computing environment
WO2016078388A1 (en) Data aging method and apparatus
CN111078413A (en) Timed task execution method and device, computer equipment and storage medium
CN111008071A (en) Task scheduling system, method and server

Legal Events

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

Ref document number: 15857590

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15857590

Country of ref document: EP

Kind code of ref document: A1