Network device software version information automatic checking method and systemTechnical field
The present invention relates to network device software version information and automatically detect and check technology, particularly the software module of each standalone feature module in the middle and high end equipment of multi-groove is carried out to the method and system that version information is checked.
Background technology
The network equipment of middle and high end often adopts multi-groove design, and dissimilar functional module can be installed in each groove position, and in each functional module, is moving various software module.Because software version exists the possibility of constantly upgrading and the demand of different client software version customization, software module kind, quantity integrated in functional module have multiple combination.Consistent with shipping list for guaranteeing the version information of all software modules, reviewer needs the version information of artificial nucleus to every each software module of equipment.During the delivery of equipment volume production, reviewer's workload will be multiplied, and the probability of makeing mistakes rises thereupon.Traditional artificial nucleus, to needing main control computer to be connected to the serial ports of equipment under test by Serial Port Line, then inputs various querying commands.If check the multiple devices software version information of same batch simultaneously, need to install serial server, introduce extra equipment and used burden.When user uses querying command to get the information of certain functional module, owing to there is no information filtering function, can only from a large amount of screen display informations, find out object information, be very easy to cause makeing mistakes and inefficiency.
Summary of the invention
Problem based on above artificial nucleus to existence, the object of this invention is to provide a kind of network device software version information automatic checking method, adopt succinct user interface (UI) accept user input, based on " concrete verification strategy corresponding to functional module " principle, can determine the software version information of concrete verification strategy, automatic Verification equipment under test and gather demonstration check results according to multistage verification unit, configuration file and equipment under test essential information.
The technical scheme that the present invention solve the technical problem employing is that network device software version information automatic checking method, comprises step:
A, equipment under test is connected by Ethernet with main control computer, and moves primary control program on main control computer;
B, equipment under test operational outfit are found module client, and scanning the machine essential information also reports primary control program;
C, primary control program resolve the machine essential information that equipment under test reports, for each equipment under test, generate and create device object to be verified, accept the standard software version information of user's input;
D, main control computer generate verification strategy according to user-defined configuration file, obtain equipment under test software version information and compare with the standard software version information of user's input, generate verification report.
Concrete, described the machine essential information comprises device type, IP address and MAC Address.
Further, in described step a, primary control program adopts broadcast mode transmitting apparatus to find message, requires all equipment under tests in local area network (LAN) to report the machine essential information.
Further, in described step b, equipment under test operational outfit is found module client, and the machine essential information is encapsulated as to device discovery response message, reports primary control program, and after confirming that this message sends successfully, device discovery module client-side program is out of service.
Further, in described step c, for each equipment under test, create device object to be verified, specifically comprise:
C1, main control computer receive the device discovery response message that all equipment under tests are replied, and parse the machine essential information of equipment under test from message, create device object to be verified, and add facility information chained list to be verified;
C2, main control computer take out a device object to be verified from facility information chained list to be verified, read the essential information of this device object to be verified, obtain and in this equipment, have which one-level verification unit, and all one-level verification unit essential informations are added to one-level verification unit chained list;
C3, by analyzing device, find response message, know the secondary verification unit kind and the quantity that under each device object to be verified, in single one-level verification unit, contain, and all secondary verification unit information is added to secondary verification unit chained list;
C4, read and resolve predefined configuration file, required verification strategy when obtaining secondary verification unit take one-level verification unit as index, that certain is concrete and carrying out verification, and improve the verification strategy corresponding to data structure of each secondary verification unit object.
Further, described steps d specifically comprises:
D1, described primary control program read and resolve user-defined configuration file, generate verification strategy; Required essential information when obtaining secondary verification unit take one-level verification unit as index, that certain is concrete and carrying out verification, login equipment under test, carries out verification according to the verification strategy defining in each secondary verification unit object in this equipment under test to software version information corresponding to described certain concrete secondary verification unit;
D2, described primary control program gather all check informations, generate figure verification report reporting user.
Another object of the present invention is, a kind of network device software version information automatic checking system is provided, comprises at least one equipment under test, described at least one equipment under test is connected by Ethernet with main control computer, it is characterized in that, described main control computer comprises primary control program module; Described equipment under test comprises device discovery module client;
Described primary control program module, for resolving the machine essential information that equipment under test reports, generating and create device object to be verified for each equipment under test, accepts the standard software version information of user's input; User-defined configuration file generates verification strategy, obtains equipment under test software version information and compares with the standard software version information of user's input, generates verification report;
Described device discovery module client, for scanning the machine essential information and reporting primary control program.
Concrete, described the machine essential information comprises device type, IP address and MAC Address.
Further, described primary control program module also for, adopt broadcast mode transmitting apparatus to find message, require all equipment under tests in local area network (LAN) to report the machine essential information;
Described device discovery module client also for, the machine essential information is encapsulated as to device discovery response message, report primary control program module, after confirming that this message sends successfully, device discovery module client-side program is out of service.
Further, described primary control program module, specifically comprises:
Device object creating unit to be verified for receiving the device discovery response message of all equipment under tests replies, parses the machine essential information of equipment under test from message, creates device object to be verified, and adds facility information chained list to be verified; From facility information chained list to be verified, take out a device object to be verified, read the essential information of this device object to be verified, obtain and in this equipment, have which one-level verification unit, and all one-level verification unit essential informations are added to one-level verification unit chained list; By analyzing device, find response message, know the secondary verification unit kind and the quantity that under each device object to be verified, in single one-level verification unit, contain, and all secondary verification unit information is added to secondary verification unit chained list;
Verification unit, read and resolve predefined configuration file, required verification strategy when obtaining secondary verification unit take one-level verification unit as index, that certain is concrete and carrying out verification, and improve the verification strategy corresponding to data structure of each secondary verification unit object; For creating user interface according to one-level, secondary verification unit information chained list, accept user's input, software version information settles the standard; The worker thread of establishment and equipment under test equivalent amount, each thread complete independently carries out the work of verification to all secondary verification unit of certain equipment; Login equipment under test, carries out verification according to the verification strategy defining in each secondary verification unit object in this equipment under test to software version information corresponding to single concrete verification unit.
The invention has the beneficial effects as follows, provide comprehensively, information checking method accurately and reliably, based on configuration file and configuration file, resolve the verification detection that can carry out differentiation, there is extremely strong autgmentability, for efficient parallel verifications dissimilar, multiple devices provide possibility.The present invention can check man-hour used and guarantee the correct of version information by shortening version information at double, significantly improves factory's delivery speed and quality.
Accompanying drawing explanation
Fig. 1 is schematic flow sheet of the present invention;
Fig. 2 is the schematic flow sheet of embodiment;
Fig. 3 is system configuration schematic diagram of the present invention.
Embodiment
Below in conjunction with the drawings and the specific embodiments, describe technical scheme of the present invention in detail.
The present invention is by a kind of application framework of MFC(Microsoft Foundation Classes Microsoft) realized the primary control program framework running on main control computer.System adopts B/S structure, many equipment under tests and main control computer formation local net network topology.Run on device discovery module client-side program on tested equipment with socket(conventionally also referred to as " socket ", be used for describing IP address and port, the handle of a communication chain) technology and self-defining message interaction rule is basis, realized the information reporting of equipment under test; The naive model of primary control program based on telnet agreement (Telnet) realized remote command execution; With xml(extend markup language) technology and corresponding resolving code structure configuration file; Utilize multithreading to realize version information verification.The present invention embeds client-side program in equipment under test, and by the active reporting information of client-side program, primary control program adds the verification template of mating this equipment to build user interface from configuration file, guarantees simple interface, close friend; Client reports IP address, MAC Address and the device type of equipment under test, and primary control program adopts specific verification strategy in conjunction with configuration file to different equipment according to above-mentioned information; For distinguishing the various software module in equipment under test difference in functionality module, adopt multistage unit to be verified to be described step by step Test Strategy; By revising xml configuration file, can increase flexibly, revise verification strategy newly.
Referring to Fig. 1, be network device software version information automatic checking method of the present invention, comprise step:
Step 101, equipment under test is connected by Ethernet with main control computer, and moves primary control program on main control computer;
Step 102, equipment under test operational outfit are found module client, and scanning the machine essential information also reports primary control program;
Step 103, primary control program are resolved the machine essential information that equipment under test reports, for each equipment under test, are generated and create device object to be verified, accept the standard software version information of user's input;
Step 104, main control computer generate verification strategy according to user-defined configuration file, obtain equipment under test software version information and compare with the standard software version information of user's input, generate verification report.
Embodiment
In network device software version information automatic checking method of the present invention, as shown in Figure 2, concrete steps are as follows for the execution flow process of operating process and key modules:
Step 201, device discovery module client are obtained the machine essential information, as device type, IP address, MAC Address, equipment Serial Number etc.
Step 202, main control computer operation primary control program, broadcast transmitting apparatus is found message, requires all equipment under tests in local area network (LAN) to report its essential information.
Step 203, device discovery module client are received after the device discovery message of primary control program broadcast, the machine essential information is encapsulated as to device discovery response message, to primary control program, send, after confirming that this message sends successfully, device discovery module client-side program is out of service.
Step 204, main control computer receive the device discovery response message that all equipment under tests are replied, and parse the machine essential information such as device type, IP address of equipment under test from message, create device object to be verified, and add facility information chained list to be verified.
Step 205, main control computer take out a device object to be verified from facility information chained list to be verified, read the essential information of this device object to be verified, obtain and in this equipment, have which one-level verification unit (as dissimilar board, same type but the functional cards of different slots position), and all one-level verification unit essential informations are added to one-level verification unit chained list.
Step 206, by analyzing device, find response message, know that the secondary verification unit kind that contains in single one-level verification unit under each device object to be verified and quantity are (as having 5 kinds of software version informations to be verified on certain groove position board, every kind of software version information has formed the religion of two under this one-level verification unit verification unit collection), and all secondary verification unit information is added to secondary verification unit chained list.
Step 207, read and resolve predefined configuration file, required verification strategy (check command, version name, keyword harvesting policy) when obtaining secondary verification unit take one-level verification unit as index, that certain is concrete and carrying out verification, and improve the verification strategy corresponding to data structure of each secondary verification unit object.
Step 208, primary control program read and resolve user-defined configuration file, generate verification strategy.Required essential information when obtaining secondary verification unit take one-level verification unit as index, that certain is concrete and carrying out verification, login equipment under test, carries out verification according to the verification strategy defining in each secondary verification unit object in this equipment under test to software version information corresponding to described certain concrete secondary verification unit.
Step 209, primary control program gather all check informations, generate figure verification report reporting user.
Network device software version information automatic checking system of the present invention, structure as shown in Figure 3, comprises at least one equipment under test, and described at least one equipment under test is connected by Ethernet with main control computer, it is characterized in that, described main control computer comprises primary control program module; Described equipment under test comprises device discovery module client.
Described primary control program module, for resolving the machine essential information that equipment under test reports, generating and create device object to be verified for each equipment under test, accepts the standard software version information of user's input; User-defined configuration file generates verification strategy, obtains equipment under test software version information and compares with the standard software version information of user's input, generates verification report.
Described device discovery module client, for scanning the machine essential information and reporting primary control program.
Described primary control program module, specifically comprises device object creating unit to be verified and verification unit.
Device object creating unit to be verified for receiving the device discovery response message of all equipment under tests replies, parses the machine essential information of equipment under test from message, creates device object to be verified, and adds facility information chained list to be verified; From facility information chained list to be verified, take out a device object to be verified, read the essential information of this device object to be verified, obtain and in this equipment, have which one-level verification unit, and all one-level verification unit essential informations are added to one-level verification unit chained list.By analyzing device, find response message, know the secondary verification unit kind and the quantity that under each device object to be verified, in single one-level verification unit, contain, and all secondary verification unit information is added to secondary verification unit chained list.In calibration equipment list, in each record, comprised and can carry out the essential informations such as the MAC Address, device type of automated calibration equipment.If discovering device MAC Address is not in the list of support calibration equipment after analyzing device is found response message, this equipment cannot the information of carrying out be checked.One-level verification unit template is that the test cell that automatic checking software version information is carried out in all supports has defined template ID, and verification policy management module will index corresponding secondary verification unit information chained list head according to this template ID.
Verification unit, read and resolve predefined configuration file, required verification strategy when obtaining secondary verification unit take one-level verification unit as index, that certain is concrete and carrying out verification, and improve the verification strategy corresponding to data structure of each secondary verification unit object; For creating user interface according to one-level, secondary verification unit information chained list, accept user's input, software version information settles the standard; The worker thread of establishment and equipment under test equivalent amount, each thread complete independently carries out the work of verification to all secondary verification unit of certain equipment; Login equipment under test, carries out verification according to the verification strategy defining in each secondary verification unit object in this equipment under test to software version information corresponding to single concrete verification unit.Correction verification module gathers all check informations, with patterned mode summarizing and reporting user.