CN102394943B - Interface index establishment method and apparatus thereof, and interface information query method and apparatus thereof - Google Patents

Interface index establishment method and apparatus thereof, and interface information query method and apparatus thereof Download PDF

Info

Publication number
CN102394943B
CN102394943B CN201110353503.3A CN201110353503A CN102394943B CN 102394943 B CN102394943 B CN 102394943B CN 201110353503 A CN201110353503 A CN 201110353503A CN 102394943 B CN102394943 B CN 102394943B
Authority
CN
China
Prior art keywords
interface
index
type
sequence number
memory cell
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
CN201110353503.3A
Other languages
Chinese (zh)
Other versions
CN102394943A (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.)
Ruijie Networks Co Ltd
Original Assignee
Fujian Star Net Communication 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 Fujian Star Net Communication Co Ltd filed Critical Fujian Star Net Communication Co Ltd
Priority to CN201110353503.3A priority Critical patent/CN102394943B/en
Publication of CN102394943A publication Critical patent/CN102394943A/en
Application granted granted Critical
Publication of CN102394943B publication Critical patent/CN102394943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an interface index establishment method and an apparatus thereof, and an interface information query method and an apparatus thereof. The interface index establishment method comprises the following steps that: an interface type of a designated interface of a designated device is determined; the number of interface indexes of the established interface type is determined; an interface index is distributed to the designated interface and the sequence number in the interface index is a value that is obtained by adding 1 to the number; and an interface pointer of the designated interface is preserved in a designated storage unit; when the number of the interface indexes is determined as 0, the sequence number of the designated storage unit is a value that is obtained by adding 1 to the number of all established interface indexes; and when the number of the interface indexes is determined as a nonzero value, the sequence number of the designated storage unit is a value that is obtained by adding an initial sequence number corresponded to the interface type to the sequence number in the interface index and then subtracting 1. According to the invention, it is realized that interface index management based on an interface type is carried out; simultaneously, waste on index storage space is reduced.

Description

Interface index method for building up, interface message querying method and device
Technical field
The present invention relates to the equipment interface technical field in communication technical field, relate in particular to a kind of interface index method for building up, interface message querying method and device.
Background technology
Interface refers to that communication apparatus is for realizing the port of devices interconnect, data retransmission, such as connecting the ether interface of Ethernet, connect ATM (Asynchronous Transfer Mode, asynchronous transfer mode) atm interface of network, connect SDH (Synchronous Digital Hierarchy, SDH (Synchronous Digital Hierarchy)) POS of network (Packer over SONET/SDH) interface, and the tunnel interface that connects tunnel.Communication apparatus, when connecting heterogeneous networks by interface and realizing data retransmission, need to be managed a large amount of, various types of interfaces.The quantity of port that each communication equipment is supported has the upper limit.
It is at SNMP (Simple Network Management Protocol that interface index technology proposes first, Simple Network Management Protocol) in, interface index technology is to set up corresponding interface index for each interface of device interior, interface and interface index are one to one, to realize the management to dissimilar a large amount of interfaces based on interface index.
The management of interface index mainly refers to index space management, comprises index space maintenance, the work such as index assignment.According to the quantity of communication equipment institute supporting interface, interface index managerial demand is safeguarded an index stores space consistent with interface quantity, as shown in Figure 1, in index stores space, be responsible for storage index management information, comprise interface index and the interface pointer of having distributed, interface pointer is pointed to the memory address of the interface message of the interface that this interface index is corresponding, by interface index, is managed and can be got interface pointer based on interface index, thereby realize, based on interface pointer, inquires interface message.
The key of interface index management is the management in index stores space, and the method based on interface index query interface information.After once the interface quantity of communication equipment is fixing (port number of each communication apparatus is to have the upper limit), the maximum memory space that index management information can take fixes, management for this fixed storage space, can in memory space, according to data type, to Coutinuous store space, carry out decile, each decile is as a memory cell, for the index management information of storing an interface, and according to the sequence number of each memory cell, use minimum machine instruction to navigate to corresponding memory cell, specifically can adopt array mode, the subscript of array is equivalent to sequence number.
Existing a kind of interface index Managed Solution is as follows:
As shown in Figure 2, according to the maximum interface quantity N of equipment, the memory space that the memory cell of application and maximum interface quantity is equal to, as index stores space, the index management information of preserving each interface by wherein each memory cell, comprises interface index and interface pointer.When distribution interface index, the interface index using the serial number of continuous integral number from small to large as each interface, and by index management information corresponding to interface index, in the memory cell that to be saved in sequence number be this serial number.
Adopt this scheme, interface index can, directly as the sequence number of memory cell, provide by the fast access mode of interface index query interface information.But in this scheme, each interface index is a linear Serial No., cannot embody interface type feature, so the interface management that cannot realize based on interface type by interface index operates.
In order to realize the interface management operation based on interface type, another kind of interface management scheme is proposed in prior art, as follows:
As shown in Figure 3, according to the maximum interface quantity N of equipment, be respectively the interface of every kind of interface type, the memory space that the memory cell of application and maximum interface quantity is equal to, as index stores space corresponding to this interface type, and by the index management information of the interface of every kind of interface type, be saved in the index stores space that this kind of interface type is corresponding, and distribute corresponding type number for every kind of interface type.Accordingly, the interface index of an interface comprises type number and the serial number of this interface in whole interfaces of this interface type that the interface type of this interface is corresponding, and by index management information corresponding to interface index, being saved in sequence number in the index stores space corresponding with type number in interface index is in the memory cell of the serial number in interface index, and Fig. 3 is ATM style interface and EtherType interface interface index Managed Solution schematic diagram separately.
In the time need to inquiring about the interface message of the interface that interface index is corresponding, first according to the type number in this interface index, determine that the type numbers corresponding index stores space, then according to the serial number in interface index, determine to preserve the memory cell of the index management information that this interface index is corresponding, and the interface message of interface corresponding to this interface index of index management information inquiry based on preserving in this memory cell.
This scheme can be supported the memory cell based on the quick locating interface index of interface type, thereby realizes the interface index bookkeeping based on interface type.But owing to cannot knowing in advance the quantity of the interface of every type that this equipment will be set up, so in this scheme, need to be respectively the memory space that every kind of interface type is reserved and the memory cell of the maximum interface quantity of this equipment is equal to, but can all do not utilized for the reserved memory space of whole interface types, so caused the waste of memory space, the quantity of the interface type of the interface of setting up is larger, and the waste of memory space is more.
Summary of the invention
The embodiment of the present invention provides a kind of interface index method for building up, interface message querying method and device, in order to solve in prior art, exist based on interface type, carry out the problem of the waste of storage space that interface index when management cause.
The embodiment of the present invention provides a kind of interface index method for building up, comprising:
Determine the interface type of the specified interface of designated equipment;
Determine the quantity of the interface index of the described interface type of having set up;
For described specified interface distribution interface index, wherein, described interface index comprises type number and the serial number that described interface type is corresponding, and the serial number in described interface index is that described quantity adds 1 value obtaining;
By the interface pointer of described specified interface, be kept in the designated memory cell in the index stores space of distributing for described designated equipment, wherein, when the described quantity of determining is 0, the quantity that the sequence number of this designated memory cell is the total interface index set up adds 1 value obtaining, when the described quantity of determining is non-zero, the sequence number of this designated memory cell is that start sequence number that described interface type is corresponding adds the above serial number and deducts 1 value obtaining again, described start sequence number is in described index stores space, preserve the sequence number of memory cell of interface pointer of first interface of described interface type.
The embodiment of the present invention also provides a kind of interface message querying method of the interface index of setting up based on above-mentioned interface index method for building up, comprising:
Type number based in specified interface index, determines the interface type of described specified interface index;
Determine the start sequence number that described interface type is corresponding;
Determine that the serial number that described start sequence number adds in the above specified interface index deducts 1 value obtaining again;
Obtain sequence number for the interface pointer of interface corresponding to the described specified interface index preserved in the memory cell of this value;
Described interface pointer based on obtaining is inquired about the interface message of the interface that described specified interface index is corresponding.
The embodiment of the present invention also provides a kind of interface index apparatus for establishing, comprising:
Type determining unit, for determining the interface type of the specified interface of designated equipment;
Quantity determining unit, for determining the quantity of the interface index of the described interface type of having set up;
Index assignment unit, is used to described specified interface distribution interface index, and wherein, described interface index comprises type number and the serial number that described interface type is corresponding, and the serial number in described interface index is that described quantity adds 1 value obtaining;
Storage unit, be used for the interface pointer of described specified interface, be kept in the designated memory cell in the index stores space of distributing for described designated equipment, wherein, when the described quantity of determining is 0, the quantity that the sequence number of this designated memory cell is the total interface index set up adds 1 value obtaining, when the described quantity of determining is non-zero, the sequence number of this designated memory cell is that start sequence number that described interface type is corresponding adds the above serial number and deducts 1 value obtaining again, described start sequence number is in described index stores space, preserve the sequence number of memory cell of interface pointer of first interface of described interface type.
The embodiment of the present invention also provides a kind of interface message inquiry unit of the interface index of setting up based on above-mentioned interface index apparatus for establishing, comprising:
Type determining unit, for the type number based on specified interface index, determines the interface type of described specified interface index;
The first sequence number determining unit, for determining start sequence number corresponding to described interface type;
The second sequence number determining unit, the serial number that adds the above specified interface index for definite described start sequence number deducts 1 value obtaining again;
Pointer acquiring unit, for obtaining the interface pointer of the interface that described specified interface index that sequence number preserves for the memory cell of this value is corresponding;
Query unit, the interface message of inquiring about the interface that described specified interface index is corresponding for the described interface pointer based on obtaining.
In the method that the embodiment of the present invention provides, the interface pointer that can preserve dissimilar interface in index stores space for designated equipment distribution, when setting up interface index for specified interface, the quantity of the interface index of the interface type of first definite this specified interface of having set up, and when this quantity of determining is 0, preserve the sequence number of designated memory cell of the interface pointer of this specified interface, for the quantity of the total interface index set up adds 1, when this quantity of determining is non-zero, the sequence number of this designated memory cell deducts 1 value again for start sequence number corresponding to this interface type adds the serial number in the interface index of distribution, make in index stores space, according to the sequence number memory cell that uses in order from small to large, thereby when being this designated equipment allocation index memory space, the memory space that only memory cell of the maximum interface quantity of distribution and this designated equipment is equal to.
And, the interface pointer that can also make the interface of same-interface type is to be kept in the continuous memory cell of sequence number, and the interface index distributing for specified interface comprises type number and serial number, thereby make when according to the interface message of interface index query interface, can the type number based in specified interface index determine interface type, and the quantity of the interface index of definite this interface type of having set up and corresponding start sequence number, and determine the memory cell of the interface pointer of preserving the interface that this specified interface index is corresponding, and the interface pointer of obtaining preservation from this memory cell, thereby inquire the interface message of the interface that this specified interface index is corresponding.
Therefore, the scheme that adopts the embodiment of the present invention to provide, when realization is carried out interface index management based on interface type, has reduced the waste in index stores space.
Accompanying drawing explanation
Fig. 1 is index stores of the prior art space schematic diagram;
Fig. 2 be interface index Managed Solution of the prior art realize one of schematic diagram;
Fig. 3 be interface index Managed Solution of the prior art realize two of schematic diagram;
The flow chart of the interface index method for building up that Fig. 4 provides for the embodiment of the present invention;
The flow chart of the interface message querying method that Fig. 5 provides for the embodiment of the present invention;
Fig. 6 is the flow chart of the interface index method for building up in the embodiment of the present invention 1;
Fig. 7 be in the embodiment of the present invention 1 interface index management realize one of schematic diagram;
Fig. 8 be in the embodiment of the present invention 1 interface index management realize two of schematic diagram;
Fig. 9 is the flow chart of interface message querying method in the embodiment of the present invention 2;
Figure 10 is the structural representation of interface index apparatus for establishing in the embodiment of the present invention 3;
Figure 11 is the structural representation of interface message inquiry unit in the embodiment of the present invention 4.
Embodiment
When carrying out interface index management in order to be given in realization based on interface type, reduced the implementation of the waste in index stores space, the embodiment of the present invention provides a kind of interface index method for building up, interface message querying method and device, below in conjunction with Figure of description, the preferred embodiments of the present invention are described, be to be understood that, preferred embodiment described herein only, for description and interpretation the present invention, is not intended to limit the present invention.And in the situation that not conflicting, embodiment and the feature in embodiment in the application can combine mutually.
The embodiment of the present invention provides a kind of interface index method for building up, as shown in Figure 4, comprising:
Step S401, determine the interface type of the specified interface of designated equipment.
The quantity of the interface index of step S402, definite this interface type of having set up.
Step S403, be specified interface distribution interface index, wherein, this interface index comprises type number and the serial number that this interface type is corresponding, and the serial number in this interface index adds 1 value obtaining for this quantity.
Step S404, by the interface pointer of specified interface, be kept in the designated memory cell in the index stores space of distributing for designated equipment, wherein, when this quantity of determining is 0, the quantity that the sequence number of this designated memory cell is the total interface index set up adds 1 value obtaining, when this quantity of determining is non-zero, the sequence number of this designated memory cell adds that for start sequence number corresponding to this interface type this serial number deducts 1 value obtaining again, this start sequence number is in this index stores space, preserve the sequence number of memory cell of interface pointer of first interface of this interface type.
Accordingly, the interface index based on adopting above-mentioned interface index method for building up to set up, the embodiment of the present invention also provides a kind of interface message querying method, as shown in Figure 5, comprising:
Step S501, the type number based in specified interface index, determine the interface type of specified interface index.
Step S502, determine the start sequence number that this interface type is corresponding.
Step S503, determine that this start sequence number adds that the serial number in specified interface index deducts 1 value again.
Step S504, obtain sequence number for the interface pointer of interface corresponding to the specified interface index preserved in the memory cell of this value.
Step S505, the interface message of inquiring about the interface that specified interface index is corresponding based on this interface pointer of obtaining.
Below in conjunction with accompanying drawing, with specific embodiment, method provided by the invention and device are described in detail.
Embodiment 1:
The flow chart that Fig. 6 is the interface index method for building up that provides in the embodiment of the present invention 1, specifically comprises following treatment step:
Step S601, determine the interface type of the specified interface of designated equipment.
The quantity of the interface index of step S602, definite this interface type of having set up.
In the present embodiment 1, when setting up a kind of new interface index of interface type, upgrade the quantity of the interface index of this interface type of having set up at every turn, and preserve, in this step, can directly obtain this quantity of current preservation.
Whether this quantity that step S603, judgement are determined is 0, if 0, enter step S604, otherwise, enter step S606.
Step S604, when this quantity is 0, represent also not set up the interface index of this interface type, the 1st interface index of the interface index that the interface index that will distribute for this specified interface be this interface type.
For this specified interface distribution interface index, in the present embodiment 1, interface index comprises type number and serial number, for the type number in the interface index of this specified interface distribution is the type number that this interface type is corresponding, due to the 1st interface index of this interface index interface index that is this interface type, the serial number in the interface index distributing is 1.
Concrete, interface index can amount to 32 by 4 bytes and represent, wherein most-significant byte is used for representing type number, for order of representation, number for low 24, for example, in the present embodiment 1, the type number of distributing for EtherType is 0x01 (wherein 0x represents hexadecimal counting), the type number of distributing for ATM type is 0x02, and suppose to determine in above-mentioned steps S601 that the interface type of specified interface is ATM type, in this step, be that the interface index of this specified interface distribution of ATM type is 0x020001.
Step S605, after being this specified interface distribution interface index, in the index stores space of distributing for this designated equipment, be identified for preserving the designated memory cell of the interface pointer of this specified interface, and the interface pointer of this specified interface is kept in this designated memory cell, preferably, the interface index distributing for this specified interface can also be kept in this designated memory cell.
In the present embodiment 1, when being designated equipment allocation index memory space, can be so that the maximum interface quantity that in the index stores space of distributing, the quantity of memory cell is this designated equipment, to save as much as possible the memory space of index stores space hold, reduces the waste of memory space.
Index stores space specifically can adopt array mode, be this designated equipment allocation index array, the subscript of array of indexes is equivalent to sequence number, in order to make the subscript of array of indexes consistent with sequence number, the array element space of not using subscript 0 can be set, and from the array element space of subscript 1, as the 1st memory cell.
In order to realize according to the continuous use memory cell of sequence number order from small to large, in this step, the quantity that the sequence number of determining this designated memory cell is the total interface index set up adds 1 value obtaining, for example, as shown in Figure 7, currently set up 2 interface indexs, and the type of 2 interface indexs is EtherType, the sequence number of determining this designated memory cell of the interface pointer of preserving this specified interface is the value that 2+1 obtains, and is 3.It is in 3 memory cell that the interface pointer that is about to this specified interface is kept at sequence number.
Step S606, when this quantity is non-zero, represent to have set up the interface index of this interface type, in this step, determine start sequence number corresponding to this interface type, this start sequence number is in this index stores space, preserves the sequence number of memory cell of interface pointer of first interface of this interface type.
In the present embodiment 1, each, upgrade after this start sequence number, preserve this start sequence number, and directly obtain in use.
Step S607, be this specified interface distribution interface index, in the present embodiment 1, interface index comprises type number and serial number,, for the type number in the interface index of this specified interface distribution is the type number that this interface type is corresponding, the serial number in the interface index of distribution is that this quantity of determining in above-mentioned steps S602 adds 1 value obtaining.
Concrete, interface index can amount to 32 by 4 bytes and represent, wherein most-significant byte is used for representing type number, for order of representation, number for low 24, for example, in the present embodiment 1, the type number of distributing for EtherType is 0x01 (wherein 0x represents hexadecimal counting), the type number of distributing for ATM type is 0x02, and suppose to determine in above-mentioned steps S601 that the interface type of specified interface is ATM type, and this quantity of determining in above-mentioned steps S602 is 2, in this step, be that the interface index of this specified interface distribution of ATM type is 0x020003.
This step S607 and above-mentioned steps S606 do not have strict sequencing.
Step S608, after being this specified interface distribution interface index, in the index stores space of distributing for this designated equipment, be identified for preserving the designated memory cell of the interface pointer of this specified interface, and the interface pointer of this specified interface is kept in this designated memory cell.
Preferably, the interface index distributing for this specified interface can also be kept in this designated memory cell, for follow-up when according to interface message corresponding to specified interface search index, whether unanimously with the specified interface index of wish inquiry can compare in advance the interface pointer of preserving in memory cell, to confirm more accurately the interface pointer of preserving in this memory cell, it is the interface pointer of interface corresponding to this specified interface index; Obviously, when not needing to carry out this confirmation in when inquiry and process, saving interface index not in memory cell.
In order to realize according to the continuous use memory cell of sequence number order from small to large, and the interface pointer that makes the interface of same-interface type is to remain in the continuous memory cell of sequence number, in this step, the sequence number of determining this designated memory cell deducts 1 value obtaining again for this start sequence number adds the serial number in the interface index of distribution, for example, as shown in Figure 8, the current interface index of having set up 2 EtherTypes, set up the interface index of 2 ATM types, and start sequence number corresponding to ATM type is 3, the sequence number of determining this designated memory cell of the interface pointer of preserving this specified interface is the value that 3+3-1 obtains, be 5.It is in 5 memory cell that the interface pointer that is about to this specified interface is kept at sequence number.
By the step S601-step S608 shown in above-mentioned Fig. 6, in a continuous index stores space of distributing, realized the preservation to the distribution of dissimilar interface index and index management information, and, make in index stores space, according to the sequence number memory cell that uses in order from small to large, thereby when being this designated equipment allocation index memory space, the memory space that only memory cell of the maximum interface quantity of distribution and this designated equipment is equal to, compared to existing technology, be respectively the scheme of every kind of interface type allocation index memory space, reduced the waste in index stores space.
When for an interface quantity and the known equipment of interface type, when shown in employing Fig. 6, method is set up interface index, can set up successively the interface index of various interface type, after having set up a kind of total interface index of interface type, then set up the interface index of lower a kind of interface type.
Yet, setting up on the basis of interface index, when having set up new interface, and need to set up interface index for this new interface time, the start sequence number corresponding to interface type that may occur this new interface, be less than the start sequence number that other interface type is corresponding, expression is according to sequence number order from small to large, in the memory cell below of memory cell of interface pointer of last interface of preserving this interface type, also preserve the interface pointer of the interface of other interface type, so, for the continuity of memory cell of interface pointer that guarantees the continuity that memory cell is used and preserve the interface of same-interface type, preferably, in this case, after above-mentioned steps S606, before above-mentioned steps S608, also comprise: judge whether start sequence number that other interface type is corresponding is greater than the start sequence number corresponding to interface type of this specified interface, if be greater than, by the interface pointer of the interface index corresponding interface of this other interface type of having set up, be kept in the next memory cell of its former memory cell, if be not more than, directly perform step S608.
Embodiment 2:
Interface index based on setting up in above-described embodiment 1, the present embodiment 2 provides a kind of interface message querying method, as shown in Figure 9, specifically comprises following treatment step:
Step S901, in the time need to inquiring about the interface message of the interface that specified interface index is corresponding, first obtain the type number in this specified interface index.
Step S902, the type based on obtaining are numbered, and determine the interface type of this specified interface index.
Be specially the corresponding relation based on type number and interface type, determine that the type numbers corresponding interface type.
Step S903, determine the start sequence number that this interface type is corresponding.
Step S904, determine that this start sequence number adds that the serial number in this this specified interface index deducts 1 value obtaining again, this value obtaining is the sequence number of the memory cell of the index management information of preserving the interface that this interface index is corresponding.
Step S905, obtain the index management information of sequence number for preserving in the memory cell of this value, specifically comprise interface index and the interface pointer of obtaining preservation.
Whether the interface pointer that step S906, judgement are obtained from this memory cell is consistent with specified interface pointer, if consistent, enters step S907, otherwise, enter step S908.
Step S907, the interface pointer based on obtaining from this memory cell, the interface message of inquiring about the interface that this specified interface index is corresponding.Concrete inquiry mode can adopt the whole bag of tricks of the prior art, at this, is no longer described in detail.
Whether step S908, the interface pointer of obtaining from this memory cell be inconsistent with specified interface pointer, represents that the index management information of storage is wrong, cancels the inquiry of this interface message.
Interface index method for building up in the employing embodiment of the present invention 1 and the interface message querying method in embodiment 2, realized based on interface type and carried out interface index management, and reduced the waste in index stores space.
Embodiment 3:
Based on same inventive concept, the interface index method for building up providing according to the above embodiment of the present invention, correspondingly, the embodiment of the present invention 3 also provides a kind of interface index apparatus for establishing, and its structural representation as shown in figure 10, specifically comprises:
Type determining unit 1001, for determining the interface type of the specified interface of designated equipment;
Quantity determining unit 1002, for determining the quantity of the interface index of the described interface type of having set up;
Index assignment unit 1003, is used to described specified interface distribution interface index, and wherein, described interface index comprises type number and the serial number that described interface type is corresponding, and the serial number in described interface index is that described quantity adds 1 value obtaining;
Storage unit 1004, be used for the interface pointer of described specified interface, be kept in the designated memory cell in the index stores space of distributing for described designated equipment, wherein, when the described quantity of determining is 0, the quantity that the sequence number of this designated memory cell is the total interface index set up adds 1 value obtaining, when the described quantity of determining is non-zero, the sequence number of this designated memory cell is that start sequence number that described interface type is corresponding adds the above serial number and deducts 1 value obtaining again, described start sequence number is in described index stores space, preserve the sequence number of memory cell of interface pointer of first interface of described interface type.
Preferably, storage unit 1004, when also non-zero for the described quantity when determining, by the interface pointer of described specified interface, before being kept in the designated memory cell in described index stores space, when start sequence number corresponding to other interface type is greater than start sequence number corresponding to described interface type, by the interface pointer of the interface index corresponding interface of described other interface type of having set up, be kept in the next memory cell of its former memory cell.
Preferably, storage unit 1004, also for after being described specified interface distribution interface index in described index assignment unit 1003, the described interface index by distributing, is kept in the described designated memory cell in described index stores space.
Embodiment 4:
Based on same inventive concept, the interface message querying method providing according to the above embodiment of the present invention, correspondingly, the embodiment of the present invention 4 also provides a kind of interface message inquiry unit, and its structural representation as shown in figure 11, specifically comprises:
Type determining unit 1101, for the type number based on specified interface index, determines the interface type of described specified interface index;
The first sequence number determining unit 1102, for determining start sequence number corresponding to described interface type;
The second sequence number determining unit 1103, the serial number that adds the above specified interface index for definite described start sequence number deducts 1 value obtaining again;
Pointer acquiring unit 1104, for obtaining the interface pointer of the interface that described specified interface index that sequence number preserves for the memory cell of this value is corresponding;
Query unit 1105, the interface message of inquiring about the interface that described specified interface index is corresponding for the described interface pointer based on obtaining.
Preferably, also comprise:
Index acquiring unit 1106, while being used for preserving interface index in the memory cell in described index stores space, before described pointer acquiring unit 1104 obtains the interface pointer of sequence number corresponding interface for the described specified interface index preserved in the memory cell of this value, the interface index of preserving in the memory cell that to obtain sequence number be this value;
Index determining unit 1107, for determining that the interface index obtaining is described specified interface index.
In sum, in the scheme that the embodiment of the present invention provides, when setting up interface index, comprising: the interface type of determining the specified interface of designated equipment; Determine the quantity of the interface index of this interface type of having set up; For specified interface distribution interface index, wherein, this interface index comprises type number and the serial number that this interface type is corresponding, and the serial number in this interface index adds 1 value obtaining for this quantity; By the interface pointer of specified interface, be kept in the designated memory cell in the index stores space of distributing for designated equipment, wherein, when this quantity of determining is 0, the quantity that the sequence number of this designated memory cell is the total interface index set up adds 1 value obtaining, when this quantity of determining is non-zero, the sequence number of this designated memory cell adds that for start sequence number corresponding to this interface type this serial number deducts 1 value obtaining again, this start sequence number is in this index stores space, preserves the sequence number of memory cell of interface pointer of first interface of this interface type.
Accordingly, when query interface information, comprising: the type number based in specified interface index, determine the interface type of specified interface index; Determine the start sequence number that this interface type is corresponding; Determine that this start sequence number adds that the serial number in specified interface index deducts 1 value again; Obtain sequence number for the interface pointer of interface corresponding to the specified interface index preserved in the memory cell of this value; Based on this interface pointer of obtaining, inquire about the interface message of the interface that specified interface index is corresponding.
The scheme that adopts the embodiment of the present invention to provide, when realization is carried out interface index management based on interface type, has reduced the waste in index stores space.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.

Claims (11)

1. an interface index method for building up, is characterized in that, comprising:
Determine the interface type of the specified interface of designated equipment;
Determine the quantity of the interface index of the described interface type of having set up;
For described specified interface distribution interface index, wherein, described interface index comprises type number and the serial number that described interface type is corresponding, and the serial number in described interface index is that described quantity adds 1 value obtaining;
By the interface pointer of described specified interface, be kept in the designated memory cell in the index stores space of distributing for described designated equipment, wherein, when the described quantity of determining is 0, the quantity that the sequence number of this designated memory cell is the total interface index set up adds 1 value obtaining, when the described quantity of determining is non-zero, the sequence number of this designated memory cell is that start sequence number that described interface type is corresponding adds the above serial number and deducts 1 value obtaining again, described start sequence number is in described index stores space, preserve the sequence number of memory cell of interface pointer of first interface of described interface type.
2. the method for claim 1, is characterized in that, when the described quantity of determining is non-zero, by the interface pointer of described specified interface, before being kept in the designated memory cell in described index stores space, also comprises:
When start sequence number corresponding to other interface type is greater than start sequence number corresponding to described interface type, by the interface pointer of the interface index corresponding interface of described other interface type of having set up, be kept in the next memory cell of its former memory cell.
3. the method for claim 1, is characterized in that, after being described specified interface distribution interface index, also comprises:
Described interface index by distributing, is kept in the described designated memory cell in described index stores space.
4. the method as described in as arbitrary in claim 1-3, is characterized in that the maximum interface quantity that in described index stores space, the quantity of memory cell is described designated equipment.
5. an interface message querying method for the interface index of setting up based on method described in claim 1, is characterized in that, comprising:
Type number based in specified interface index, determines the interface type of described specified interface index;
Determine the start sequence number that described interface type is corresponding;
Determine that the serial number that described start sequence number adds in the above specified interface index deducts 1 value obtaining again;
Obtain sequence number for the interface pointer of interface corresponding to the described specified interface index preserved in the memory cell of this value;
Described interface pointer based on obtaining is inquired about the interface message of the interface that described specified interface index is corresponding.
6. method as claimed in claim 5, it is characterized in that, while preserving interface index in the memory cell in described index stores space, before obtaining the interface pointer of sequence number corresponding interface for the described specified interface index preserved in the memory cell of this value, also comprise:
Obtaining sequence number is the interface index of preserving in the memory cell of this value;
Determine that the interface index obtaining is described specified interface index.
7. an interface index apparatus for establishing, is characterized in that, comprising:
Type determining unit, for determining the interface type of the specified interface of designated equipment;
Quantity determining unit, for determining the quantity of the interface index of the described interface type of having set up;
Index assignment unit, is used to described specified interface distribution interface index, and wherein, described interface index comprises type number and the serial number that described interface type is corresponding, and the serial number in described interface index is that described quantity adds 1 value obtaining;
Storage unit, be used for the interface pointer of described specified interface, be kept in the designated memory cell in the index stores space of distributing for described designated equipment, wherein, when the described quantity of determining is 0, the quantity that the sequence number of this designated memory cell is the total interface index set up adds 1 value obtaining, when the described quantity of determining is non-zero, the sequence number of this designated memory cell is that start sequence number that described interface type is corresponding adds the above serial number and deducts 1 value obtaining again, described start sequence number is in described index stores space, preserve the sequence number of memory cell of interface pointer of first interface of described interface type.
8. device as claimed in claim 7, it is characterized in that, described storage unit, when also non-zero for the described quantity when determining, by the interface pointer of described specified interface, before being kept in the designated memory cell in described index stores space, when start sequence number corresponding to other interface type is greater than start sequence number corresponding to described interface type, by the interface pointer of the interface index corresponding interface of described other interface type of having set up, be kept in the next memory cell of its former memory cell.
9. device as claimed in claim 7, it is characterized in that, described storage unit, also for after being described specified interface distribution interface index in described index assignment unit, described interface index by distributing, is kept in the described designated memory cell in described index stores space.
10. an interface message inquiry unit for the interface index based on device is set up described in claim 7, is characterized in that, comprising:
Type determining unit, for the type number based on specified interface index, determines the interface type of described specified interface index;
The first sequence number determining unit, for determining start sequence number corresponding to described interface type;
The second sequence number determining unit, the serial number that adds the above specified interface index for definite described start sequence number deducts 1 value obtaining again;
Pointer acquiring unit, for obtaining the interface pointer of the interface that described specified interface index that sequence number preserves for the memory cell of this value is corresponding;
Query unit, the interface message of inquiring about the interface that described specified interface index is corresponding for the described interface pointer based on obtaining.
11. devices as claimed in claim 10, is characterized in that, also comprise:
Index acquiring unit, while being used for preserving interface index in the memory cell in described index stores space, before described pointer acquiring unit obtains the interface pointer of sequence number corresponding interface for the described specified interface index preserved in the memory cell of this value, the interface index of preserving in the memory cell that to obtain sequence number be this value;
Index determining unit, for determining that the interface index obtaining is described specified interface index.
CN201110353503.3A 2011-11-09 2011-11-09 Interface index establishment method and apparatus thereof, and interface information query method and apparatus thereof Active CN102394943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110353503.3A CN102394943B (en) 2011-11-09 2011-11-09 Interface index establishment method and apparatus thereof, and interface information query method and apparatus thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110353503.3A CN102394943B (en) 2011-11-09 2011-11-09 Interface index establishment method and apparatus thereof, and interface information query method and apparatus thereof

Publications (2)

Publication Number Publication Date
CN102394943A CN102394943A (en) 2012-03-28
CN102394943B true CN102394943B (en) 2014-01-22

Family

ID=45862146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110353503.3A Active CN102394943B (en) 2011-11-09 2011-11-09 Interface index establishment method and apparatus thereof, and interface information query method and apparatus thereof

Country Status (1)

Country Link
CN (1) CN102394943B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701726B (en) * 2013-12-31 2018-02-06 上海斐讯数据通信技术有限公司 The interface index management method and system of a kind of core switch
CN112650105A (en) * 2020-12-11 2021-04-13 类人思维(山东)智慧科技有限公司 Port management layer construction method, system, terminal and storage medium
CN112882852A (en) * 2021-03-25 2021-06-01 上海科世达-华阳汽车电器有限公司 Interface data storage method and device and computer readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192949A (en) * 2006-11-24 2008-06-04 中兴通讯股份有限公司 An interface index method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ES2370779T3 (en) * 2006-06-15 2011-12-22 Nokia Siemens Networks S.P.A. METHOD FOR THE CLASSIFICATION OF PACKAGES BASED ON THE TYPE OF PROTOCOL AND PRIORITIES.

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192949A (en) * 2006-11-24 2008-06-04 中兴通讯股份有限公司 An interface index method and system

Also Published As

Publication number Publication date
CN102394943A (en) 2012-03-28

Similar Documents

Publication Publication Date Title
CN109729588B (en) Service data transmission method and device
CN103108262B (en) The method of optical network unit configuration file upgrading in GPON system
CN104468219B (en) Virtual networking method for discovering network topology and equipment
CN108616402B (en) Management method and system of remote equipment
CN101335648A (en) Automatic converting method for packets of different interfaces and apparatus thereof
CN104581419A (en) Dual-network realizing method based on android intelligent set-top box
CN104243268A (en) Association method and device between virtual extensible local area networks (VXLAN) and tunnel
CN102394943B (en) Interface index establishment method and apparatus thereof, and interface information query method and apparatus thereof
CN103312836A (en) Large local network internet protocol (IP) address administration method
CN103237075A (en) Data synchronizing method, device and system
EP3098987A1 (en) Time slot synchronization training method for optical burst transport network node, node device and network
CN110795496A (en) Data synchronization method, device and system
CN102143006B (en) Interface topology control method, system and device for communication equipment
CN1984419A (en) Method and device for arranging data
US20200244579A1 (en) Flexible Ethernet Frame Forwarding Method and Apparatus
CN102263633B (en) Clock synchronization method and stacking controller for switch stacking system
CN106648008A (en) Power supply system of blade server
CN105718401B (en) The multiplexing method and system of a kind of multichannel SMII signals to MII signals all the way
CN104244385A (en) Control method and device of access point device
CN103200029A (en) Label distribution and management method of PTN/IPRan equipment through network management
CN204390466U (en) Operational order collection plate
CN109246796A (en) A kind of communication means and device
CN106230980A (en) A kind of address configuration method, Apparatus and system
CN102571430B (en) Method for synchronizing network devices and network devices
CN108768863B (en) Transmission network route analysis method and device and computer readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 350002 19 Building, Citrus Industrial Park, 618 Jinshan Road, Cangshan District, Fuzhou, Fujian.

Patentee after: RUIJIE NETWORKS Co.,Ltd.

Address before: 350002 19 Building, Citrus Industrial Park, 618 Jinshan Road, Cangshan District, Fuzhou, Fujian.

Patentee before: Fujian Star Network Ruijie Networks Co.,Ltd.