The content of the invention
In order to overcome above-mentioned deficiency of the prior art, it is an object of the invention to provide a kind of facility information loading sideMethod, methods described includes:
The network equipment obtains startup file bag, and the startup file bag includes image file and facility information file, instituteStating facility information file includes the identity of the network equipment and facility information corresponding with the identity;
In image file described in the network equipment start-up loading, the equipment letter is extracted from the startup file bagBreath file;
The identity of present networks equipment is obtained, the identity according to the network equipment is in the facility information fileCorresponding facility information is searched, and the facility information is loaded to the equipment information database of the network device operating systemIn.
Further, in the above-mentioned methods, the facility information file is stored in the startup file bag after being compressed;It is described the step of extract the facility information file from the startup file bag, including:
The facility information file of compression is extracted from the startup file bag and is decompressed, read setting after decompressionData in standby message file;
The data that will be read are preserved into internal memory.
Further, in the above-mentioned methods, the facility information file after the decompression is XML file;It is described from describedThe facility information file of compression is extracted in startup file bag and is decompressed, in the facility information file after reading decompressionThe step of data, also include:
The facility information file of compression is extracted from the startup file bag and decompression is reduced to XML file;
XML file after decompression is verified, after verification passes through, in the XML file after the reading decompressionData.
Further, in the above-mentioned methods, the data that will be read preserve the step into internal memory, including:
The Content Organizing that will be read from the facility information file after the decompression for binary tree structure storage toIn internal memory.
Further, in the above-mentioned methods, the identity according to the network equipment is in the facility information fileCorresponding facility information is searched, and the facility information is loaded to the equipment information database of the network device operating systemIn step, including:
Identity according to the network equipment searches corresponding facility information in the facility information data;
The facility information that will be found is loaded into the equipment information database of the network equipment, and discharges the equipment letterThe internal memory that breath data take.
Further, in the above-mentioned methods, before the network equipment obtains startup file bag, methods described is also wrappedInclude:
The configuration information of input is received, the facility information file is generated according to the configuration information;
The facility information file is compressed, and the startup text is generated as together with the image file of the network equipmentPart bag;
The startup file bag is sent to the network equipment.
Another object of the present invention is to a kind of network equipment, including:
Acquisition module, for obtaining startup file bag, the startup file bag includes image file and facility information textPart, the facility information file includes the identity of the network equipment and facility information corresponding with the identity;AndThe identity of the network equipment where for obtaining;
Extraction module, in image file described in equipment start-up loading, extracting described from the startup file bagFacility information file;
Information loading module, for being searched in the facility information file according to the identity of the network equipment for obtainingCorresponding facility information, and the facility information is loaded into the equipment information database of the network device operating system.
Further, in the above-mentioned network equipment, the facility information file is stored in the startup file after being compressedBao Zhong;The extraction module includes:
File extracting sub-module, for extracting the facility information file of compression from the startup file bag and being decompressedContracting, reads the data in the facility information file after decompression;
Submodule is preserved, the data for that will read are preserved into internal memory.
Further, in the above-mentioned network equipment, the facility information file after the decompression is XML file;The textPart extracting sub-module extracts the mode of data in the facility information file, including:
The facility information file of compression is extracted from the startup file bag and decompression is reduced to XML file;
XML file after decompression is verified, after verification passes through, in the XML file after the reading decompressionData.
Further, in the above-mentioned network equipment, the submodule that preserves protects the data in the facility information fileThe mode into internal memory is deposited, including:
The Content Organizing that will be read from the facility information file is stored in internal memory for the structure of binary tree.
Further, in the above-mentioned network equipment, the mode of described information loading module charging appliance information, including:
Identity according to the network equipment searches corresponding facility information in the facility information data;
The facility information that will be found is loaded into the equipment information database of the network equipment, and discharges the equipment letterThe internal memory that breath data take.
In terms of existing technologies, the invention has the advantages that:
Facility information loading method and the network equipment that the present invention is provided, by configuring unified facility information file, netNetwork equipment obtains the facility information file and image file of packing, is loaded automatically according to configuration information file when system starts and setThe mode of standby information, realizes the unified management of facility information, improves the efficiency of facility information loading configuration, and reduceError probability.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present inventionIn accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment isA part of embodiment of the present invention, rather than whole embodiments.Present invention implementation generally described and illustrated in accompanying drawing hereinThe component of example can be arranged and designed with a variety of configurations.
Therefore, the detailed description of embodiments of the invention below to providing in the accompanying drawings is not intended to limit claimedThe scope of the present invention, but be merely representative of selected embodiment of the invention.Based on the embodiment in the present invention, this area is commonThe every other embodiment that technical staff is obtained under the premise of creative work is not made, belongs to the model of present invention protectionEnclose.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang YiIt is defined in individual accompanying drawing, then it need not be further defined and explained in subsequent accompanying drawing.
Fig. 1 is refer to, is that management terminal 200 and the network equipment 100 that present pre-ferred embodiments are provided interact signalFigure.
In the present embodiment, the management terminal 200 generates unified facility information file cocurrent and gives the network and setsStandby 100, the network equipment 100 is obtained and loading equipemtn information automatically according to the facility information configuration file on startup.
In the present embodiment, the management terminal 200 may be, but not limited to, PC (personal computer, personal electricityBrain), web (website) server, ftp (file transfer protocol, FTP) server etc..The networkEquipment 100 may be, but not limited to, interchanger, router or other network communication equipments etc..
Fig. 2 is refer to, a kind of flow chart of facility information loading method that Fig. 2 is provided for the present embodiment below will be to instituteMethod is stated to be described in detail including each step.
Step S110, the network equipment obtains startup file bag, and the startup file bag includes image file and equipment letterBreath file, the facility information file includes the identity of the network equipment 100 and equipment corresponding with the identityInformation.
In the present embodiment, the network equipment 100 obtains the startup file bag of the generation of the management terminal 200.The image file can include the network equipment 100 network operating system (Internetwork Operating System,IOS) file.
Specifically, the management terminal 200 receives the configuration information of input, and the equipment is generated according to the configuration informationMessage file, the facility information file includes the identity of each network equipment 100 and the corresponding relation of facility information.At thisIn embodiment, the management terminal 200 can receive the configuration information of input by a management software.It is described by unified configurationThe mode of facility information file realizes the unified management of facility information, it is to avoid need on stream for each networkEquipment 100 individually carries out equipment information management, and the configuration information is generated as into the file of XML format to facilitate transmission.
In the present embodiment, the identity can be, but be not limited only to the device id of the network equipment 100, model orMAC Address etc. can represent the mark of the unique identities of the network equipment 100.The facility information can include but not limited to netThe information such as device name, board title, the version information of network equipment 100.
200 pairs of generation facility information files of the management terminal are compressed, and literary with the image of the network equipment 100Part is generated as the startup file bag together, and the startup file bag then is sent into the network equipment 100 is stored.In the present embodiment, can also be to the facility information text when facility information file of the management terminal 200 pairs is compressedPart is encrypted, with mode information leakage.
In the present embodiment, can pass through when carrying out firmware upgrade to the network equipment 100 or dispatching from the factory initialization firmwareFTP or TFTP are stored in downloading to the memory 120 of the network equipment 100.
Step S120, in image file described in the start-up loading of the network equipment 100, carries from the startup file bagTake the facility information file.
Specifically, the network equipment 100 is in image file described in equipment start-up loading, actively from the startup fileThe facility information file is extracted in bag and is decompressed, be reduced to XML file, then the XML file after decompression is enteredRow verification.
With to be used in the data and preservation to internal memory in reading XML file after verification passes through.In the present embodiment, may be usedWith in by the Content Organizing in the facility information file as the structure storage of binary tree to internal memory, to improve the network equipment100 speed for searching corresponding device information.
Step S130, obtains the identity of present networks equipment 100, and the identity according to the network equipment 100 existsCorresponding facility information is searched in the facility information file, and the facility information is loaded to the network equipment 100 is operatedIn the equipment information database of system.
The network equipment 100 searches corresponding equipment letter according to the identity of itself in the facility information fileBreath.After corresponding facility information is found, the facility information is loaded to the equipment information database of the network equipment 100In, and discharge the internal memory that the facility information file takes.
The network equipment 100 need the facility information is shown or is called when, from the facility information numberAccording to the facility information that the network equipment 100 is obtained in storehouse.
Based on the facility information loading method that above-mentioned design, the present embodiment are provided, by the way that ios file and facility information is literaryPart packing is stored to the network equipment 100 so that the network equipment 100 is in activation system automatically according to described in unified configurationFacility information file loads the corresponding facility information of the network equipment 100.On the one hand, by the facility information file of unified configurationMode makes the management of information more facilitate, and reduces error probability;On the other hand, loaded automatically by according to facility information fileThe mode of facility information, it is to avoid need to carry out ios code respectively for the different network equipments when equipment development or upgradingExploitation is safeguarded, improves exploitation or the efficiency safeguarded.
Fig. 3 is refer to, the present embodiment also provides a kind of network equipment, including:Acquisition module 111, extraction module 112 andInformation loading module 113.
The acquisition module 111, for obtaining startup file bag, the startup file bag includes image file and equipmentMessage file, the facility information file includes the identity of the network equipment 100 and corresponding with the identity setsStandby information.The acquisition module 111 is additionally operable to obtain the identity of the place network equipment.
In the present embodiment, the acquisition module 111 can be used to perform the step S110 shown in Fig. 3, on the acquisition mouldThe specific descriptions of block 111 can join the description to the step S110.
The extraction module 112, in image file described in equipment start-up loading, being carried from the startup file bagTake the facility information file.
In the present embodiment, the extraction module 112 can be used to perform the step S120 shown in Fig. 3, on the extraction mouldThe specific descriptions of block 112 can join the description to the step S120.
Further, in the present embodiment, the facility information file is stored in the startup file bag after being compressed,The extraction module 112 includes:File extracting sub-module and preservation submodule.
The file extracting sub-module, for extracting the facility information file of compression from the startup file bag and carrying outDecompression, reads the data in the facility information file after decompression.
Specifically, the facility information file after the decompression is XML file, and the file extracting sub-module is extracted describedThe mode of data in facility information file, including:
The facility information file of compression is extracted from the startup file bag and decompression is reduced to XML file.
XML file after decompression is verified, after verification passes through, in the XML file after the reading decompressionData.
Submodule is preserved, the data for that will read are preserved into internal memory.
Specifically, the data in the facility information file are preserved the mode into internal memory by the preservation submodule, are wrappedInclude:
The Content Organizing that will be read from the facility information file is stored in internal memory for the structure of binary tree.
Described information loading module 113, for the identity according to the network equipment 100 in the facility information fileCorresponding facility information is searched, and the facility information is loaded to the facility information data of the operating system of the network equipment 100In storehouse.
In the present embodiment, described information loading module 113 can be used to perform the step S130 shown in Fig. 3, on the letterThe specific descriptions of breath loading module 113 can join the description to the step S130.
Specifically, the mode of the charging appliance information of described information loading module 113, including:
Identity according to the network equipment 100 searches corresponding facility information in the facility information data;
The facility information that will be found is loaded into the equipment information database of the network equipment 100, and is set described in releaseThe internal memory that standby information data takes.
In sum, the present invention is provided facility information loading method and the network equipment, are believed by configuring unified equipmentBreath file, the network equipment 100 obtains the facility information file and image file of packing, when system starts according to configuration information textThe mode of part automatic loading device information, realizes the unified management of facility information, improves the effect of facility information loading configurationRate, and the error probability for reducing.
In embodiment provided herein, it should be understood that disclosed apparatus and method, it is also possible to by otherMode realize.Device embodiment described above is only schematical, for example, the flow chart and block diagram in accompanying drawing showDevice, the architectural framework in the cards of method and computer program product, the function of multiple embodiments of the inventionAnd operation.At this point, each square frame in flow chart or block diagram can represent one the one of module, program segment or codePoint, a part for the module, program segment or code is used for the executable of the logic function that realization specifies comprising one or moreInstruction.It should also be noted that in some are as the implementation replaced, the function of being marked in square frame can also be with different from attachedThe order marked in figure occurs.For example, two continuous square frames can essentially be performed substantially in parallel, they also may be used sometimesTo perform in the opposite order, this is depending on involved function.It is also noted that each in block diagram and/or flow chartThe combination of the square frame in square frame and block diagram and/or flow chart, can with perform the function of regulation or the special of action based onThe system of hardware is realized, or can be realized with the combination of computer instruction with specialized hardware.
In addition, each functional module in each embodiment of the invention can integrate to form an independent portionDivide, or modules individualism, it is also possible to which two or more modules are integrated to form an independent part.
If the function is to realize in the form of software function module and as independent production marketing or when using, can be withStorage is in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other wordsThe part contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meterCalculation machine software product is stored in a storage medium, including some instructions are used to so that a computer equipment (can be individualPeople's computer, server, or network equipment etc.) perform all or part of step of each embodiment methods described of the invention.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are depositedReservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
It should be noted that herein, such as first and second or the like relational terms are used merely to a realityBody or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or deposited between operatingIn any this actual relation or order.And, term " including ", "comprising" or its any other variant be intended toNonexcludability is included, so that process, method, article or equipment including a series of key elements not only will including thoseElement, but also other key elements including being not expressly set out, or also include being this process, method, article or equipmentIntrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded thatAlso there is other identical element in process, method, article or equipment including the key element.
The preferred embodiments of the present invention are the foregoing is only, is not intended to limit the invention, for the skill of this areaFor art personnel, the present invention can have various modifications and variations.It is all within the spirit and principles in the present invention, made any repairChange, equivalent, improvement etc., should be included within the scope of the present invention.It should be noted that:Similar label and letter existsSimilar terms is represented in following accompanying drawing, therefore, once being defined in a certain Xiang Yi accompanying drawing, then it is not required in subsequent accompanying drawingIt is further defined and is explained.
The above, specific embodiment only of the invention, but protection scope of the present invention is not limited thereto, and it is anyThose familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all containCover within protection scope of the present invention.Therefore, protection scope of the present invention described should be defined by scope of the claims.