Summary of the invention
In view of this, the purpose of the present invention is to propose to a kind of secondary device hardware board automatic identification based on pci bus
Method, energy automatic identification package types and function, automatic conversion when can be realized hardware generic disk card insertion part insertion secondary device
The type and application scenarios of secondary device reduce maintenance work amoun and difficulty.
The present invention is realized using following scheme: a kind of secondary device hardware board automatic identifying method based on pci bus,
Test platform identification circuit, processor identification circuit, 1 identification circuit of hardware, 2 identification circuit of hardware, 3 identification circuit of hardware are provided
And 4 identification circuit of hardware;
The test platform identification circuit includes secondary device identification control terminal, hardware identification controller, identification scanning circuit, place
Manage device identification interface, hardware identification interface 1, hardware identification interface 2, hardware identification interface 3, hardware identification interface 4 and data
Feedback interface circuit;
The hardware I/D Memory is electrical connected with the hardware information transmitter;The hardware identification controller and the identification
Scanning circuit is electrical connected, the identification scanning circuit respectively with the processor identification interface, the hardware identification interface 1,
The hardware identification interface 2, the hardware identification interface 3 and the hardware identification interface 4 are electrical connected;The hardware identification
The built-in identification scanner program of controller control the identification scanning circuit respectively to secondary device processor hardware, hardware board 1,
Hardware board 2, hardware board 3 and hardware board 4 carry out identification scanning, and send identification scanning signal;The processor identification
1 identification circuit of circuit and the hardware, 2 identification circuit of the hardware, 3 identification circuit of the hardware and the hardware identification circuit
After 4 receive identification scanning signal, that is, the identification id of corresponding hardware board is sent to the data feedback interface circuit, the data
The identification id of hardware board is transmitted to hardware identification controller by feedback interface circuit, the hardware identification controller collection at knowledge
Other ID register will collect respectively the identification id of each hardware board, and be transmitted to the secondary device identification control terminal, secondary
Equipment identifies that control terminal distributes different roles according to the different hardware board identification id above sent.
Further, the processor identification circuit, 1 identification circuit of hardware, 2 identification circuit of hardware, 3 identification circuit of hardware
And 4 identification circuit of hardware includes the hardware I/D Memory of same model and the hardware information transmitter of same model, it is described
After processor identification circuit and each hardware identification circuit receive identification scanning signal, the corresponding hardware I/D Memory will
The identification id of corresponding hardware board is transmitted to the corresponding hardware information transmitter, and the hardware information transmitter is by hardware plate
The identification id of card is sent to the data feedback interface circuit.
Further, the identification id of the hardware board includes but is not limited to Bus number, function number and device number.
Further, the built-in identification scanner program of the hardware identification controller is scanned board and identifies specifically
The following steps are included:
Step S1: after hardware board is inserted into secondary device, the hardware identification controller operation identification scanner program, to insertion
Board identified;
Step S2: carrying out secondary device system initialization, enters step S3 if system initialization success, otherwise return step
S1;
Step S3: on-line testing tool is that each device PCI carries out resource allocation;
Step S4: the device PCI is by the driver containing parallel address and data/address bus to PCI vendor id (Vendor
Id), device id (Device Id) and version number (Revison Id) carry out pci bus search;
Step S5: read hardware identification controller collection at identification id content of registers, check whether exist meet in step S4
The equipment of the driving of search, if there is no the driving equipment met then return step S4, if there is the driving equipment met
After then finding equipment, driver carries out the initialization of board hardware register and interrupts to hang according to the hardware design situation of board
Carry work;
Step S6: secondary device identifies control terminal identification carry success.
Further, device PCI described in step S3 is PCI slot and the board for being inserted into slot.
Compared with prior art, the invention has the following beneficial effects:
The present invention can implement direct identification and carry equipment plate card to hardware, realize secondary device automatic conversion application scenarios,
Maintenance work amoun and difficulty are reduced, operation and maintenance level is promoted, enhances electric substation automation system robustness.
Specific embodiment
The present invention will be further described with reference to the accompanying drawings and embodiments.
As shown in Figure 1, present embodiments providing a kind of secondary device hardware board automatic identification side based on pci bus
Method provides test platform identification circuit, processor identification circuit, 1 identification circuit of hardware, 2 identification circuit of hardware, hardware 3 and identifies
4 identification circuit of circuit and hardware;
The test platform identification circuit includes secondary device identification control terminal, hardware identification controller, identification scanning circuit, place
Manage device identification interface, hardware identification interface 1, hardware identification interface 2, hardware identification interface 3, hardware identification interface 4 and data
Feedback interface circuit;
The hardware I/D Memory is electrical connected with the hardware information transmitter;The hardware identification controller and the identification
Scanning circuit is electrical connected, the identification scanning circuit respectively with the processor identification interface, the hardware identification interface 1,
The hardware identification interface 2, the hardware identification interface 3 and the hardware identification interface 4 are electrical connected;The hardware identification
The built-in identification scanner program of controller control the identification scanning circuit respectively to secondary device processor hardware, hardware board 1,
Hardware board 2, hardware board 3 and hardware board 4 carry out identification scanning, and send identification scanning signal;The processor identification
1 identification circuit of circuit and the hardware, 2 identification circuit of the hardware, 3 identification circuit of the hardware and the hardware identification circuit
After 4 receive identification scanning signal, that is, the identification id of corresponding hardware board is sent to the data feedback interface circuit, the data
The identification id of hardware board is transmitted to hardware identification controller by feedback interface circuit, the hardware identification controller collection at knowledge
Other ID register will collect respectively the identification id of each hardware board, and be transmitted to the secondary device identification control terminal, secondary
Equipment identifies that control terminal distributes different roles according to the different hardware board identification id above sent.
In the present embodiment, the processor identification circuit, 1 identification circuit of hardware, 2 identification circuit of hardware, hardware 3 identify
Circuit and 4 identification circuit of hardware include the hardware I/D Memory of same model and the hardware information transmitter of same model,
After the processor identification circuit and each hardware identification circuit receive identification scanning signal, the corresponding hardware ID storage
The identification id of corresponding hardware board is transmitted to the corresponding hardware information transmitter by device, and the hardware information transmitter will be hard
The identification id of part board is sent to the data feedback interface circuit.
In the present embodiment, the identification id of the hardware board includes but is not limited to Bus number, function number and device number.
As shown in Fig. 2, in the present embodiment, the built-in identification scanner program of the hardware identification controller carries out board
Scanning and identification specifically includes the following steps:
Step S1: after hardware board is inserted into secondary device, the hardware identification controller operation identification scanner program, to insertion
Board identified;
Step S2: carrying out secondary device system initialization, enters step S3 if system initialization success, otherwise return step
S1;
Step S3: on-line testing tool is that each device PCI carries out resource allocation;
Step S4: the device PCI is by the driver containing parallel address and data/address bus to PCI vendor id (Vendor
Id), device id (Device Id) and version number (Revison Id) carry out pci bus search;
Step S5: read hardware identification controller collection at identification id content of registers, check whether exist meet in step S4
The equipment of the driving of search, if there is no the driving equipment met then return step S4, if there is the driving equipment met
After then finding equipment, driver carries out the initialization of board hardware register and interrupts to hang according to the hardware design situation of board
Carry work;
Step S6: secondary device identifies control terminal identification carry success.
In the present embodiment, device PCI described in step S3 is PCI slot and the board for being inserted into slot.
Particularly, in the present embodiment, automatic recognition system is integrated by access bottom plate hardware identification controller, identification are swept
The composition such as scanning circuit, hardware identification interface & processor identification circuit.Hardware identification controller is built-in to identify scanner program, when slotting
When entering hardware board, built-in scan program sequentially identifies each hardware board since secondary device processor hardware
Scanning.Hardware identification circuit module after receiving identification scanning signal, that is, send corresponding hardware identification id (including Bus number,
Function number and device number etc.), the integrated identification id register of identification controller will collect the identification id of each hardware respectively, secondary
Equipment distributes different roles according to the different identification ids above sent.
After board is inserted into equipment, the identification scanner program of the CPU operation BIOS of secondary device, in system initialisation phase
(POST) resource allocation is carried out for each device PCI (board including insertion).After resource allocation, device PCI is by containing
The driver of parallel address and data/address bus is to PCI vendor id (Vendor Id) and device id (Device Id) and version
This number (Revison Id) progress pci bus search reads hardware ID memory content and checks whether there is the insertion plate met
The activation bit of card.After the activation bit for finding insertion board, driver is inserted into according to the hardware design situation of board
The initialization of register of board and interruption carry work.
Particularly, in the present embodiment, because the resource allocation of pci bus is dynamically distributed during POST, institute
With according to system configuration difference, the resource that each board is distributed is not also identical.Pci bus search is usually by the suitable of depth-first
Sequence scans for.If there is the device PCI of model of the same race is present in pci bus, device drives should successively to board equipment into
Row initialization.And when multiple board examples use same driving, driver is only total to its to the differentiation of each board
The differentiation of line position information.Although system resource allocation is not fixed, device PCI position is fixed, all to pass through driver
Available following information: hardware ID, equipment handle, revision ID, vendor id, subsystem ID, can drive device PCI at revision ID
The system resource etc. that quantity, device PCI occupy.Carry out self-identifying hardware module information from there through the information of PCI board card.Final two
Secondary device is according to the hardware board information read, the different application scenarios of switchable apparatus.
Preferably, the present embodiment can reduce maintenance work amoun and difficulty, operation and maintenance level is promoted, enhancing substation is automatic
Change system robustness;Be conducive to improve Standardization instrument manufacture level, improve secondary device quality;Secondary device intercommunication is exchanged,
Standby redundancy quantity can be reduced, performance driving economy is improved, improves the service efficiency of equipment, the interoperability of IED is realized, exchanges
Property, facilitate the expansion of maintenance, maintenance and the replacement of equipment and the enlarging of substation and automated system.
Preferably, in the present embodiment, secondary device hardware board automatic identification technology is by Bus number, function number and sets
The data separations board type such as standby number, then reads hardware ID, the equipment handle, revision ID, manufacturer stored in board register
ID, subsystem ID, subsystem revision ID, hardware state etc..Since board register makes base to the performance of hardware and driving
This description.Therefore, secondary device can implement direct identification and carry equipment plate card to hardware according to the content of register, real
Existing secondary device automatic conversion application scenarios, also help the upgrading of hardware, simplify the process that board uses.
The foregoing is merely presently preferred embodiments of the present invention, all equivalent changes done according to scope of the present invention patent with
Modification, is all covered by the present invention.