CN108509535B - Resource ID management system and method based on interval - Google Patents

Resource ID management system and method based on interval Download PDF

Info

Publication number
CN108509535B
CN108509535B CN201810215053.3A CN201810215053A CN108509535B CN 108509535 B CN108509535 B CN 108509535B CN 201810215053 A CN201810215053 A CN 201810215053A CN 108509535 B CN108509535 B CN 108509535B
Authority
CN
China
Prior art keywords
resource
interval
value
manager
ending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810215053.3A
Other languages
Chinese (zh)
Other versions
CN108509535A (en
Inventor
李澍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN201810215053.3A priority Critical patent/CN108509535B/en
Priority to PCT/CN2018/103165 priority patent/WO2019174196A1/en
Publication of CN108509535A publication Critical patent/CN108509535A/en
Application granted granted Critical
Publication of CN108509535B publication Critical patent/CN108509535B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0246Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
    • H04L41/0266Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using meta-data, objects or commands for formatting management information, e.g. using eXtensible markup language [XML]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a resource ID management system and method based on intervals, and relates to the field of telecommunication transmission network management. The system comprises a resource ID manager, a database, a specification definition unit, a resource ID manager initialization unit and a resource ID management unit. The method comprises the following steps: defining a specification of the resource ID manager using an XML file; initializing a resource ID manager according to the XML file and interval data in the database; and managing the resource ID of the network element by using a resource ID manager, wherein the resource ID comprises the steps of acquiring the idle resource ID, allocating the resource ID and releasing the resource ID. The invention can effectively save the storage space of the resource ID and reduce the allocation time of the resource ID.

Description

Resource ID management system and method based on interval
Technical Field
The invention relates to the field of telecommunication transmission network management, in particular to a resource ID management system and a resource ID management method based on intervals.
Background
In the telecommunication transmission network management, a telecommunication service needs to occupy certain resources on each network element passing through; the resources occupied by different telecommunication services on the same network element cannot conflict with each other. To meet the above requirements, the network element needs to manage resources, and allocate a resource ID: a network element supports a plurality of different types of resources; the different types of resource IDs may be repeated on one network element; the same type of resource ID is not repeatable on one network element. The network element records the resource ID occupied by each telecommunication service, so that the resource IDs occupied by different telecommunication services on the same network element are different, and no conflict is generated; the network element may also distinguish between different telecommunications services according to the resource ID.
When a resource ID of a certain type is allocated in the existing ID management method, in order to ensure that the resource ID does not conflict with the resource ID of the type occupied by the telecommunication service, all resource IDs of the type recorded on the network element need to be traversed. When the number of the resource IDs of the type on the network element is huge, the space for storing the resource IDs is increased, the time consumed for allocating the resource IDs is increased, and the direct proportion relation is formed between the time consumed for allocating the resource IDs and the number of the resource IDs. Under such circumstances, it is very important to design a new ID management method to satisfy the efficiency of storing and allocating a large number of resource IDs.
Disclosure of Invention
The present invention is directed to overcome the above drawbacks of the background art, and provides a resource ID management system and method based on intervals, which can effectively save the storage space of resource IDs and reduce the allocation time of resource IDs.
The invention provides a resource ID management system based on an interval, which comprises a specification definition unit, a resource ID manager initialization unit and a resource ID management unit, wherein:
the specification defining unit is used for: define the specification of the resource ID manager using an extensible markup language XML file: the XML file defines a plurality of network element types, each network element type comprises a plurality of resource types, and each resource type defines the minimum value and the maximum value of a resource ID;
the database stores interval data of the resource ID manager, the interval represents the range of the used resource ID, and the interval consists of a starting value and an ending value; the resource ID manager comprises a list of intervals, and the intervals are connected end to end according to the sequence of the starting value and the ending value from small to large;
the resource ID manager initialization unit is to: initializing a resource ID manager according to the XML file and interval data in the database;
the resource ID management unit is used for: and managing the resource ID of the network element by using a resource ID manager, wherein the resource ID comprises the steps of acquiring the idle resource ID, allocating the resource ID and releasing the resource ID.
On the basis of the above technical solution, initializing the resource ID manager means: reading network element data from a database, and initializing a resource ID manager of each network element, wherein the method specifically comprises the following steps:
b1, traversing all network elements in the database, and turning to the step B2;
b2, judging whether the type of the current network element is defined in the XML file, if so, going to step B3, otherwise, returning to step B1;
b3, obtaining the specifications of a plurality of resource ID managers corresponding to the type of the current network element from the XML file, and turning to the step B4;
b4, initializing the minimum value and the maximum value of the resource ID according to the specification of the resource ID manager, and turning to the step B5;
b5, reading the interval data of the resource ID manager from the database, and turning to the step B6;
b6, if the starting value of the interval is smaller than the minimum value of the resource ID, or the ending value of the interval is larger than the maximum value of the resource ID, go to step B7, otherwise go to step B8;
b7, the initial value of the adjustment interval is the minimum value of the resource ID, or the end value of the adjustment interval is the maximum value of the resource ID, go to step B8;
b8, add the interval to the resource ID manager, and return to step B5.
On the basis of the above technical solution, the acquiring the idle resource ID means: starting from a given resource ID initial value, finding a specified number of idle resource IDs from small to large, and the specific steps are as follows:
c11, if the initial value of the given resource ID is less than the minimum value of the resource ID, setting the initial value of the given resource ID as the minimum value of the resource ID, and turning to the step C12;
c12, if the initial value of the given resource ID is larger than the maximum value of the resource ID, reporting an error, and turning to the step C13;
c13, whether the interval list of the traversal resource ID manager is empty, if so, go to step C18; if not, go to step C14;
c14, if the initial value of the given resource ID is less than the initial value of the interval, go to step C15, otherwise go to step C17;
c15, adding the ID between the initial value of the given resource ID and the initial value of the interval into the free resource ID list, and turning to the step C16;
c16, judging whether the ID number in the free resource ID list is larger than the designated number, if yes, ending, otherwise, turning to the step C17;
c17, if the ending value of the interval is 1 greater than the given resource ID initial value, setting the given resource ID initial value as the ending value of the interval plus 1, and returning to the step C13;
c18, calculating the difference between the specified number and the number of IDs in the free resource ID list, if the difference is larger than zero and smaller than the specified number, turning to the step C19, otherwise, turning to the step C110;
c19, adding the resource ID with the difference number in C18 between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource ID into the idle resource ID list, and then ending;
c110, judging whether the interval list of the resource ID manager is empty, and if the interval list of the resource ID manager is empty, turning to the step C112; if not, go to step C111;
c111, fetching a specified number of resource IDs between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending;
and C112, taking a specified number of resource IDs between the minimum value and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending.
On the basis of the above technical solution, the allocating resource ID means: allocating a given resource ID, finding the position of the ID in a resource ID manager, and creating or modifying an interval to which the ID belongs, wherein the specific steps are as follows:
c21, traversing the interval list of the resource ID manager, judging whether the current interval and the next interval exist, if both exist, going to the step C22, otherwise going to the step C25;
c22, if the ending value of the current interval < the given resource ID < the starting value of the next interval, go to step C23, otherwise go to step C24;
c23, merging the current interval, the next interval and the given resource ID, and ending;
c24, setting the next interval as the current interval, and returning to the step C21;
c25, if the interval list of the resource ID manager is empty, go to step C26, otherwise go to step C27;
c26, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into an interval list of a resource ID manager, and ending;
c27, if the starting value of the first interval of the interval list of the resource ID manager is > given resource ID, go to step C28, otherwise go to step C29;
c28, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into the top of the interval list of the resource ID manager, and ending;
c29, if the ending value of the last interval of the interval list of the resource ID manager is less than the given resource ID, go to step C210, otherwise, end;
c210, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the interval into the interval list of the resource ID manager at the last and ending.
On the basis of the above technical solution, the interval combination in step C23 specifically includes the following steps:
c231, if the end value +1 of the current interval is less than the given resource ID < the start value-1 of the next interval, go to step C232, otherwise go to step C233;
c232, setting the ending value of the current interval as a given resource ID, and ending;
c233, if the end value +1 of the current interval is less than the given resource ID, which is the start value-1 of the next interval, go to step C234, otherwise go to step C235;
c234, setting the starting value of the next interval as a given resource ID, and ending;
c235, if the end value +1 of the current interval is equal to the given resource ID — 1 of the next interval, go to step C236, otherwise go to step C237;
c236, setting the end value of the current interval as the end value of the next interval, removing the next interval from the interval list of the resource ID manager, and ending;
c237, if the ending value +1 of the current interval is less than the given resource ID is less than the starting value-1 of the next interval, go to step C238, otherwise, end;
c238, create interval, start value and end value are given resource ID, add to the interval list of resource ID manager, and end between the current interval and the next interval.
On the basis of the above technical solution, the releasing the resource ID means: releasing the given resource ID, finding the position of the ID in the resource ID manager, and creating or modifying the interval to which the ID belongs, wherein the specific steps are as follows:
c31, traversing the interval list of the resource ID manager, taking the current interval, and turning to the step C32;
c32, if the starting value of the current interval is less than or equal to the given resource ID is less than or equal to the ending value of the current interval, go to step C33, otherwise return to step C31;
c33, if the start value of the current interval is equal to the given resource ID < the end value of the current interval, go to step C34, otherwise go to step C35;
c34, adding 1 to the initial value of the current interval, and ending;
c35, if the start value of the current interval < the given resource ID is equal to the end value of the current interval, go to step C36, otherwise go to step C37;
c36, subtracting 1 from the end value of the current interval, and ending;
c37, if the start value of the current interval is equal to the given resource ID, go to step C38, otherwise go to step C39;
c38, removing the current interval from the interval list of the resource ID manager, and ending;
c39, if the start value of the current interval is less than the given resource ID is less than the end value of the current interval, go to step C310, otherwise, end;
c310, creating an interval, wherein the starting value is a given resource ID +1, the ending value is the ending value of the current interval, and after the interval is added into the current interval in the interval list of the resource ID manager, the step C311 is switched to;
and C311, setting the ending value of the current interval to be a given resource ID-1, and ending.
The invention also provides a resource ID management method based on the interval, which comprises the following steps:
A. define the specification of the resource ID manager using an extensible markup language XML file: the XML file defines a plurality of network element types, each network element type comprises a plurality of resource types, and each resource type defines the minimum value and the maximum value of a resource ID;
B. the database stores interval data of the resource ID manager, the interval represents the range of the used resource ID, the interval is composed of a starting value and an ending value, the resource ID manager comprises a list of the intervals, and the intervals are connected end to end according to the sequence of the starting value and the ending value from small to large; initializing a resource ID manager according to the XML file and interval data in the database;
C. and managing the resource ID of the network element by using a resource ID manager, wherein the resource ID comprises the steps of acquiring the idle resource ID, allocating the resource ID and releasing the resource ID.
On the basis of the above technical solution, initializing the resource ID manager in step B means: reading network element data from a database, and initializing a resource ID manager of each network element, wherein the method specifically comprises the following steps:
b1, traversing all network elements in the database, and turning to the step B2;
b2, judging whether the type of the current network element is defined in the XML file, if so, going to step B3, otherwise, returning to step B1;
b3, obtaining the specifications of a plurality of resource ID managers corresponding to the type of the current network element from the XML file, and turning to the step B4;
b4, initializing the minimum value and the maximum value of the resource ID according to the specification of the resource ID manager, and turning to the step B5;
b5, reading the interval data of the resource ID manager from the database, and turning to the step B6;
b6, if the starting value of the interval is smaller than the minimum value of the resource ID, or the ending value of the interval is larger than the maximum value of the resource ID, go to step B7, otherwise go to step B8;
b7, the initial value of the adjustment interval is the minimum value of the resource ID, or the end value of the adjustment interval is the maximum value of the resource ID, go to step B8;
b8, add the interval to the resource ID manager, and return to step B5.
On the basis of the above technical solution, the acquiring of the idle resource ID in step C means: starting from a given resource ID initial value, finding a specified number of idle resource IDs from small to large, and the specific steps are as follows:
c11, if the initial value of the given resource ID is less than the minimum value of the resource ID, setting the initial value of the given resource ID as the minimum value of the resource ID, and turning to the step C12;
c12, if the initial value of the given resource ID is larger than the maximum value of the resource ID, reporting an error, and turning to the step C13;
c13, whether the interval list of the traversal resource ID manager is empty, if so, go to step C18; if not, go to step C14;
c14, if the initial value of the given resource ID is less than the initial value of the interval, go to step C15, otherwise go to step C17;
c15, adding the ID between the initial value of the given resource ID and the initial value of the interval into the free resource ID list, and turning to the step C16;
c16, judging whether the ID number in the free resource ID list is larger than the designated number, if yes, ending, otherwise, turning to the step C17;
c17, if the ending value of the interval is 1 greater than the given resource ID initial value, setting the given resource ID initial value as the ending value of the interval plus 1, and returning to the step C13;
c18, calculating the difference between the specified number and the number of IDs in the free resource ID list, if the difference is larger than zero and smaller than the specified number, turning to the step C19, otherwise, turning to the step C110;
c19, adding the resource ID with the difference number in C18 between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource ID into the idle resource ID list, and then ending;
c110, judging whether the interval list of the resource ID manager is empty, and if the interval list of the resource ID manager is empty, turning to the step C112; if not, go to step C111;
c111, fetching a specified number of resource IDs between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending;
and C112, taking a specified number of resource IDs between the minimum value and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending.
On the basis of the above technical solution, the allocating resource ID in step C means: allocating a given resource ID, finding the position of the ID in a resource ID manager, and creating or modifying an interval to which the ID belongs, wherein the specific steps are as follows:
c21, traversing the interval list of the resource ID manager, judging whether the current interval and the next interval exist, if both exist, going to the step C22, otherwise going to the step C25;
c22, if the ending value of the current interval < the given resource ID < the starting value of the next interval, go to step C23, otherwise go to step C24;
c23, merging the current interval, the next interval and the given resource ID, and ending;
c24, setting the next interval as the current interval, and returning to the step C21;
c25, if the interval list of the resource ID manager is empty, go to step C26, otherwise go to step C27;
c26, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into an interval list of a resource ID manager, and ending;
c27, if the starting value of the first interval of the interval list of the resource ID manager is > given resource ID, go to step C28, otherwise go to step C29;
c28, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into the top of the interval list of the resource ID manager, and ending;
c29, if the ending value of the last interval of the interval list of the resource ID manager is less than the given resource ID, go to step C210, otherwise, end;
c210, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the interval into the interval list of the resource ID manager at the last and ending.
On the basis of the above technical solution, the interval combination in step C23 specifically includes the following steps:
c231, if the end value +1 of the current interval is less than the given resource ID < the start value-1 of the next interval, go to step C232, otherwise go to step C233;
c232, setting the ending value of the current interval as a given resource ID, and ending;
c233, if the end value +1 of the current interval is less than the given resource ID, which is the start value-1 of the next interval, go to step C234, otherwise go to step C235;
c234, setting the starting value of the next interval as a given resource ID, and ending;
c235, if the end value +1 of the current interval is equal to the given resource ID — 1 of the next interval, go to step C236, otherwise go to step C237;
c236, setting the end value of the current interval as the end value of the next interval, removing the next interval from the interval list of the resource ID manager, and ending;
c237, if the ending value +1 of the current interval is less than the given resource ID is less than the starting value-1 of the next interval, go to step C238, otherwise, end;
c238, create interval, start value and end value are given resource ID, add to the interval list of resource ID manager, and end between the current interval and the next interval.
On the basis of the above technical solution, the releasing of the resource ID in step C means: releasing the given resource ID, finding the position of the ID in the resource ID manager, and creating or modifying the interval to which the ID belongs, wherein the specific steps are as follows:
c31, traversing the interval list of the resource ID manager, taking the current interval, and turning to the step C32;
c32, if the starting value of the current interval is less than or equal to the given resource ID is less than or equal to the ending value of the current interval, go to step C33, otherwise return to step C31;
c33, if the start value of the current interval is equal to the given resource ID < the end value of the current interval, go to step C34, otherwise go to step C35;
c34, adding 1 to the initial value of the current interval, and ending;
c35, if the start value of the current interval < the given resource ID is equal to the end value of the current interval, go to step C36, otherwise go to step C37;
c36, subtracting 1 from the end value of the current interval, and ending;
c37, if the start value of the current interval is equal to the given resource ID, go to step C38, otherwise go to step C39;
c38, removing the current interval from the interval list of the resource ID manager, and ending;
c39, if the start value of the current interval is less than the given resource ID is less than the end value of the current interval, go to step C310, otherwise, end;
c310, creating an interval, wherein the starting value is a given resource ID +1, the ending value is the ending value of the current interval, and after the interval is added into the current interval in the interval list of the resource ID manager, the step C311 is switched to;
and C311, setting the ending value of the current interval to be a given resource ID-1, and ending.
Compared with the prior art, the invention has the following advantages:
(1) the invention stores the resource ID in a certain range by adopting a section mode, and can effectively save the storage space of the resource ID.
(2) When the new resource ID is allocated, the allocation time of the resource ID can be effectively reduced only by traversing the interval.
(3) When the number of the resource IDs is large, the number of the intervals is kept to be smaller in magnitude order, and the efficiencies of acquiring the idle resource IDs, distributing the resource IDs and releasing the resource IDs can be remarkably improved.
(4) The invention uses XML file to define the specification of the resource ID allocator, so that the user can expand more easily.
Drawings
Fig. 1 is a flowchart of a resource ID management method based on an interval according to an embodiment of the present invention.
Fig. 2 is a diagram of a section data structure in the embodiment of the present invention.
FIG. 3 is a flowchart of step B in the embodiment of the present invention.
FIG. 4 is a flowchart of step C1 in an embodiment of the present invention.
FIG. 5 is a flowchart of step C2 in an embodiment of the present invention.
FIG. 6 is a flowchart of step C23 in an embodiment of the present invention.
FIG. 7 is a flowchart of step C3 in an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the figures and the embodiments.
Example 1
Embodiment 1 of the present invention provides a resource ID management system based on an interval, including a specification definition unit, a resource ID manager initialization unit, and a resource ID management unit, where:
the specification defining unit is used for: defining the specification of the resource ID manager using an XML (Extensible Markup Language) file;
the resource ID manager initialization unit is to: initializing a resource ID manager according to the XML file and interval data in the database;
the resource ID management unit is used for: and managing the resource ID of the network element by using a resource ID manager, wherein the resource ID comprises the steps of acquiring the idle resource ID, allocating the resource ID and releasing the resource ID.
The specific specification defined by the specification defining unit by using the XML file comprises four fields of a minimum value and a maximum value of a network element type, a resource type and a resource ID. The XML file can define a plurality of network element types; each network element type comprises a plurality of resource types; each resource type defines a minimum and maximum value of the resource ID.
The database stores section data of the resource ID manager, and a section indicates a range of used resource IDs. The interval is composed of a start value and an end value, the resource ID manager comprises an interval list, and the intervals are connected end to end according to the sequence of the start value and the end value from small to large.
Example 2
Referring to fig. 1, an embodiment 2 of the present invention provides a method for managing a resource ID based on an interval, including the following steps:
A. the specification of the resource ID manager is defined using an XML file.
B. And initializing the resource ID manager according to the XML file and the data in the database.
C. And managing the resource ID of the network element by using a resource ID manager, wherein the resource ID comprises idle resource ID acquisition, resource ID distribution and resource ID release.
The specific XML file is defined as follows:
Figure BDA0001598363290000131
Figure BDA0001598363290000141
Figure BDA0001598363290000151
the specific specification defined by using the XML file comprises four fields of minimum value and maximum value of network element type, resource type and resource ID. As indicated above, the beginning of the XML file defines an < element-list > element, where the < element > sub-element represents the four specification fields.
The XML file can define a plurality of network element types; each network element type comprises a plurality of resource types; each resource type defines a minimum and maximum value of the resource ID. As indicated above, the XML file defines a < data > element, where the child element < row > represents a resource specification; the four sub-elements < col > In < row > respectively represent the specific values of the four fields of the minimum value and the maximum value of the network element type, the resource type and the resource ID, such as In Label resource, and the specification of the In Label resource is (123,1,301,1048575) on the network element type 1 and (255,1,301,786432) on the network element type 2; if the first < col > of the two < row > is the same, it indicates that there are two different resource specifications on the same network element type; if the first < col > of the two < row > is different, it indicates the resource specification on different network element types.
The table structure of the storage intervals in the database is as follows:
TABLE 1 Table Structure of storage intervals in database
Network element type Type of dispenser Interval start value End of interval value
123 1 301 310
123 2 301 310
123 1 321 330
123 2 321 330
255 1 301 310
255 2 301 310
255 1 321 330
255 2 321 330
The database stores section data of the resource ID manager, and a section indicates a range of used resource IDs. Referring to fig. 2, the interval is composed of a start value and an end value, and the resource ID manager includes a list of intervals, and the intervals are connected end to end in the order of the start value and the end value from small to large. As shown in table 1, two network element types 123 and 255, each supporting two allocator types 1 and 2, each allocator type having two spans [301,310] and [321,330 ]. There may be a plurality of intervals, and the start value and the end value are different, and table 1 is simplified.
Example 3
On the basis of embodiment 2, initializing the resource ID manager in step B means: reading the network element data from the database, and initializing the resource ID manager of each network element, as shown in fig. 3, the specific steps are as follows:
b1, traversing all network elements in the database, and turning to the step B2;
the table of network elements present in the database is as follows:
table 2 table of network elements present in database
Network element ID Network element type
1 123
2 255
3 123
4 255
As shown in table 2, the network element type of each network element is obtained according to the network element table. The network element types of different network elements may be the same.
B2, judging whether the type of the current network element is defined in the XML file, if so, going to step B3, otherwise, returning to step B1;
and (4) searching the < row > child element in the XML file, and judging whether the first < col > is the current network element type or not.
B3, obtaining the specifications of a plurality of resource ID managers corresponding to the type of the current network element from the XML file, and turning to the step B4;
and (3) searching the < row > child element in the XML file, and acquiring all the first < col > as the < row > of the current network element type.
B4, initializing the minimum value and the maximum value of the resource ID according to the specification of the resource ID manager, and turning to the step B5;
the maximum and minimum values of the resource ID are initialized according to the data of the third and fourth < col > of < row >.
B5, reading the interval data of the resource ID manager from the database, and turning to the step B6;
all span data is read from the database according to the data of the first and second < col > in < row >.
B6, if the starting value of the interval is smaller than the minimum value of the resource ID, or the ending value of the interval is larger than the maximum value of the resource ID, go to step B7, otherwise go to step B8;
b7, the initial value of the adjustment interval is the minimum value of the resource ID, or the end value of the adjustment interval is the maximum value of the resource ID, go to step B8; i.e., the third and fourth columns in table 1, are compared in size with the data of the third and fourth < col > in the XML file < row >. This step is to prevent the interval values from exceeding the minimum and maximum limits defined by the XML file.
B8, add the interval to the resource ID manager, and return to step B5. I.e. adding the interval to the interval list of the resource ID manager. The interval list of the resource ID manager, as shown in fig. 2, may include n intervals, where the start value and the end value of each interval satisfy the relationship: the starting value 1 is less than or equal to the ending value 1, the starting value 2 is less than or equal to the ending value 2 is less than or equal to … …, and the starting value n is less than or equal to the ending value n.
Example 4
On the basis of embodiment 2, the step C of acquiring the idle resource ID means: starting from a given starting value of resource IDs, a specified number of free resource IDs are found from small to large, as shown in fig. 4, and the specific steps are as follows:
c11, if the initial value of the given resource ID is less than the minimum value of the resource ID, setting the initial value of the given resource ID as the minimum value of the resource ID, and turning to the step C12;
c12, if the initial value of the given resource ID is larger than the maximum value of the resource ID, reporting an error, and turning to the step C13;
c11 and C12 guarantee a legal resource ID starting value. For example, In Label resource ID with network element type 123 In XML file, its minimum and maximum are 301 and 1048575 respectively; when acquiring an idle In Label resource ID, a resource ID starting value may be specified, looking backward from it, but ranging between 301 and 1048575.
C13, whether the interval list of the traversal resource ID manager is empty, if so, go to step C18; if not, go to step C14;
c14, if the initial value of the given resource ID is less than the initial value of the interval, go to step C15, otherwise go to step C17;
c15, adding the ID between the initial value of the given resource ID and the initial value of the interval into the free resource ID list, and turning to the step C16;
c16, judging whether the ID number in the free resource ID list is larger than the designated number, if yes, ending, otherwise, turning to the step C17;
c17, if the ending value of the interval is 1 greater than the given resource ID initial value, setting the given resource ID initial value as the ending value of the interval plus 1, and returning to the step C13;
c13 through C17 deal with the case where the partition list is not empty in the resource ID manager. As described above, assuming an In Label resource ID of network element type 123, with intervals [301,310] and [321,330], the given resource ID starting value is 302 and the specified number is 11; c13 takes the interval [301,310 ]; then C14 judges 302 is larger than 301, go to C17; resource ID start value set to the end value of interval [301,310] plus one, i.e., 311, transition C13; at this time, if the current interval is [321,330], then the C14 determines 311 to be smaller than 321, and then the C15 is turned; then the IDs between 311 and 321 are added to the list of free resource IDs, the number of course is to be in accordance with the specified number of 11, and there are only 10 resource IDs between 311 and 321, so there is one difference, and it is necessary to go to C18 for further calculation.
C18, calculating the difference between the specified number and the number of IDs in the free resource ID list, if the difference is larger than zero and smaller than the specified number, turning to the step C19, otherwise, turning to the step C110;
c19, adding the resource ID with the difference number in C18 between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource ID into the idle resource ID list, and then ending;
c110, judging whether the interval list of the resource ID manager is empty, and if the interval list of the resource ID manager is empty, turning to the step C112; if not, go to step C111;
c111, fetching a specified number of resource IDs between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending;
and C112, taking a specified number of resource IDs between the minimum value and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending.
Step C18 deals with the first case where the partition list is not empty in the resource ID manager in steps C13 through C17, but the number of acquired free resource IDs is not yet sufficient for the specified number. As described above, an In Label resource ID of network element type 123, has intervals [301,310] and [321,330], given a resource ID starting value of 301 and a specified number of 11; steps C13 to C17 have acquired 10 free resource IDs, and therefore the difference calculated by C18 is 1, go to step C19; the current span is [321,330], so take 1 ID between 330 and 1048575, i.e. 331, join the free resource ID list, and end.
In the second case, the step C13 judges that the section list of the resource ID manager is empty, that is, the above sections [301,310] and [321,330] do not exist, and goes to step C18; step C18 calculates the difference to be 11, equal to the specified number, go to step C110; the span list of resource ID manager is empty and step C112 is passed to fetch 11 resource IDs between 302 and 1048575.
In the third case, in step C13, it is determined that the resource ID manager has not an empty section list, which has sections [301,310] and [321,330], the given resource ID start value is 301, the specified number is 10, C13 to C17 have already acquired enough resource IDs, and then the difference calculated in step C18 is 0, go to step C110; if the interval list of the resource ID manager is not empty, go to step C111; since the specified number is now the difference 0 calculated in step C18, the resource ID does not need to be acquired, and this is ended.
Example 5
On the basis of embodiment 2, the resource ID allocated in step C means: allocating a given resource ID, finding the location of the ID in the resource ID manager, and creating or modifying the interval to which the ID belongs, as shown in fig. 5, the specific steps are:
c21, traversing the interval list of the resource ID manager, judging whether the current interval and the next interval exist, if both exist, going to the step C22, otherwise going to the step C25;
c22, if the ending value of the current interval < the given resource ID < the starting value of the next interval, go to step C23, otherwise go to step C24;
c23, merging the current interval, the next interval and the given resource ID, and ending;
c24, setting the next interval as the current interval, and returning to the step C21;
steps C21 through C24 are a lookup in the span list to see if the given resource ID is between the first and second spans. For example, if the span list is [301,310], [321,330], if the given resource ID is 311, then 311 is between two spans in C22, go to step C23, enter the step of merging spans; if the given resource ID is 331, then 331 in C22 is greater than the end value of interval [301,310], go to step C24; c24, setting the current interval to be [321,330], and turning to the step C21; if it is determined at C21 that there is no next interval, the process goes to step C25.
C25, if the interval list of the resource ID manager is empty, go to step C26, otherwise go to step C27;
c26, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into an interval list of a resource ID manager, and ending;
the initially created interval has only one value, after which the ID allocation will increase the size of the interval.
C27, if the starting value of the first interval of the interval list of the resource ID manager is > given resource ID, go to step C28, otherwise go to step C29;
c28, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into the top of the interval list of the resource ID manager, and ending;
c29, if the ending value of the last interval of the interval list of the resource ID manager is less than the given resource ID, go to step C210, otherwise, end;
c210, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the interval into the interval list of the resource ID manager at the last and ending.
The case handled by steps C25 to C210 is a case where the given resource ID is not between two spans. For example, if the span list is empty, given a resource ID of 301, then step C25 goes to step C26, the span list is modified to [301,301 ]; if the span list is [321,330], and the given resource ID is 301, then step C27 goes to step C28, with the span list modified to [301,301], [321,330 ]; if the span list is [321,330] and the given resource ID is 331, then step C29 goes to step C210 with the span list modified to [321,330], [331,331 ].
Example 6
On the basis of embodiment 5, the section merging in step C23 specifically includes the following steps, as shown in fig. 6:
c231, if the end value +1 of the current interval is less than the given resource ID < the start value-1 of the next interval, go to step C232, otherwise go to step C233;
c232, setting the ending value of the current interval as a given resource ID, and ending;
c233, if the end value +1 of the current interval is less than the given resource ID, which is the start value-1 of the next interval, go to step C234, otherwise go to step C235;
c234, setting the starting value of the next interval as a given resource ID, and ending;
c235, if the end value +1 of the current interval is equal to the given resource ID — 1 of the next interval, go to step C236, otherwise go to step C237;
c236, setting the end value of the current interval as the end value of the next interval, removing the next interval from the interval list of the resource ID manager, and ending;
c237, if the ending value +1 of the current interval is less than the given resource ID is less than the starting value-1 of the next interval, go to step C238, otherwise, end;
c238, create interval, start value and end value are given resource ID, add to the interval list of resource ID manager, and end between the current interval and the next interval.
The merging interval of step C23 above, considers the case where the given resource ID is between two intervals. For example, the span list is [301,310], [321,330], if the given resource ID is 311, then C231 goes to C232, the span list is modified to [301,311], [321,330 ]; if the given resource ID is 320, then step C233 goes to step C234, where the span list is modified to [301,310], [320,330 ]; if the given resource ID is 312, then step C237 goes to step C238 with the interval modified to [301,310], [312,312], [321,330 ].
In another case, the interval list is [301,310], [312,330], and if the given resource ID is 311, then step C235 goes to step C236, where the interval list is modified to [301,330 ].
Example 7
On the basis of embodiment 2, the resource ID released in step C refers to: releasing a given resource ID, finding the position of the ID in a resource ID manager, and creating or modifying the interval to which the ID belongs, as shown in FIG. 7, the specific steps are as follows:
c31, traversing the interval list of the resource ID manager, taking the current interval, and turning to the step C32;
c32, if the starting value of the current interval is less than or equal to the given resource ID is less than or equal to the ending value of the current interval, go to step C33, otherwise return to step C31;
steps C31 through C32 are intervals for which the resource ID is identified in the interval list. For example, the interval list is [301,310], [321,330], if the given resource ID is 305, then find the interval it is in [301,310], go to step C33; if the given resource ID is 331, such an interval cannot be found without releasing the resource ID.
C33, if the start value of the current interval is equal to the given resource ID < the end value of the current interval, go to step C34, otherwise go to step C35;
c34, adding 1 to the initial value of the current interval, and ending;
c35, if the start value of the current interval < the given resource ID is equal to the end value of the current interval, go to step C36, otherwise go to step C37;
c36, subtracting 1 from the end value of the current interval, and ending;
c37, if the start value of the current interval is equal to the given resource ID, go to step C38, otherwise go to step C39;
c38, removing the current interval from the interval list of the resource ID manager, and ending;
c39, if the start value of the current interval is less than the given resource ID is less than the end value of the current interval, go to step C310, otherwise, end;
c310, creating an interval, wherein the starting value is a given resource ID +1, the ending value is the ending value of the current interval, and after the interval is added into the current interval in the interval list of the resource ID manager, the step C311 is switched to;
and C311, setting the ending value of the current interval to be a given resource ID-1, and ending.
Steps C33 through C311 consider the case where an interval is found to contain the resource ID to be released, for example, the resource ID given above is 305, and is located in the interval [301,310 ]. If the interval is [301,310], [321,330], and the current interval is [301,310], there are possible cases as follows: given the resource ID of 301, step C33 goes to step C34, and the span list is modified to [302,310], [321,330 ]; given the resource ID of 310, step C35 goes to step C36, and the span list is modified to [301,309], [321,330 ]; if the given resource ID is any one of 302 to 309, if 305, the step C39 goes to the step C310, and goes to the step C311, the interval [301,310] is divided into two intervals [301,304], [306,310] from 305, and the interval list is modified to [301,304], [306,310], [321,330 ].
In another special case, for example, where the span list is [301,301], [321,330], given a resource ID of 301, then step C37 goes to step C38, with the span list modified to [321,330 ].
Various modifications and variations of the embodiments of the present invention may be made by those skilled in the art, and they are also within the scope of the present invention, provided they are within the scope of the claims of the present invention and their equivalents.
What is not described in detail in the specification is prior art that is well known to those skilled in the art.

Claims (10)

1. A resource ID management system based on intervals, characterized by: the system comprises a specification definition unit, a resource ID manager initialization unit and a resource ID management unit, wherein:
the specification defining unit is used for: define the specification of the resource ID manager using an extensible markup language XML file: the XML file defines a plurality of network element types, each network element type comprises a plurality of resource types, and each resource type defines the minimum value and the maximum value of a resource ID;
the database stores interval data of the resource ID manager, the interval represents the range of the used resource ID, and the interval consists of a starting value and an ending value; the resource ID manager comprises a list of intervals, and the intervals are connected end to end according to the sequence of the starting value and the ending value from small to large;
the resource ID manager initialization unit is to: initializing a resource ID manager according to the XML file and interval data in the database;
the resource ID management unit is used for: managing the resource ID of the network element by using a resource ID manager, wherein the resource ID comprises an idle resource ID, a distributed resource ID and a released resource ID;
the initializing resource ID manager refers to: reading network element data from a database, and initializing a resource ID manager of each network element, wherein the method specifically comprises the following steps:
b1, traversing all network elements in the database, and turning to the step B2;
b2, judging whether the type of the current network element is defined in the XML file, if so, going to step B3, otherwise, returning to step B1;
b3, obtaining the specifications of a plurality of resource ID managers corresponding to the type of the current network element from the XML file, and turning to the step B4;
b4, initializing the minimum value and the maximum value of the resource ID according to the specification of the resource ID manager, and turning to the step B5;
b5, reading the interval data of the resource ID manager from the database, and turning to the step B6;
b6, if the starting value of the interval is smaller than the minimum value of the resource ID, or the ending value of the interval is larger than the maximum value of the resource ID, go to step B7, otherwise go to step B8;
b7, the initial value of the adjustment interval is the minimum value of the resource ID, or the end value of the adjustment interval is the maximum value of the resource ID, go to step B8;
b8, add the interval to the resource ID manager, and return to step B5.
2. The interval-based resource ID management system of claim 1, wherein: the acquiring of the idle resource ID means: starting from a given resource ID initial value, finding a specified number of idle resource IDs from small to large, and the specific steps are as follows:
c11, if the initial value of the given resource ID is less than the minimum value of the resource ID, setting the initial value of the given resource ID as the minimum value of the resource ID, and turning to the step C12;
c12, if the initial value of the given resource ID is larger than the maximum value of the resource ID, reporting an error, and turning to the step C13;
c13, whether the interval list of the traversal resource ID manager is empty, if so, go to step C18; if not, go to step C14;
c14, if the initial value of the given resource ID is less than the initial value of the interval, go to step C15, otherwise go to step C17;
c15, adding the ID between the initial value of the given resource ID and the initial value of the interval into the free resource ID list, and turning to the step C16;
c16, judging whether the ID number in the free resource ID list is larger than the designated number, if yes, ending, otherwise, turning to the step C17;
c17, if the ending value of the interval is 1 greater than the given resource ID initial value, setting the given resource ID initial value as the ending value of the interval plus 1, and returning to the step C13;
c18, calculating the difference between the specified number and the number of IDs in the free resource ID list, if the difference is larger than zero and smaller than the specified number, turning to the step C19, otherwise, turning to the step C110;
c19, adding the resource ID with the difference number in C18 between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource ID into the idle resource ID list, and then ending;
c110, judging whether the interval list of the resource ID manager is empty, and if the interval list of the resource ID manager is empty, turning to the step C112; if not, go to step C111;
c111, fetching a specified number of resource IDs between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending;
and C112, taking a specified number of resource IDs between the minimum value and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending.
3. The interval-based resource ID management system of claim 1, wherein: the allocation resource ID refers to: allocating a given resource ID, finding the position of the ID in a resource ID manager, and creating or modifying an interval to which the ID belongs, wherein the specific steps are as follows:
c21, traversing the interval list of the resource ID manager, judging whether the current interval and the next interval exist, if both exist, going to the step C22, otherwise going to the step C25;
c22, if the ending value of the current interval < the given resource ID < the starting value of the next interval, go to step C23, otherwise go to step C24;
c23, merging the current interval, the next interval and the given resource ID, and ending;
c24, setting the next interval as the current interval, and returning to the step C21;
c25, if the interval list of the resource ID manager is empty, go to step C26, otherwise go to step C27;
c26, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into an interval list of a resource ID manager, and ending;
c27, if the starting value of the first interval of the interval list of the resource ID manager is > given resource ID, go to step C28, otherwise go to step C29;
c28, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into the top of the interval list of the resource ID manager, and ending;
c29, if the ending value of the last interval of the interval list of the resource ID manager is less than the given resource ID, go to step C210, otherwise, end;
c210, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the interval into the interval list of the resource ID manager at the last and ending.
4. The interval-based resource ID management system of claim 3, wherein: the section merging in the step C23 specifically includes the following steps:
c231, if the end value of the current interval +1= that the given resource ID is less than the start value of the next interval-1, turning to the step C232, otherwise, turning to the step C233;
c232, setting the ending value of the current interval as a given resource ID, and ending;
c233, if the end value +1 of the current interval < the given resource ID = the start value-1 of the next interval, go to step C234, otherwise go to step C235;
c234, setting the starting value of the next interval as a given resource ID, and ending;
c235, if the end value of the current interval +1= given resource ID = start value-1 of the next interval, go to step C236, otherwise go to step C237;
c236, setting the end value of the current interval as the end value of the next interval, removing the next interval from the interval list of the resource ID manager, and ending;
c237, if the ending value +1 of the current interval is less than the given resource ID is less than the starting value-1 of the next interval, go to step C238, otherwise, end;
c238, create interval, start value and end value are given resource ID, add to the interval list of resource ID manager, and end between the current interval and the next interval.
5. The interval-based resource ID management system of claim 1, wherein: the release resource ID means: releasing the given resource ID, finding the position of the ID in the resource ID manager, and creating or modifying the interval to which the ID belongs, wherein the specific steps are as follows:
c31, traversing the interval list of the resource ID manager, taking the current interval, and turning to the step C32;
c32, if the starting value of the current interval is less than or equal to the given resource ID is less than or equal to the ending value of the current interval, go to step C33, otherwise return to step C31;
c33, if the start value of the current interval = given resource ID < end value of the current interval, go to step C34, otherwise go to step C35;
c34, adding 1 to the initial value of the current interval, and ending;
c35, if the starting value of the current interval < the given resource ID = the end value of the current interval, go to step C36, otherwise go to step C37;
c36, subtracting 1 from the end value of the current interval, and ending;
c37, if the start value of the current interval = given resource ID = end value of the current interval, go to step C38, otherwise go to step C39;
c38, removing the current interval from the interval list of the resource ID manager, and ending;
c39, if the start value of the current interval is less than the given resource ID is less than the end value of the current interval, go to step C310, otherwise, end;
c310, creating an interval, wherein the starting value is a given resource ID +1, the ending value is the ending value of the current interval, and after the interval is added into the current interval in the interval list of the resource ID manager, the step C311 is switched to;
and C311, setting the ending value of the current interval to be a given resource ID-1, and ending.
6. A resource ID management method based on intervals is characterized by comprising the following steps:
A. define the specification of the resource ID manager using an extensible markup language XML file: the XML file defines a plurality of network element types, each network element type comprises a plurality of resource types, and each resource type defines the minimum value and the maximum value of a resource ID;
B. the database stores interval data of the resource ID manager, the interval represents the range of the used resource ID, the interval is composed of a starting value and an ending value, the resource ID manager comprises a list of the intervals, and the intervals are connected end to end according to the sequence of the starting value and the ending value from small to large; initializing a resource ID manager according to the XML file and interval data in the database;
C. managing the resource ID of the network element by using a resource ID manager, wherein the resource ID comprises an idle resource ID, a distributed resource ID and a released resource ID;
initializing the resource ID manager in step B means: reading network element data from a database, and initializing a resource ID manager of each network element, wherein the method specifically comprises the following steps:
b1, traversing all network elements in the database, and turning to the step B2;
b2, judging whether the type of the current network element is defined in the XML file, if so, going to step B3, otherwise, returning to step B1;
b3, obtaining the specifications of a plurality of resource ID managers corresponding to the type of the current network element from the XML file, and turning to the step B4;
b4, initializing the minimum value and the maximum value of the resource ID according to the specification of the resource ID manager, and turning to the step B5;
b5, reading the interval data of the resource ID manager from the database, and turning to the step B6;
b6, if the starting value of the interval is smaller than the minimum value of the resource ID, or the ending value of the interval is larger than the maximum value of the resource ID, go to step B7, otherwise go to step B8;
b7, the initial value of the adjustment interval is the minimum value of the resource ID, or the end value of the adjustment interval is the maximum value of the resource ID, go to step B8;
b8, add the interval to the resource ID manager, and return to step B5.
7. The interval-based resource ID management method of claim 6, wherein: the step C of acquiring the idle resource ID means: starting from a given resource ID initial value, finding a specified number of idle resource IDs from small to large, and the specific steps are as follows:
c11, if the initial value of the given resource ID is less than the minimum value of the resource ID, setting the initial value of the given resource ID as the minimum value of the resource ID, and turning to the step C12;
c12, if the initial value of the given resource ID is larger than the maximum value of the resource ID, reporting an error, and turning to the step C13;
c13, whether the interval list of the traversal resource ID manager is empty, if so, go to step C18; if not, go to step C14;
c14, if the initial value of the given resource ID is less than the initial value of the interval, go to step C15, otherwise go to step C17;
c15, adding the ID between the initial value of the given resource ID and the initial value of the interval into the free resource ID list, and turning to the step C16;
c16, judging whether the ID number in the free resource ID list is larger than the designated number, if yes, ending, otherwise, turning to the step C17;
c17, if the ending value of the interval is 1 greater than the given resource ID initial value, setting the given resource ID initial value as the ending value of the interval plus 1, and returning to the step C13;
c18, calculating the difference between the specified number and the number of IDs in the free resource ID list, if the difference is larger than zero and smaller than the specified number, turning to the step C19, otherwise, turning to the step C110;
c19, adding the resource ID with the difference number in C18 between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource ID into the idle resource ID list, and then ending;
c110, judging whether the interval list of the resource ID manager is empty, and if the interval list of the resource ID manager is empty, turning to the step C112; if not, go to step C111;
c111, fetching a specified number of resource IDs between the ending value of the last interval in the interval list of the resource ID manager and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending;
and C112, taking a specified number of resource IDs between the minimum value and the maximum value of the resource IDs, adding the resource IDs into the idle resource ID list, and then ending.
8. The interval-based resource ID management method of claim 6, wherein: the resource ID allocated in step C means: allocating a given resource ID, finding the position of the ID in a resource ID manager, and creating or modifying an interval to which the ID belongs, wherein the specific steps are as follows:
c21, traversing the interval list of the resource ID manager, judging whether the current interval and the next interval exist, if both exist, going to the step C22, otherwise going to the step C25;
c22, if the ending value of the current interval < the given resource ID < the starting value of the next interval, go to step C23, otherwise go to step C24;
c23, merging the current interval, the next interval and the given resource ID, and ending;
c24, setting the next interval as the current interval, and returning to the step C21;
c25, if the interval list of the resource ID manager is empty, go to step C26, otherwise go to step C27;
c26, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into an interval list of a resource ID manager, and ending;
c27, if the starting value of the first interval of the interval list of the resource ID manager is > given resource ID, go to step C28, otherwise go to step C29;
c28, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the resource IDs into the top of the interval list of the resource ID manager, and ending;
c29, if the ending value of the last interval of the interval list of the resource ID manager is less than the given resource ID, go to step C210, otherwise, end;
c210, creating an interval, wherein the starting value and the ending value are given resource IDs, adding the interval into the interval list of the resource ID manager at the last and ending.
9. The interval-based resource ID management method of claim 8, wherein: the section merging in the step C23 specifically includes the following steps:
c231, if the end value of the current interval +1= that the given resource ID is less than the start value of the next interval-1, turning to the step C232, otherwise, turning to the step C233;
c232, setting the ending value of the current interval as a given resource ID, and ending;
c233, if the end value +1 of the current interval < the given resource ID = the start value-1 of the next interval, go to step C234, otherwise go to step C235;
c234, setting the starting value of the next interval as a given resource ID, and ending;
c235, if the end value of the current interval +1= given resource ID = start value-1 of the next interval, go to step C236, otherwise go to step C237;
c236, setting the end value of the current interval as the end value of the next interval, removing the next interval from the interval list of the resource ID manager, and ending;
c237, if the ending value +1 of the current interval is less than the given resource ID is less than the starting value-1 of the next interval, go to step C238, otherwise, end;
c238, create interval, start value and end value are given resource ID, add to the interval list of resource ID manager, and end between the current interval and the next interval.
10. The interval-based resource ID management method of claim 6, wherein: the resource ID released in step C means: releasing the given resource ID, finding the position of the ID in the resource ID manager, and creating or modifying the interval to which the ID belongs, wherein the specific steps are as follows:
c31, traversing the interval list of the resource ID manager, taking the current interval, and turning to the step C32;
c32, if the starting value of the current interval is less than or equal to the given resource ID is less than or equal to the ending value of the current interval, go to step C33, otherwise return to step C31;
c33, if the start value of the current interval = given resource ID < end value of the current interval, go to step C34, otherwise go to step C35;
c34, adding 1 to the initial value of the current interval, and ending;
c35, if the starting value of the current interval < the given resource ID = the end value of the current interval, go to step C36, otherwise go to step C37;
c36, subtracting 1 from the end value of the current interval, and ending;
c37, if the start value of the current interval = given resource ID = end value of the current interval, go to step C38, otherwise go to step C39;
c38, removing the current interval from the interval list of the resource ID manager, and ending;
c39, if the start value of the current interval is less than the given resource ID is less than the end value of the current interval, go to step C310, otherwise, end;
c310, creating an interval, wherein the starting value is a given resource ID +1, the ending value is the ending value of the current interval, and after the interval is added into the current interval in the interval list of the resource ID manager, the step C311 is switched to;
and C311, setting the ending value of the current interval to be a given resource ID-1, and ending.
CN201810215053.3A 2018-03-15 2018-03-15 Resource ID management system and method based on interval Active CN108509535B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810215053.3A CN108509535B (en) 2018-03-15 2018-03-15 Resource ID management system and method based on interval
PCT/CN2018/103165 WO2019174196A1 (en) 2018-03-15 2018-08-30 Interval-based resource id management system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810215053.3A CN108509535B (en) 2018-03-15 2018-03-15 Resource ID management system and method based on interval

Publications (2)

Publication Number Publication Date
CN108509535A CN108509535A (en) 2018-09-07
CN108509535B true CN108509535B (en) 2020-12-01

Family

ID=63377643

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810215053.3A Active CN108509535B (en) 2018-03-15 2018-03-15 Resource ID management system and method based on interval

Country Status (2)

Country Link
CN (1) CN108509535B (en)
WO (1) WO2019174196A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291340B (en) * 2020-10-28 2022-06-03 武汉绿色网络信息服务有限责任公司 Service distribution method, controller and virtual network element

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694878A (en) * 2012-05-16 2012-09-26 烽火通信科技股份有限公司 Sectional ID (Identity) distributing method
CN103139255A (en) * 2011-11-30 2013-06-05 腾讯科技(深圳)有限公司 Method for allocating resource identification and identification section
CN103873389A (en) * 2012-12-12 2014-06-18 北京百度网讯科技有限公司 Identity resource allocation method and system thereof
CN105610593A (en) * 2014-11-05 2016-05-25 中兴通讯股份有限公司 Method and device for resource identifier allocation in network management system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101640613B (en) * 2009-09-11 2012-01-25 中兴通讯股份有限公司 Method and device for network resource relating management
CN102547818B (en) * 2012-01-04 2016-06-15 大唐移动通信设备有限公司 Resource identifier allocating method and equipment
CN104376025B (en) * 2013-08-16 2017-10-10 华为技术有限公司 The date storage method and device of distributed data base

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103139255A (en) * 2011-11-30 2013-06-05 腾讯科技(深圳)有限公司 Method for allocating resource identification and identification section
CN102694878A (en) * 2012-05-16 2012-09-26 烽火通信科技股份有限公司 Sectional ID (Identity) distributing method
CN103873389A (en) * 2012-12-12 2014-06-18 北京百度网讯科技有限公司 Identity resource allocation method and system thereof
CN105610593A (en) * 2014-11-05 2016-05-25 中兴通讯股份有限公司 Method and device for resource identifier allocation in network management system

Also Published As

Publication number Publication date
CN108509535A (en) 2018-09-07
WO2019174196A1 (en) 2019-09-19

Similar Documents

Publication Publication Date Title
KR101994021B1 (en) File manipulation method and apparatus
US10154089B2 (en) Distributed system and data operation method thereof
CN106294190B (en) Storage space management method and device
CN101227465B (en) Method and system for administrating IP address
WO2021227999A1 (en) Cloud computing service system and method
CN109194707A (en) The method and device of distribution figure insertion
CN108667867A (en) Date storage method and device
WO2019170011A1 (en) Task allocation method and device, and distributed storage system
CN105094997A (en) Method and system for sharing physical memory among cloud computing host nodes
CN113094183B (en) Training task creating method, device, system and medium of AI (Artificial Intelligence) training platform
CN107943542A (en) A kind of configuration information management method, device, computer-readable recording medium and storage control
CN108509535B (en) Resource ID management system and method based on interval
US8443369B1 (en) Method and system for dynamically selecting a best resource from each resource collection based on resources dependencies, prior selections and statistics to implement an allocation policy
EP3791282A1 (en) Distributed data storage system with automatic snapshots, user snapshots and soft delete
CN106502589A (en) The loading of caching or the system and method for persistence is realized based on cloud computing
US11757716B2 (en) Network management apparatus, method, and program
CN118132208A (en) Resource pool-based cluster topology management method and system for virtualized Kubernetes clusters
CN101483668A (en) Network storage and access method, device and system for hot spot data
CN110162395A (en) A kind of method and device of Memory Allocation
CN111124883B (en) Test case library introduction method, system and equipment based on tree form
JP3844933B2 (en) Database server processing method
CN107276833A (en) A kind of node information management method and device
CN115686497A (en) Business development data management method, development engine, electronic device, and storage medium
CN114090969A (en) Multilevel multi-tenant cross authorization management method
CN110635924B (en) SDN network virtualization subnet management system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant