A kind of apparatus and method of analog interface card hot plug
Technical field
The present invention relates to communication facilities technical field of measurement and test, relate in particular to the apparatus and method of analog interface card hot plug.
Background technology
Along with the expansion rapidly of network size and application, people increase day by day to the dependence of network, and the safety and reliability of network also becomes more and more important, once network service is unavailable, the loss that may cause is inestimable.The best approach that increases network reliability is to reduce the generation of accidentally shutting down, and after handling failure, reduces release time (MTTR).Hot plug technology is exactly to improve a kind of method of product reliability.
Hot plug (Hot-plugging or Hot Swap) refers to and allows not shutdown system of user, in the situation of not cutting off the electricity supply, take out and change the board having damaged, thereby the timely recovery capability of raising system to disaster, also improves extensibility and the reliability of system.
In/large scale computer posture route exchange device generally all adopts modular design, module comprises: main control card (MPU), switching card (SFU), line card (LPU) etc.Line card designs and works mainly with the form of " master card+interface card " at present.Consider the factors such as whole system energy-conserving and environment-protective and user flexibility standard configuration, interface card supports warm connection function in the industry cycle to reach common understanding, by the hot plug of docking port card, make user can the in the situation that of not power-off of equipment, carry out board insertion, extract operation, and can not have influence on the operation of other boards, thereby improve the reliability of system.
Hot-plug interface card and master card are carried out data communication by data bus, and existing data bus divides two kinds, general data bus and special data bus, and wherein, general data bus supports that violence is hot-swappable; Special data bus, as PCIE, need to interrupt in advance, just can carry out hot-swappable.
Data bus that master card CPU communicates by letter with interface card supports that in violence hot plug situation,, while carrying out interface card hot plug, interface card and master card are carried out hot plug and can directly be carried out, its hot plug be interface card with master card between electrical connection or power-off be connected.
The data bus that master card CPU communicates by letter with interface card is not supported violence hot plug, and as used PCIE bus to carry out, after the hot insertion of interface card, need to sending simulation signal in place to master card CPU, CPU completes and loads subsystem driving; As while using PCIE bus to carry out interface card hot drawing to go out, need to master card CPU, to send simulation interruption signal in advance, CPU completes unloading subsystem and drives.For master card CPU, do not support the unexpected interruption of data communication process of violence hot plug may cause the deadlock of CPU, thereby cause the collapse of whole system.Prior art generally arranges by connector long and short hands or the means such as artificial keyswitch provide in place or look-at-me to carry out the driving of load or unload interface card to master card CPU.The connector that utilization is provided with long and short hands provides in place or look-at-me to refer to: because connector minute hand produces and electrically contacts or hour hand electrically contacts prior to minute hand and master card disengaging prior to hour hand and master card, can make the signal level on hour hand there will be variation, when occurring that sort signal level changes, master card CPU load or unload subsystem drives, the load or unload time that general CPU completes antithetical phrase system drive is at Microsecond grade, and makes the long and short hands generation of connector or the time that electrically contacts needs of disengaging and master card at Millisecond completely; Utilize artificial keyswitch to refer to, before interface card physics inserts or extracts, by artificial keyswitch, to CPU, provide look-at-me in advance, carry out loading or the insertion of subsystem driving.
Because the interface card of route exchange device is supported warm connection function, in development of Interfacing Card debug process, in order to verify the feasibility of interface card warm connection function, need docking port card to carry out hot plug many times; In system system test process, in order to verify the reliability of interface card warm connection function, also need docking port card to carry out hot plug many times.In the prior art, automated testing method is mainly that testing apparatus connects by serial ports or Telnet (Telnet) is configured equipment under test, the send and receive of test frame is carried out in the corresponding port of the data network terminals of testing apparatus control simultaneously, message and expected results that data network terminals is received compare, and judge that whether the result of test is correct.But existing automatic test can not accomplish interface card hot plug such relate to interface card insertion/pull action.
Current interface card inserts/extract such action need manually carry out, by causing, the workload in exploitation and test link is very large, cost of labor is inestimable, the interface card of extracting and insert so repeatedly operates the damage that easily causes equipment, the serviceable life of shortening equipment, and automated procedures in the prior art cannot realize artificial plug and operate such test.
Summary of the invention
The invention provides a kind of device and method of analog interface card hot plug, solve the problem that need manually insert/extract interface card when carrying out interface card hot plug test.
The technological means that the present invention adopts is: a kind of device of analog interface card hot plug, comprise master card and interface card, described master card includes processor, and described processor is connected with interface card by data bus, it is characterized in that, described master card also includes hot-swappable analog module; Wherein, described hot-swappable analog module is for judging the data bus type between master card and interface card, and when described data bus is supported violence hot plug, regularly docking port card carries out switch electricity; When described data bus is not supported violence hot plug, hot plug analog module is used for, at described processor, load after the driver of described interface card, to processor, sending simulation interruption signal extracts with analog interface card, and docking port card closes electricity after described processor unloading interface card driver, after waiting for first schedule time of setting, docking port card is opened electricity, and wait for after second schedule time of setting, hot plug analog module sends simulation signal in place to processor and inserts with analog interface card.
Further, described first schedule time is more than or equal to interface card physics and extracts the time, and described second schedule time is more than or equal to interface card physics and inserts the time.
Further, described hot plug analog module is opened electricity or is closed electricity by control interface card power enable signal docking port card.
Further, described processor, for after receiving described simulation signal in place, loads the driver of described interface card; After receiving simulation interruption signal, unload the driver of described interface card.
Further, described hot-swappable analog module is complex programmable logic device (CPLD).
The present invention also provides a kind of method of analog interface card hot plug, comprising:
Step a: the data bus type between judgement master card and interface card; If support violence hot plug, execution step b, if do not support violence hot plug, execution step c;
Step b: regularly docking port card carries out switch electricity;
Step c: send simulation signal in place or simulation interruption signal to processor, and docking port card is opened electricity or closed electricity after the schedule time.
Further, also include master card before described step a and interface card powers on, the pre-preparation step that master card and interface card driver have loaded; And in step c, hot plug analog module sends simulation interruption signal to processor and extracts with analog interface card, and docking port card closes electricity after described processor unloading interface card driver, after waiting for first schedule time of setting, docking port card is opened electricity, and wait for after second schedule time of setting, hot plug analog module sends simulation signal in place to processor and inserts with analog interface card.
Further, first schedule time was more than or equal to interface card physics and extracts the time, and described second schedule time is more than or equal to interface card physics and inserts the time.
Further, in described step c, by control interface card power enable signal docking port card, open electricity or close electricity.
Further, in step c, described processor receives after the simulation signal in place of hot plug analog module, loads the driver of this interface card; Described processor receives after the simulation interruption signal of hot plug analog module, unloads the driver of this interface card.
A kind of interface card simulation hot plug device provided by the invention and method, by hot-swappable analog module is set in master card, the look-at-me when signal in place while utilizing hot-swappable analog module timing controlled interface card switch electricity and analog interface card physical thermal to insert and physical thermal are extracted changes, complete the scene of analog interface card physical thermal plug, avoid system carrying out hot plug when test because artificial physics hot plug operations repeatedly easily causes the problem of device damage, and solved the very large problem of workload in exploitation and test link.
Accompanying drawing explanation
The device schematic diagram of a kind of analog interface card hot plug that Fig. 1 provides for the embodiment of the present invention;
The method flow diagram of a kind of analog interface card hot plug that Fig. 2 provides for the embodiment of the present invention;
Fig. 3 be in the embodiment of the present invention when bus is supported violence hot plug method of testing process flow diagram;
Fig. 4 be in the embodiment of the present invention when bus is not supported violence hot plug method of testing process flow diagram.
Embodiment
For making object of the present invention, technical scheme and advantage clearer, referring to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
As shown in Figure 1, the device of analog interface card hot plug, comprises master card and the interface card that carries out data communication by data bus and master card.Master card includes processor CPU and hot-swappable analog module, and as CPLD (Complex Programmable Logic Device, CPLD), described hot plug analog module is connected with interface card by power enable signal line; Processor is connected with interface card by data bus; Wherein, CPLD, for judging the data bus type between master card and interface card, when data bus is supported violence hot plug, regularly carries out switch electricity by control interface card power enable signal docking port card; When data bus is not supported violence hot plug, at described processor, by shell script, load after the driver of described interface card, CPLD sends simulation signal in place or simulation interruption signal to processor, and by control interface card power enable signal docking port card, is opened electricity or closed electricity after the schedule time.
Described simulation signal in place is that its physics signal in place level change information is from high to low realized while being inserted by CPLD analog interface card; CPLD is communicated to processor by this level change information, and by control interface card power enable signal docking port card, opens electricity after first schedule time.Described simulation interruption signal is that its physical discontinuity signal level change information is from low to high realized while being extracted by CPLD analog interface card; CPLD is communicated to processor by this level change information, and by control interface card power enable signal docking port card, closes electricity after second schedule time.Wherein, first schedule time was more than or equal to interface card physics and inserts the time, and described second schedule time is more than or equal to interface card physics and extracts the time.
The present invention also provides a kind of method of analog interface card hot plug, as shown in Figure 2, comprising:
Step a: the data bus type between judgement master card and interface card; If support violence hot plug, execution step b, if do not support violence hot plug, execution step c;
Step b: regularly docking port card carries out switch electricity;
Step c: when interface card simulation is inserted, hot plug analog module first sends simulation signal in place to processor, and docking port card is opened electricity after first schedule time, when interface card simulation is extracted, hot plug analog module first sends simulation interruption signal to processor, and docking port card closes electricity after second schedule time.Wherein, the described schedule time is more than or equal to interface card physics and extracts the time; By control interface card power enable signal docking port card, open electricity or close electricity.
Referring to Fig. 3, in the embodiment of the present invention, if the data bus type between CPLD judgement master card and interface card is supported violence hot plug, in master card and interface card, power on, master card and interface card driver have loaded, ready, by circulation, carry out the test that following steps realize analog interface card hot plug:
Step 1, CPLD close electricity by control interface card power enable signal docking port card;
After step 2, a period of time t1 of wait for setting, CPLD opens electricity by control interface card power enable signal docking port card, and the arranging of t1 closed the electric time according to interface card and determined (be interface card power supply drop to time of 0 volt determine);
Step 3, CPLD enter step 1 after waiting for a period of time t2 setting, and the time powering on according to interface card that arranges of t2 is determined (being that interface card power supply rises to operating voltage from 0 volt).
Referring to Fig. 4, in embodiments of the present invention, if the data bus type between judgement master card and interface card is not supported violence hot plug, in master card and interface card, power on, master card and interface card power on, master card and interface card driver have loaded, ready, by circulation, carry out the test that following steps realize analog interface card hot plug:
When step 1, CPLD analog interface card physics are extracted, its physical discontinuity signal level change information is from low to high realized, and pseudo-terminal signal is noticed to processor;
Step 2, processor receive after the simulation interruption signal of hot plug analog module, unload the driver of this interface card;
Step 3, CPLD, after waiting for a period of time ta setting, are closed electricity by control interface card power enable signal docking port card, and the time that unloads interface card driver according to master card that arranges of ta determines;
After step 4, a period of time tb of wait for setting, CPLD opens electricity by control interface card power enable signal docking port card, and the arranging of tb closed the electric time according to interface card and determined;
After a period of time tc that step 5, wait are set, its physics signal in place level change information from high to low when CPLD analog interface card physics inserts, and will simulate signal in place and notice to processor, tc the time of can referenced interface card physical thermal inserting being set and determining, generally at Millisecond;
Step 6, processor receive after the simulation signal in place of hot plug analog module, load the driver of this interface card;
Step 7, CPLD enter step 1 after waiting for a period of time td setting, and arranging of td determined according to the time of loading interface card driver.
Adopt device of the present invention, can simulate after interface card physical thermal inserts and produce the variation of signal level in place and the variation that interface card physical thermal is extracted rear generation look-at-me level by CPLD, the effect of simulation hot plug is equal to and artificial physics hot plug completely, and successfully evade CPU deadlock, and adjustment method is simple, easily realize, can simulate artificial hot plug effect completely, have raising system hot plug testing efficiency, whole day need not manually plug intervention; The interface device loss of reduction system; Reduce the requirement to test environment simultaneously, as need not pallet, the dependence of guidepost; Arrive the advantage that reduces system testing cost.The development& testing of centering/large scale computer posture communication facilities hot-plug board card has very positive meaning.
For multiple operation in the application, how to realize between (comprising judgement, control etc.), master card processor and interface card how mutual, and concrete mode, those skilled in the art can utilize computer program to realize, and repeat no more herein.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of making, be equal to replacement, improvement etc., within all should being included in the scope of protection of the invention.