CN102394943A - 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
CN102394943A
CN102394943A CN2011103535033A CN201110353503A CN102394943A CN 102394943 A CN102394943 A CN 102394943A CN 2011103535033 A CN2011103535033 A CN 2011103535033A CN 201110353503 A CN201110353503 A CN 201110353503A CN 102394943 A CN102394943 A CN 102394943A
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.)
Granted
Application number
CN2011103535033A
Other languages
Chinese (zh)
Other versions
CN102394943B (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 the 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 is meant that communication apparatus is used to realize the port of devices interconnect, data forwarding; Such as the ether interface that connects Ethernet; The atm interface that connects ATM (Asynchronous Transfer Mode, asynchronous transfer mode) network connects SDH (Synchronous Digital Hierarchy; SDH) POS of network (Packer over SONET/SDH) interface, and the tunnel interface that connects the tunnel.Communication apparatus needs a large amount of, the various types of interfaces of management when connecting heterogeneous networks and realizing data forwarding through interface.The quantity of port that each communication equipment is supported all has the upper limit.
It is at SNMP (Simple Network Management Protocol that the interface index technology proposes first; Simple Network Management Protocol) in; The 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 based on the management of interface index to dissimilar a large amount of interfaces.
The management of interface index mainly refers to the index space management, comprises the index space maintenance, work such as index assignment.Quantity according to communication equipment institute supporting interface; The interface index managerial demand is safeguarded an index stores space consistent with interface quantity, and is as shown in Figure 1, is responsible for storage index management information in the index stores space; Comprise the interface index and the interface pointer of having distributed; Interface pointer is pointed to the memory address of the interface message of the corresponding interface of this interface index, can get access to interface pointer based on interface index through the interface index management, thereby realizes inquiring interface message based on interface pointer.
The key of interface index management is the management in index stores space, and based on the method for interface index query interface information.In case after the interface fixed amount of communication equipment (port number of each communication apparatus all is that the upper limit is arranged); The maximum memory space that index management information can take is promptly fixed, and to the management of this fixed storage space, can in memory space, carry out five equilibrium according to data type to continuous memory space; Each five equilibrium is as a memory cell; Be used to store the index management information of an interface, and, use minimum machine instruction to navigate to corresponding memory cell according to the sequence number of each memory cell; Specifically can adopt the array mode, the subscript of array promptly is equivalent to sequence number.
Existing a kind of interface index Managed Solution is following:
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 is as the index stores space; Index management information through wherein each memory cell is preserved each interface comprises interface index and interface pointer.When the distribution interface index, with the serial number of continuous integral number from small to large interface index as each interface, and the index management information that interface index is corresponding, be saved in sequence number in the memory cell of this serial number.
Adopt this scheme, interface index can provide the fast access mode through interface index query interface information directly as the sequence number of memory cell.But each interface index is the Serial No. of a linearity in this scheme, can't embody the interface type characteristic, so can't realize the interface management operation based on interface type through interface index.
In order to realize interface management operation based on interface type, another kind of interface management scheme is proposed in the 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 the corresponding index stores space of this interface type; And, be saved in the corresponding index stores space of this kind interface type, and be the type number that every kind of interface type distributes correspondence the index management information of the interface of every kind of interface type.Accordingly; The interface index of an interface comprises the 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 the index management information that interface index is corresponding; Be saved in interface index in the corresponding index stores space of type number in sequence number be in the memory cell of the serial number in the interface index, Fig. 3 is ATM style interface and EtherType interface interface index Managed Solution sketch map separately.
When needs are inquired about the interface message of the corresponding interface of an interface index; At first according to the type number in this interface index; Confirm the corresponding index stores space of the type numbering; Then according to the serial number in the interface index, confirm to preserve the memory cell of the corresponding index management information of this interface index, and based on the interface message of the corresponding interface of this interface index of the index management information inquiry of 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 can't know the quantity of every type the interface that this equipment will be set up in advance; So in this scheme; Need 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 the memory space of reserving for whole interface types is can be by whole utilizations, so caused the waste of memory space; The quantity of the interface type of the interface of setting up is big more, and the waste of memory space is many more.
Summary of the invention
The embodiment of the invention provides a kind of interface index method for building up, interface message querying method and device, in order to solve exist in the prior art carry out the interface index management based on interface type the time waste of storage space that causes problem.
The embodiment of the invention provides a kind of interface index method for building up, comprising:
Confirm the interface type of the specified interface of designated equipment;
The quantity of the interface index of definite said interface type of having set up;
Be said specified interface distribution interface index, wherein, said interface index comprises type number and the serial number that said interface type is corresponding, and the serial number in the said interface index is that said quantity adds 1 value that obtains;
Interface pointer with said specified interface; Be kept in the designated memory cell in the index stores space of distributing for said designated equipment; Wherein, when the said quantity of confirming was 0, the sequence number of this designated memory cell added 1 value that obtains for the quantity of the total interface index set up; When the said quantity of confirming non-0 the time; The sequence number of this designated memory cell is that the corresponding start sequence number of said interface type adds the above serial number and deducts 1 value that obtains again, and said start sequence number is in said index stores space, preserves the sequence number of memory cell of interface pointer of first interface of said interface type.
The embodiment of the 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:
Based on the type number in the specified interface index, confirm the interface type of said specified interface index;
Confirm the start sequence number that said interface type is corresponding;
Confirm that said start sequence number adds serial number in the above specified interface index and deducts 1 value that obtains again;
Obtain the interface pointer of sequence number for the corresponding interface of the said specified interface index preserved in the memory cell of this value;
Inquire about the interface message of the corresponding interface of said specified interface index based on the said interface pointer of obtaining.
The embodiment of the invention also provides a kind of interface index apparatus for establishing, comprising:
Type is confirmed the unit, is used for the interface type of the specified interface of definite designated equipment;
Quantity is confirmed the unit, is used for the quantity of the interface index of definite said interface type of having set up;
The index assignment unit is used to said specified interface distribution interface index, and wherein, said interface index comprises type number and the serial number that said interface type is corresponding, and the serial number in the said interface index is that said quantity adds 1 value that obtains;
Preserve the unit; Be used for interface pointer, be kept in the designated memory cell in the index stores space of distributing into said designated equipment, wherein said specified interface; When the said quantity of confirming is 0; The sequence number of this designated memory cell adds 1 value that obtains for the quantity of the total interface index set up, and non-0 the time when the said quantity of confirming, the sequence number of this designated memory cell is that the corresponding start sequence number of said interface type adds the above serial number and deducts 1 value that obtains again; Said start sequence number is in said index stores space, preserves the sequence number of memory cell of interface pointer of first interface of said interface type.
The embodiment of the 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 is confirmed the unit, is used for the type number based on the specified interface index, confirms the interface type of said specified interface index;
First sequence number is confirmed the unit, is used for the start sequence number of confirming that said interface type is corresponding;
Second sequence number is confirmed the unit, is used for confirming that serial number that said start sequence number adds the above specified interface index deducts 1 value that obtains again;
The pointer acquiring unit is used for obtaining the interface pointer of the corresponding interface of said specified interface index that sequence number preserves for the memory cell of this value;
Query unit is used for inquiring about based on the said interface pointer of obtaining the interface message of the corresponding interface of said specified interface index.
In the method that the embodiment of the invention provides; The interface pointer that can preserve dissimilar interfaces in the index stores space for the designated equipment distribution; When setting up interface index to specified interface, the quantity of the interface index of the interface type of at first definite this specified interface of having set up, and when this quantity of confirming 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, non-0 the time when this quantity of confirming, the sequence number of this designated memory cell adds that for the corresponding start sequence number of this interface type the serial number in the interface index of distribution deducts 1 value again; Make in the index stores space; Be 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 distributes the memory cell with the maximum interface quantity of this designated equipment to be equal to get final product.
And; Can also make that the interface pointer of interface of same-interface type is to be kept in the continuous memory cell of sequence number; And the interface index that distributes for specified interface comprises type number and serial number; Thereby make the time according to the interface message of interface index query interface; Can confirm interface type based on the type number in the specified interface index, and the quantity and corresponding start sequence number of the interface index of this interface type of confirming to have set up, and determine the memory cell of the interface pointer of preserving the corresponding interface of this specified interface index; And from this memory cell, obtain the interface pointer of preservation, thereby inquire the interface message of the corresponding interface of this specified interface index.
Therefore, the scheme that adopts the embodiment of the invention to provide the interface index management is carried out in realization based on interface type when, has reduced the waste in index stores space.
Description of drawings
Fig. 1 is an index stores of the prior art space sketch map;
Fig. 2 is one of realization sketch map of interface index Managed Solution of the prior art;
Fig. 3 be interface index Managed Solution of the prior art the realization sketch map two;
The flow chart of the interface index method for building up that Fig. 4 provides for the embodiment of the invention;
The flow chart of the interface message querying method that Fig. 5 provides for the embodiment of the invention;
Fig. 6 is the flow chart of the interface index method for building up in the embodiment of the invention 1;
Fig. 7 is one of realization sketch map of interface index management in the embodiment of the invention 1;
Fig. 8 be interface index management in the embodiment of the invention 1 the realization sketch map two;
Fig. 9 is the flow chart of interface message querying method in the embodiment of the invention 2;
Figure 10 is the structural representation of interface index apparatus for establishing in the embodiment of the invention 3;
Figure 11 is the structural representation of interface message inquiry unit in the embodiment of the invention 4.
Embodiment
When carrying out the interface index management based on interface type in order to be given in realization; Reduced the implementation of the waste in index stores space; The embodiment of the 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 is described, and is to be understood that; Preferred embodiment described herein only is used for explanation and explains the present invention, and is not used in qualification the present invention.And under the situation of not conflicting, embodiment and the characteristic among the embodiment among the application can make up each other.
The embodiment of the invention provides a kind of interface index method for building up, and is as shown in Figure 4, comprising:
Step S401, confirm 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 that obtains for this quantity.
Step S404, with 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 confirming was 0, the sequence number of this designated memory cell added 1 value that obtains for the quantity of the total interface index set up; When this quantity of confirming non-0 the time; The sequence number of this designated memory cell deducts 1 value that obtains again for the corresponding start sequence number of this interface type adds this serial number, and 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, based on the interface index that adopts above-mentioned interface index method for building up to set up, the embodiment of the invention also provides a kind of interface message querying method, and is as shown in Figure 5, comprising:
Step S501, based on the type number in the specified interface index, confirm the interface type of specified interface index.
Step S502, confirm the start sequence number that this interface type is corresponding.
Step S503, confirm that this start sequence number adds that the serial number in the specified interface index deducts 1 value again.
Step S504, obtain the interface pointer of sequence number for the corresponding interface of the specified interface index preserved in the memory cell of this value.
Step S505, based on the interface message of the corresponding interface of this interface pointer inquiry specified interface index that obtains.
Below in conjunction with accompanying drawing, method provided by the invention and device are described in detail with specific embodiment.
Embodiment 1:
Fig. 6 is the flow chart of the interface index method for building up that provides in the embodiment of the invention 1, specifically comprises following treatment step:
Step S601, confirm 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.
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 in the present embodiment 1 at every turn, and preserve, can directly obtain this quantity of current saved in this step.
Whether this quantity that step S603, judgement are confirmed is 0, if be 0, gets into step S604, otherwise, get into step S606.
Step S604, when this quantity is 0, the interface index of this interface type is not also set up in expression, will be the 1st interface index of the interface index of this interface type for the interface index that this specified interface distributes.
Be this specified interface distribution interface index; In the present embodiment 1; Interface index comprises type number and serial number; Then for the type number in the interface index of this specified interface distribution is the corresponding type number of this interface type, because this interface index is the 1st interface index of the interface index of this interface type, the serial number in the interface index that then distributes is 1.
Concrete; Interface index can use 4 bytes to amount to 32 to represent that wherein most-significant byte is used to represent type number, and low 24 are used for the order of representation numbering; For example; In the present embodiment 1, the type number of distributing for EtherType is 0x01 (wherein 0x representes the hexadecimal counting), and the type number of distributing for the ATM type is 0x02; And confirm that the interface type of specified interface is the ATM type among the hypothesis above-mentioned steps S601, then be that the interface index of this specified interface distribution of ATM type is 0x020001 in this step.
Step S605, after being this specified interface distribution interface index; In the index stores space of distributing for this designated equipment; Confirm to be used to preserve 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, preferable, can also the interface index that distribute for this specified interface be kept in this designated memory cell.
In the present embodiment 1; When being designated equipment allocation index memory space; Can so that save the memory space of index stores space hold as much as possible, reduce the waste of memory space so that the quantity of memory cell is for the maximum interface quantity of this designated equipment in the index stores space of being distributed.
The array mode specifically can be adopted in the index stores space; Be this designated equipment allocation index array; The subscript of array of indexes promptly is equivalent to sequence number, in order to make the subscript of array of indexes consistent with sequence number, can be provided with the array element space of not using subscript 0; And begin 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 sequence number of confirming this designated memory cell adds 1 value that obtains for the quantity of the total interface index set up; 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 this designated memory cell of the interface pointer of then definite this specified interface of preservation is the value that 2+1 obtains, and is 3.It is in 3 the memory cell that the interface pointer that is about to this specified interface is kept at sequence number.
Step S606, when this quantity non-0 the time; Expression has established the interface index of this interface type; Then confirm the start sequence number that this interface type is corresponding in this step; 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 this start sequence number after, preserve this start sequence number, and directly obtain in use and get final product.
Step S607, be this specified interface distribution interface index; In the present embodiment 1; Interface index comprises type number and serial number; Type number in the interface index that then distributes for this specified interface be the corresponding type number of this interface type, and the serial number in the interface index of distribution is that this definite among above-mentioned steps S602 quantity adds 1 value that obtains.
Concrete, interface index can use 4 bytes to amount to 32 to represent that wherein most-significant byte is used to represent type number; Low 24 are used for the order of representation numbering; For example, in the present embodiment 1, the type number of distributing for EtherType is 0x01 (wherein 0x representes the hexadecimal counting); The type number of distributing for the ATM type is 0x02; And confirm that the interface type of specified interface is the ATM type among the hypothesis above-mentioned steps S601, and this definite quantity is 2 among the above-mentioned steps S602, then is that the interface index of this specified interface distribution of ATM type is 0x020003 in this step.
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; Confirm to be used to preserve 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.
Preferable; Can also the interface index that distribute for this specified interface be kept in this designated memory cell; Be used for follow-up the time according to the corresponding interface message of specified interface search index; Whether with the specified interface index of desire inquiry consistent, so that confirm the interface pointer of preserving in this memory cell more accurately, be the interface pointer of the interface of this specified interface index correspondence if can compare the interface pointer of preserving in the memory cell in advance; Obviously, in the time the time need not carrying out this affirmation in inquiry and handle, saving interface index not in the memory cell.
In order to realize, and make that the interface pointer of interface of same-interface type is to remain in the continuous memory cell of sequence number, in this step according to the continuous use memory cell of sequence number order from small to large; The sequence number of confirming this designated memory cell adds that for this start sequence number the serial number in the interface index of distribution deducts 1 value that obtains again; 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 the corresponding start sequence number of ATM type is 3, and the sequence number of this designated memory cell of the interface pointer of then definite this specified interface of preservation is the value that 3+3-1 obtains, and is 5.It is in 5 the memory cell that the interface pointer that is about to this specified interface is kept at sequence number.
Through above-mentioned step S601-step S608 shown in Figure 6; In a continuous index stores space of distributing, realized the distribution of dissimilar interface indexs and the preservation of index management information, and; Make in the index stores space; Be 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 distributes the memory cell with the maximum interface quantity of this designated equipment to be equal to get final product; Compare the scheme that is respectively every kind of interface type allocation index memory space in the prior art, reduced the waste in index stores space.
When being directed against interface quantity and the known equipment of interface type; When adopting method shown in Figure 6 to set up interface index; Can set up the interface index of various interface type successively, promptly after having set up a kind of total interface index of interface type, set up a kind of interface index of interface type down again.
Yet, on the basis of setting up interface index, when having set up new interface; And need set up interface index for this new interface the time, the corresponding start sequence number of interface type of this new interface possibly appear, less than the corresponding start sequence number of other interface type; Expression is according to sequence number order from small to large, in the memory cell of the back of the memory cell of the interface pointer of last interface of preserving this interface type, and the interface pointer of also preserving the interface of other interface type; So,, preferable 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; In this case, after above-mentioned steps S606, before above-mentioned steps S608; Also comprise: judge that whether the corresponding start sequence number of other interface type is greater than the corresponding start sequence number of the interface type of this specified interface; If greater than, the interface pointer of the interface index corresponding interface of this other interface type that then will set up is kept in the next memory cell of its former memory cell; If be not more than, then direct execution in step S608.
Embodiment 2:
Based on the interface index of setting up in the foregoing description 1, present embodiment 2 provides a kind of interface message querying method, and is as shown in Figure 9, specifically comprises following treatment step:
Step S901, when the interface message of the corresponding interface of needs inquiries specified interface index, at first obtain the type number in this specified interface index.
Step S902, based on the type of obtaining numbering, confirm the interface type of this specified interface index.
Be specially corresponding relation, confirm the corresponding interface type of the type numbering based on type number and interface type.
Step S903, confirm the start sequence number that this interface type is corresponding.
Step S904, confirm that this start sequence number adds that serial number in this this specified interface index deducts 1 value that obtains again, this value that obtains is the sequence number of the memory cell of the index management information of preserving the corresponding interface of this interface index.
Step S905, obtain the index management information of sequence number, specifically comprise interface index and the interface pointer of obtaining preservation for preserving in the memory cell of this value.
Whether the interface pointer that step S906, judgement are obtained from this memory cell is consistent with the specified interface pointer, if consistent, gets into step S907, otherwise, get into step S908.
Step S907, based on the interface pointer of from this memory cell, obtaining, inquire about the interface message of the corresponding interface of this specified interface index.Concrete inquiry mode can adopt the whole bag of tricks of the prior art, no longer is described in detail at this.
Whether step S908, the interface pointer of from this memory cell, obtaining be inconsistent with the specified interface pointer, and the index management information of expression storage is wrong, cancels the inquiry of this interface message.
Interface index method for building up in the employing embodiment of the invention 1 and the interface message querying method among the embodiment 2 have been realized carrying out the interface index management based on interface type, and have been reduced the waste in index stores space.
Embodiment 3:
Based on same inventive concept, according to the interface index method for building up that the above embodiment of the present invention provides, correspondingly, the embodiment of the invention 3 also provides a kind of interface index apparatus for establishing, and its structural representation is shown in figure 10, specifically comprises:
Type is confirmed unit 1001, is used for the interface type of the specified interface of definite designated equipment;
Quantity is confirmed unit 1002, is used for the quantity of the interface index of definite said interface type of having set up;
Index assignment unit 1003 is used to said specified interface distribution interface index, and wherein, said interface index comprises type number and the serial number that said interface type is corresponding, and the serial number in the said interface index is that said quantity adds 1 value that obtains;
Preserve unit 1004; Be used for interface pointer, be kept in the designated memory cell in the index stores space of distributing into said designated equipment, wherein said specified interface; When the said quantity of confirming is 0; The sequence number of this designated memory cell adds 1 value that obtains for the quantity of the total interface index set up, and non-0 the time when the said quantity of confirming, the sequence number of this designated memory cell is that the corresponding start sequence number of said interface type adds the above serial number and deducts 1 value that obtains again; Said start sequence number is in said index stores space, preserves the sequence number of memory cell of interface pointer of first interface of said interface type.
Preferable; Preserve unit 1004, also be used for when definite said quantity non-0 the time, in interface pointer with said specified interface; Before being kept in the designated memory cell in the said index stores space; When the corresponding start sequence number of other interface type during greater than the corresponding start sequence number of said interface type, the interface pointer with the interface index corresponding interface of said other interface type of having set up is kept in the next memory cell of its former memory cell.
Preferable, preserve unit 1004, also be used for after said index assignment unit 1003 is for said specified interface distribution interface index, the said interface index with distributing is kept in the said designated memory cell in the said index stores space.
Embodiment 4:
Based on same inventive concept, according to the interface message querying method that the above embodiment of the present invention provides, correspondingly, the embodiment of the invention 4 also provides a kind of interface message inquiry unit, and its structural representation is shown in figure 11, specifically comprises:
Type is confirmed unit 1101, is used for the type number based on the specified interface index, confirms the interface type of said specified interface index;
First sequence number is confirmed unit 1102, is used for the start sequence number of confirming that said interface type is corresponding;
Second sequence number is confirmed unit 1103, is used for confirming that serial number that said start sequence number adds the above specified interface index deducts 1 value that obtains again;
Pointer acquiring unit 1104 is used for obtaining the interface pointer of the corresponding interface of said specified interface index that sequence number preserves for the memory cell of this value;
Query unit 1105 is used for inquiring about based on the said interface pointer of obtaining the interface message of the corresponding interface of said specified interface index.
Preferable, also comprise:
Index acquiring unit 1106; Be used for when preserving interface index in the memory cell in said index stores space; Before said pointer acquiring unit 1104 obtains the interface pointer of sequence number corresponding interface for the said specified interface index preserved in the memory cell of this value, obtain the interface index of sequence number for preserving in the memory cell of this value;
Unit 1107 confirmed in index, is used to confirm that the interface index that obtains is said specified interface index.
In sum, in the scheme that the embodiment of the invention provides, when setting up interface index, comprising: the interface type of confirming the specified interface of designated equipment; The quantity of the interface index of definite this interface type of having set up; 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 that obtains for this quantity; Interface pointer with specified interface; Be kept in the designated memory cell in the index stores space of distributing for designated equipment; Wherein, when this quantity of confirming was 0, the sequence number of this designated memory cell added 1 value that obtains for the quantity of the total interface index set up; When this quantity of confirming non-0 the time; The sequence number of this designated memory cell deducts 1 value that obtains again for the corresponding start sequence number of this interface type adds this serial number, and 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:, confirm the interface type of specified interface index based on the type number in the specified interface index; Confirm the start sequence number that this interface type is corresponding; Confirm that this start sequence number adds that the serial number in the specified interface index deducts 1 value again; Obtain the interface pointer of sequence number for the corresponding interface of the specified interface index preserved in the memory cell of this value; Interface message based on the corresponding interface of this interface pointer inquiry specified interface index that obtains.
The scheme that adopts the embodiment of the invention to provide the interface index management is carried out in realization based on interface type when, has reduced the waste in index stores space.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, belong within the scope of claim of the present invention and equivalent technologies thereof if of the present invention these are revised with modification, then the present invention also is intended to comprise these changes and modification interior.

Claims (11)

1. an interface index method for building up is characterized in that, comprising:
Confirm the interface type of the specified interface of designated equipment;
The quantity of the interface index of definite said interface type of having set up;
Be said specified interface distribution interface index, wherein, said interface index comprises type number and the serial number that said interface type is corresponding, and the serial number in the said interface index is that said quantity adds 1 value that obtains;
Interface pointer with said specified interface; Be kept in the designated memory cell in the index stores space of distributing for said designated equipment; Wherein, when the said quantity of confirming was 0, the sequence number of this designated memory cell added 1 value that obtains for the quantity of the total interface index set up; When the said quantity of confirming non-0 the time; The sequence number of this designated memory cell is that the corresponding start sequence number of said interface type adds the above serial number and deducts 1 value that obtains again, and said start sequence number is in said index stores space, preserves the sequence number of memory cell of interface pointer of first interface of said interface type.
2. the method for claim 1 is characterized in that, when the said quantity of confirming non-0 the time, in interface pointer with said specified interface, be kept in the designated memory cell in the said index stores space before, also comprise:
When the corresponding start sequence number of other interface type during greater than the corresponding start sequence number of said interface type, the interface pointer with the interface index corresponding interface of said other interface type of having set up is kept in the next memory cell of its former memory cell.
3. the method for claim 1 is characterized in that, after being said specified interface distribution interface index, also comprises:
Said interface index with distributing is kept in the said designated memory cell in the said index stores space.
4. like the arbitrary described method of claim 1-3, it is characterized in that the quantity of memory cell is the maximum interface quantity of said designated equipment in the said index stores space.
5. the interface message querying method based on the interface index of the said method foundation of claim 1 is characterized in that, comprising:
Based on the type number in the specified interface index, confirm the interface type of said specified interface index;
Confirm the start sequence number that said interface type is corresponding;
Confirm that said start sequence number adds serial number in the above specified interface index and deducts 1 value that obtains again;
Obtain the interface pointer of sequence number for the corresponding interface of the said specified interface index preserved in the memory cell of this value;
Inquire about the interface message of the corresponding interface of said specified interface index based on the said interface pointer of obtaining.
6. method as claimed in claim 5; It is characterized in that; When preserving interface index in the memory cell in the said index stores space, before the interface pointer of obtaining sequence number corresponding interface, also comprise for the said specified interface index preserved in the memory cell of this value:
Obtain the interface index of sequence number for preserving in the memory cell of this value;
Confirm that the interface index that obtains is said specified interface index.
7. an interface index apparatus for establishing is characterized in that, comprising:
Type is confirmed the unit, is used for the interface type of the specified interface of definite designated equipment;
Quantity is confirmed the unit, is used for the quantity of the interface index of definite said interface type of having set up;
The index assignment unit is used to said specified interface distribution interface index, and wherein, said interface index comprises type number and the serial number that said interface type is corresponding, and the serial number in the said interface index is that said quantity adds 1 value that obtains;
Preserve the unit; Be used for interface pointer, be kept in the designated memory cell in the index stores space of distributing into said designated equipment, wherein said specified interface; When the said quantity of confirming is 0; The sequence number of this designated memory cell adds 1 value that obtains for the quantity of the total interface index set up, and non-0 the time when the said quantity of confirming, the sequence number of this designated memory cell is that the corresponding start sequence number of said interface type adds the above serial number and deducts 1 value that obtains again; Said start sequence number is in said index stores space, preserves the sequence number of memory cell of interface pointer of first interface of said interface type.
8. device as claimed in claim 7; It is characterized in that; Said preservation unit, also be used for when the said quantity of confirming non-0 the time, in interface pointer with said specified interface; Before being kept in the designated memory cell in the said index stores space; When the corresponding start sequence number of other interface type during greater than the corresponding start sequence number of said interface type, the interface pointer with the interface index corresponding interface of said other interface type of having set up is kept in the next memory cell of its former memory cell.
9. device as claimed in claim 7; It is characterized in that said preservation unit also is used for after said index assignment unit is said specified interface distribution interface index; Said interface index with distributing is kept in the said designated memory cell in the said index stores space.
10. the interface message inquiry unit based on the interface index of the said device foundation of claim 7 is characterized in that, comprising:
Type is confirmed the unit, is used for the type number based on the specified interface index, confirms the interface type of said specified interface index;
First sequence number is confirmed the unit, is used for the start sequence number of confirming that said interface type is corresponding;
Second sequence number is confirmed the unit, is used for confirming that serial number that said start sequence number adds the above specified interface index deducts 1 value that obtains again;
The pointer acquiring unit is used for obtaining the interface pointer of the corresponding interface of said specified interface index that sequence number preserves for the memory cell of this value;
Query unit is used for inquiring about based on the said interface pointer of obtaining the interface message of the corresponding interface of said specified interface index.
11. device as claimed in claim 10 is characterized in that, also comprises:
The index acquiring unit; Be used for when preserving interface index in the memory cell in said index stores space; Before said pointer acquiring unit obtains the interface pointer of sequence number corresponding interface for the said specified interface index preserved in the memory cell of this value, obtain the interface index of sequence number for preserving in the memory cell of this value;
The unit confirmed in index, is used to confirm that the interface index that obtains is said 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 true CN102394943A (en) 2012-03-28
CN102394943B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701726A (en) * 2013-12-31 2014-04-02 上海斐讯数据通信技术有限公司 Interface index managing method and system 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 (2)

* 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
US20100284378A1 (en) * 2006-06-15 2010-11-11 Nokia Siemens Networks S.P.A. Method for packet classification based on the protocol type and on priorities

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100284378A1 (en) * 2006-06-15 2010-11-11 Nokia Siemens Networks S.P.A. Method for packet classification based on the protocol type and on priorities
CN101192949A (en) * 2006-11-24 2008-06-04 中兴通讯股份有限公司 An interface index method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701726A (en) * 2013-12-31 2014-04-02 上海斐讯数据通信技术有限公司 Interface index managing method and system of core switch
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

Also Published As

Publication number Publication date
CN102394943B (en) 2014-01-22

Similar Documents

Publication Publication Date Title
CN102801599B (en) A kind of communication means and system
CN104348724B (en) A kind of data forwarding method and device for supporting multi-tenant
CN104581419B (en) Double net implementation methods based on android Intelligent set top boxes
CN103814554B (en) A kind of communication means of virtual easily extensible local area network (LAN), device and system
CN102340411B (en) A kind of server information data management method and system
CN103607308A (en) Virtual machine multi-network management system and method in cloud computing environment
CN103701726B (en) The interface index management method and system of a kind of core switch
CN102769667A (en) Method, equipment and system for generating ID
CN108616402B (en) Management method and system of remote equipment
CN101072158A (en) Method for releasing and processing virtual circuit information and supplier edge device
CN101335648A (en) Automatic converting method for packets of different interfaces and apparatus thereof
CN104243608B (en) A kind of communication means, cloud management server and virtual switch
CN105099950A (en) Resource allocation method, message communication method and devices
CN102938795A (en) Method for achieving access to internet protocol version 4 (IPv4) resources by IPv6 through tunnel and address
CN102394943B (en) Interface index establishment method and apparatus thereof, and interface information query method and apparatus thereof
CN108418766A (en) Band width control method, device and system
CN107426348A (en) A kind of automatic management method and system of IP address
CN104168138A (en) Electric power communication network system centralized topology generation and display method
CN1984419A (en) Method and device for arranging data
CN110166857A (en) A kind of implementation method of fibre channel media dynamic configuration
CN104869011A (en) Circuit dispatching method and circuit dispatching device
CN105610672B (en) A kind of method and device of information transmission
CN105591801A (en) Virtual network function VNF fault processing method and VNF management equipment
CN103634877A (en) Management method for AP (access point) in AC (access controller)-free network and AP equipment
CN116566830A (en) Network configuration method, device, system, edge equipment and 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

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.

CP01 Change in the name or title of a patent holder