CN100367253C - Method and system for expanding peripherals - Google Patents

Method and system for expanding peripherals Download PDF

Info

Publication number
CN100367253C
CN100367253C CNB2005101025473A CN200510102547A CN100367253C CN 100367253 C CN100367253 C CN 100367253C CN B2005101025473 A CNB2005101025473 A CN B2005101025473A CN 200510102547 A CN200510102547 A CN 200510102547A CN 100367253 C CN100367253 C CN 100367253C
Authority
CN
China
Prior art keywords
peripheral hardware
interface
final drive
configuration file
development interface
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.)
Active
Application number
CNB2005101025473A
Other languages
Chinese (zh)
Other versions
CN1737779A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CNB2005101025473A priority Critical patent/CN100367253C/en
Publication of CN1737779A publication Critical patent/CN1737779A/en
Application granted granted Critical
Publication of CN100367253C publication Critical patent/CN100367253C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The present invention relates to a computer technique, more specifically a method and a system for expanding peripherals. In order to expand the ability of a terminal to use peripherals, the present invention is characterized in that the method comprises the steps that an application system loads terminal drive through a development interface of terminal drive; business software sends a request for a macro order function to a logical peripheral by hanging a development interface of peripheral drive; physical peripheral drive corresponding to the logical peripheral is searched for and determined according to the request for the macro order function of the business software; the peripheral drive invokes the stored physical peripheral order which completes the macro order to operate the physical peripheral and complete the function request. The present invention has the advantages that a standard peripheral operates a macro order collection, and a unified drive program interface provides a convenient and fast access path for the expansion of the peripherals and the use of new-type devices.

Description

A kind of method and system of expanding peripherals
Technical field
The present invention relates to computer technology, is a kind of method and system of expanding peripherals concretely.
Background technology
A typical UNIX uses 10 physical maps as shown in Figure 1.Unix server 11 provides the running environment of application software, and actual user interface is to represent by the terminal that is connected on the server.Terminal has dumb terminal 12 and emulation terminal 13 forms usually, by self string, parallel port or other I/O communication port, can connect many different peripheral hardwares 14 on the terminal.UNIX operating system can not provide driver for the equipment that is connected the terminal on the server or be connected on the terminal, and the driver of the equipment on terminal and the terminal need be provided by application software self.The device driver of various type is used for hardware equipment.Those skilled in the art will envision that to also have some other terminal to be connected on the unix server, also have some other terminal device to be connected on the terminal.
At present, in many application systems of UNIX, it all is to write in the program according to the instruction of specific equipment in application software that application software is called peripheral hardware.Therefore the peripheral hardware that can support of each application system all pre-defines, and such Design Mode is not suitable at peripheral hardware of a great variety, the variation that function is maked rapid progress.Particularly in the front end applications system of bank, usually need in software systems, use peripheral hardware, front end applications system of bank uses following peripheral hardware commonly used: terminal, deposit book printers, magnetic stripe read write line, password keypad, line printer etc., carry out bankbook, with the printing of bar, magnetic stripe read-write, user cipher input and report printing etc.; The IC-card business that also has the IC-card read write line to be correlated with.
The type class of the equipment that uses in the system is various, and equipment of the same type also often has the product of a plurality of manufacturers; And along with the development of business, constantly have new equipment (as the USB scanner etc.) and be increased in the application software system, bring a large amount of developments to system, and give and safeguard particularly and bring very big challenge in the expansion.In addition, consider, require also that some equipment are double to be made other function or change variations such as interface configuration mode from the cost angle.
General application system, using peripheral hardware all is targetedly, and the list of devices that is merely able to support is described.Such application system is supported limited to the peripheral hardware type, be far from being and can expand.In case new equipment or new model need the system software support, that just needs the upgrading of wait application software system to support; And, also may need to revise relevant business application, system just can support new equipment.
Summary of the invention
The present invention is in order to realize making things convenient for the business application exploitation, shield the exploitation difference between the equipment different manufacturers product of the same type, expand the purpose of newtype equipment easily, propose application software and use a kind of flexible and changeable technology solution of peripheral hardware, can support the use of enriched types equipment, the flexible access of support equipment, but system software solved at the scaling problem of supporting on the peripheral hardware, and the shielding business application is used the exploitation difference in the peripheral hardware.
A kind of method of expanding peripherals may further comprise the steps:
Application system loads the step of final drive by the final drive development interface;
Business software sends the step of macro instruction function request by articulating peripheral hardware driving development interface to the logic peripheral hardware;
Adopt with the described peripheral hardware that articulates and drive the peripheral hardware matching unit that development interface is connected,, search the step of determining with the corresponding physics peripheral hardware driving of described logic peripheral hardware according to the macro instruction function request of business software;
Peripheral hardware drives the physics peripheral hardware instruction of finishing macro instruction of calling storage, finishes the step of function request with the operating physical peripheral hardware.
In the step of application system, comprise that also application system is by reading the step that a configuration file loads final drive by final drive development interface loading final drive.
Described configuration file comprises terminal name and final drive program field.
Articulating of the macro instruction function request of peripheral hardware driving development interface according to business software, search in the step of determining to drive and also comprise, load the step that drives with the corresponding physics peripheral hardware of described logic peripheral hardware according to a configuration file with the corresponding physics peripheral hardware of described logic peripheral hardware.
Described configuration file comprises interface type, baud rate, data bit, position of rest, connector, check bit, overtime, peripheral hardware driver field.
After the operating physical peripheral hardware is finished the step of function request, also comprise, discharge final drive development interface resource and articulate peripheral hardware and drive the development interface resource.
Application system and business software drive development interface and final drive development interface, articulate peripheral hardware driving development interface Data transmission by peripheral hardware.
A kind of system of expanding peripherals comprises:
The final drive development interface, application system loads final drive by the final drive development interface;
Articulate peripheral hardware and drive development interface, the final drive development interface is used to receive business software macro instruction function request msg, analyzes the logic peripheral hardware of function request correspondence;
The peripheral hardware matching unit is connected with the described peripheral hardware driving development interface that articulates, and is used to search the pairing physics peripheral hardware of described logic peripheral hardware and drives;
The macro instruction compilation unit is connected with described peripheral hardware matching unit, is used for searching the physics peripheral hardware driving command collection of finishing the request of described macro instruction function in the described corresponding physical peripheral hardware driving that finds out;
The physics Peripheral Interface, an end is connected with described macro instruction compilation unit, and the other end is connected with the physics peripheral hardware, receives the physics peripheral hardware driving command of macro instruction compilation unit, sends the function request that the physics peripheral hardware makes it to finish business software to.
Also comprise a configuration file unit, be connected that the terminal configuration file of macro instruction function request by storing in the configuration file unit of described business software carries out data communication by the final drive development interface of stipulating with described final drive development interface.
Described configuration file comprises terminal name and final drive program field.
Described configuration file unit is connected with described peripheral hardware matching unit, and described peripheral hardware matching unit is searched in the configuration file unit with described logic peripheral hardware corresponding physical peripheral hardware and driven.
Described configuration file comprises interface type, baud rate, data bit, position of rest, connector, check bit, overtime, peripheral hardware driver field.
Described physics Peripheral Interface comprises: serial line interface, parallel interface, USB interface, network interface.
Comprise that also a peripheral hardware drives development interface, be used to receive the data-signal of application system and business software, send the final drive development interface to and articulate peripheral hardware driving development interface.
Beneficial effect of the present invention is, has shielded the relation of concrete peripheral hardware and business application fully; Same type peripheral hardware provides unified peripheral hardware to handle macroinstruction set, and making the use of peripheral hardware all is consistent to business application, realizes seamless being linked in the system of the same type peripheral hardware of different vendor.The peripheral hardware of standard is handled macroinstruction set, and unified USBDI is the expansion of peripheral hardware, and the use of newtype equipment provides one conveniently to insert approach.
Description of drawings
Fig. 1 is a system construction drawing of the present invention;
Fig. 2 is that the service logic defining classification of equipment reaches and physical equipment concerns synoptic diagram;
Fig. 3 is the macroinstruction set synoptic diagram of logic password keypad and logic magnetic stripe read write line;
Fig. 4 is an application system configuration file synoptic diagram of the present invention;
Fig. 5 is the application system structural drawing of expanding peripherals structure of the present invention;
Fig. 6 is the inventive method process flow diagram;
Fig. 7 is server of the present invention, terminal and the structural drawing that articulates peripheral hardware;
Fig. 8 is Fig. 7 system unit structural drawing.
Embodiment
Below in conjunction with description of drawings the specific embodiment of the present invention.
In order to realize purpose of the present invention, need carry out following work:
1. according to the service application actual demand, the peripheral hardware of service application software is carried out logical definition.
The result who the actual physics peripheral hardware is carried out logical definition obtains a logical device set.Logical device is meant notional equipment, and a logical device is finished certain function.A kind of logical device is general corresponding with a kind of equipment of reality, and the function of finishing can be that physical device provides, and also can realize by software in driving.Corresponding physical device of logical device and respective drive, but physical device is corresponding different logical device with different driving.As the LQ1600 line printer, drive in conjunction with its corresponding form, can be defined as report writer; With business-driven, can be defined as professional printer.In brief, logical device is the actual demand according to service application, notional equipment of finishing one group of function that definition is come out.
Fig. 2 is that the service logic defining classification of equipment reaches and physical equipment concerns synoptic diagram.Provide a partial logic device definition that application system is used among the figure, and provided logical device and physical equipment relation.The business application 101 of business application system 100 needs to use peripheral hardware to finish the work that inputs or outputs of data, as printing with bar, reads in bankbook information etc.Business application is in fact to finish professional program, as the program of deposit business correspondence in the banking system, generally only refers to finish the client-side program of whole service, and the business application of following indication all is this type program.Analyze business application, use the situation of peripheral hardware, be the use of a logic in fact, logic deposit book printers 102, logic magnetic stripe read write line 103, logic business line printer 104 and logic report writer 105 often arranged as the peripheral hardware that in banking system, uses.Business application just is concerned about the business function that the logic peripheral hardware is finished, and and to be indifferent to the logic deposit book printers be serial ports deposit book printers 106 or parallel port deposit book printers 107; Logic business printer and logic report writer can use line printer.So business application only is concerned about the logic peripheral hardware that can be used for finishing the corresponding service function, and and to be indifferent to be the physical equipment of specific implementation logical device.
The peripheral hardware situation that the investigation application system is used, the logical device of coming define system to use according to the actual demand of service application is first step work of the present invention.
2. define the macroinstruction set of every kind of logical device.
Macro instruction is that the action of a function can finishing of logical device is summarized.Macroinstruction set is exactly the set that the action of a kind of logical device all functions that can realize is summarized.Macroinstruction set is the instruction interface that business application is controlled peripheral hardware.The main foundation of every kind of macroinstruction set definition is the instruction set of peripheral hardware self, simultaneously also will be in conjunction with the demand of business application.Every corresponding zero to many peripheral hardware instructions of macro instruction, logical printer for example, the paper feed macro instruction is corresponding with removing mistake, inspection state, the several actual instructions of paper feed of certain physics printer, checking that the printer device name macro instruction does not then have corresponding relation with the actual instruction of physical printer, only is the logic function that driver is realized.The logical device macro instruction is that the complete operating and controlling interface that the logical device function is used is described, and business application is used logic peripheral hardware all functions by the macroinstruction set of logical device.
Fig. 3 is the macroinstruction set synoptic diagram of logic password keypad and logic magnetic stripe read write line.Logic password keypad 201 has the input password and please inputs the function of password again, and therefore ask the visitor in imports password 202, please inputs password 203 again is two macro instructions, and these two macro instructions have constituted the macroinstruction set of logical device password keypad.Same, the macroinstruction set of logic magnetic stripe read write line 301 has following several macro instructions: read two track data 302, read three track data 303, read two or three track data 304, write two track data 305, write three track data 306 and write two or three track data 307.On business application system, require that the password keypad provides be exactly input a password and once more input confirm this two macro instruction functions request.A physics password keypad, the instruction of the peripheral hardware of its reality have that pilot lamp is bright, suggestion voice one, suggestion voice two, pilot lamp go out four actual instructions.The macro instruction of logical device: please input password, the instruction of the peripheral hardware of corresponding physics password keypad is: pilot lamp is bright, suggestion voice one and pilot lamp go out; And macro instruction: please input password again, the actual instruction of corresponding physics password keypad is: pilot lamp is bright, suggestion voice two, pilot lamp go out.
For other professional logical device of using that goes up, according to the function that business is used, we also need to be the suitable macroinstruction set of they definition.
3. define the business application development interface.
For every kind of logical device, a unique sign is arranged all in application software system.System identifies by this to distinguish logical device, macro instruction is sent in the driver of physical equipment of actual realization logical device.Be the supporting business application development, need definition business application development interface, need will macro instruction, the parameter that peripheral hardware is handled being sent in the corresponding driving by this interface business application program.The interface definition form has the following example can be for referencial use:
Interface name (logical device sign, macro instruction, parameter)---rreturn value is represented successfully to fail;
Perhaps:
Logical equipment object=fetch logic device object interface (logical device sign),
Interface name (macro instruction, parameter)---rreturn value is represented successfully to fail;
Outer being made as of each particular type realized a kind of logic peripheral hardware, and a corresponding driving program is all arranged.For example: Nan Tian's deposit book printers have a corresponding driving program A during as the logic deposit book printers; The deposit book printers of the southeast are during as the logic deposit book printers, and it also has its corresponding driving program B.The existence of different driving program mainly is variant the causing of actual peripheral hardware instruction that actual peripheral hardware provides.
The driver of actual peripheral hardware is the function that will realize a kind of logic peripheral hardware, so the driver of the different actual peripheral hardwares of same logic peripheral hardware, the function of realization is on all four.As logic peripheral hardware code keypad, and no matter how their actual peripheral hardware instructs difference, and it is exactly to ask the user to input password one time that logical order " please be inputed password ".
In application system, all logic peripheral hardwares all have corresponding sign, and general use set is managed.Business application is by the business application development interface, and unification is used the logic peripheral hardware, to realize by a kind of unified format shielding different peripheral, the purpose of difference in functionality request.
4. be the driver definition Driver Development interface of equipment
Application system need define the complete Driver Development interface of a cover, and the peripheral hardware driver just can be embedded in the system easily so long as write according to interface.Driver of the present invention is meant the actual physics peripheral hardware is sent actual peripheral hardware instruction, finishes the macro instruction functional programs.Driver among the present invention is different with the driver of operating system.Driver of the present invention embeds in application system, realizes the function of macro instruction according to self-defining interface, and the peripheral hardware that driver drives under operating system each terminal usually all can connect a cover peripheral hardware.The driver that we often mention is the driver of operating system, goes up printed driver as windows, and these drivers are that producer or operating system provide.
For the ease of the expansion of application system, driver is defined as the dynamic base pattern.The Driver Development interface designs according to following aspect:
In application software system, peripheral hardware is divided into two types: terminal device and locking equipment.As the dumb terminal among Fig. 1 12 and graphic terminal/PC13, all be terminal device; Peripherals 14 then belongs to locking equipment, and they are to be connected on the terminal rather than on the server, all are locking equipments as deposit book printers, magnetic stripe read write line etc.
Terminal is directly connected on the server, for locking equipment provides connecting interface, can be PC, dumb terminal or other terminal of using at ordinary times.Why terminal is called terminal, is that their residing positions are come surely in the front end system, and its logic of self not managing business is only used as front end system input, output (display result).Dumb terminal under the UNIX is working procedure not, is pure terminal, and linux terminal and PC terminal also held concurrently unix server operation application system, carry out the function of business software.From application software, terminal self also is a peripheral hardware, and the communication port of application software system program to peripheral hardware is provided.Because the actual instruction of the communication interface that different physical terminals provide is distinguishing, therefore need to distinguish to treat.Terminal offers the physics Peripheral Interface that articulates the peripheral hardware use and mainly contains two classes at present: serial ports and parallel port.Also bring into use USB mouth or other communication interface gradually.Functions such as the driver of terminal provides the opening of terminal called mouth, closes, removes, read-write.Final drive program and Application Software Program are together, are to move on unix server under the pattern of dumb terminal, move on linux terminal and pc respectively under linux and the PC terminal pattern.
Locking equipment is the true physical equipment that is connected to terminal, for business application provides actual peripheral hardware service function.Peripheral hardware communication interface and actual peripheral hardware communication that the driver of locking equipment mainly uses final drive to provide are realized the function that the peripheral hardware logical order requires.
The logical device that business application is used, corresponding is certain physical equipment that is articulated on the terminal, so locking equipment rather than terminal device that business application is concerned about.On application system realized, terminal also was that to be used as be that a class peripheral hardware of system is treated, and fundamental purpose is the difference of the various terminals of shielding, allowed driver only do work at particular physical device.Therefore peripheral hardware drives to divide into final drive and articulate peripheral hardware in system software and drives.Usually directly call the peripheral hardware driving articulating the peripheral hardware driving.Their relation as shown in Figure 4.Final drive and to articulate that peripheral hardware drives all be that the peripheral hardware of application system drives is loaded by application software, articulates peripheral hardware and drives the communication port interface that uses final drive by system indirectly, carries out communication with peripheral hardware.
Peripheral hardware drives the development interface definition and is divided into two kinds accordingly: the final drive development interface defines and articulates peripheral hardware and drives the development interface definition.
The final drive interface definition is as follows:
Open that serial ports (string slogan, baud rate, data bit, position of rest, parity checking sign)---rreturn value is represented success or the code of makeing mistakes;
Close that serial ports (string slogan)---rreturn value is represented success or the code of makeing mistakes;
Empty that serial ports function (string slogan)---rreturn value is represented success or the code of makeing mistakes;
Read serial data (string slogan, result data memory buffer, data length, overtime) one by one rreturn value successfully represent the actual data length of reading, failure expression error code;
Write data to serial ports (string slogan, data buffer, data length) one by one rreturn value successfully represent the actual data length that writes out, failure expression error code.
Open that parallel port (and slogan)---rreturn value is represented success or error code;
Close that parallel port (and slogan)---rreturn value is represented success or error code;
Read parallel port data (and slogan, result data buffer zone, data length, an overtime) rreturn value and represent actual data length or the error code read;
Empty parallel port (and slogan);
Write data to that parallel port (and slogan, data buffer, data length)---rreturn value is represented actual data length of writing or error code.
Final drive can also be added following two interfaces:
Obtain that final drive version number (deposit drive version number buffer zone)---rreturn value is represented success or the code of makeing mistakes;
Obtain that terminal related information (depositing the buffer zone of information)---rreturn value is represented success or the code of makeing mistakes.
Articulating the peripheral hardware driving interface is defined as follows:
Initialization (final drive function pointer structure, the connectivity port, baud rate, data bit, position of rest, the parity checking sign, overtime)---rreturn value is represented success or error code;
(macro instruction, input parameter buffer zone, input parameter length, output parameter buffer zone, output parameter data length buffer zone)---rreturn value is represented success or error code in communication;
()---discharge the resource of this driver application, rreturn value is represented success or error code in release.
Equally, articulate the peripheral hardware driving interface and can add following two interfaces:
Obtain and articulate peripheral hardware and drive that version number's (edition data buffer zone)---rreturn value is represented success or error code;
Obtain that the peripheral hardware information that articulates (information data buffer zone)---rreturn value is represented success or error code.
Given herely articulate peripheral hardware to drive development interface be an overall description, also might have the final drive interface of other formal definition and articulate the peripheral hardware driving interface, in the middle of the realization of reality, every kind of all corresponding socket of logic peripheral hardware, system can load dissimilar drivers simultaneously and be distinguished.Actual form is: final drive development interface, logic peripheral hardware 1 drive development interface ..., logic peripheral hardware n drives development interface.
Further, for convenient various different peripherals use in system, also need a peripheral configuration file in the work of application software load driver program, this document has been described a final drive and a various type that articulates the peripheral hardware driving that terminal is used, and has described various Peripheral Interface, interface shape, interface parameters configuration and the driver names etc. of articulating.Configuration file can adopt various forms, and given below is a kind of peripheral configuration file, and forms such as also available xml file are described.
Table 1 articulates the peripheral configuration file
The logic peripheral hardware Interface type (0 string/1 also) Integer Baud rate Integer Data bit (Byte) Position of rest (Byte) Connector Integer Check bit (Byte) Overtime (second) Integer Drive String
The password keypad 0 ?9600 8 1 ?11 0 10 PinKeyDrv
The magnetic stripe read write line 0 ?9600 8 1 ?12 0 10 MsfDrv
Table 2 terminal configuration file
The terminal peripheral hardware Drive string
Terminal name MYTERM
Through above 4 steps, increased extendible peripheral device structure in the application system, constituted an application system of using expanding peripherals.The application system structure of using the expanding peripherals structure is as shown in Figure 5: in the extendible peripheral hardware application system 400, the peripheral hardware business application development interface 403 that business application 401 is called application software to be provided carries out sending macro instruction to logic peripheral hardware 402, application software system is by device drives development interface 404 (a kind of unified standard), can accept the final drive program 407 that the logical terminal (LTERM) drives development interface 405 exploitations, also can accept to articulate the peripheral hardware driver 408 that peripheral hardware drives development interface 406 definition.The different terminals driver can drive different terminal device 409, and different peripheral hardware drivers can drive different locking equipment 410.
In service in application system, business application is called the interface that application system provides, and the macroinstruction set that uses the service logic peripheral hardware to provide carries out peripheral hardware and controls.Application system has defined the unified peripheral hardware driving development interface that articulates and has carried out peripheral hardware driving expansion, and all peripheral hardware drivers drive the development interface exploitation according to articulating peripheral hardware.The peripheral hardware of each particular type all has the driver of a correspondence, realizes the function of all peripheral hardwares drivings of a service logic peripheral hardware.In service in application system, all articulates peripheral hardware as an aggregate.Whole workflow is as follows:
Application system starts, and reads configuration file, and loads final drive according to the configuration file of final drive.
(by the application system interface interchange) certain logic peripheral hardware (as logic password keypad) is used in business application operation, and application system is sought corresponding configuration parameters in configuration file, if find then load corresponding driving, otherwise fault processing.
Application system is called the initialization function that articulates the peripheral hardware driver, articulates the initialization of peripheral hardware driver, and carries out relevant treatment such as version information inspection.
The macro instruction of application system use business application and correlation parameter call and articulate the peripheral hardware driver, articulate driver and explain macro instruction and correlation parameter, carry out the peripheral hardware operation of being correlated with (send actual peripheral hardware instruction to actual physical equipment, this instruction is directly to instruct according to actual physical at driver to write in the driver).
Application system is called realizing interface that all systems that loaded articulate the peripheral hardware driver and is carried out resource and discharge when withdrawing from.
The whole detailed operation flow process of application system as shown in Figure 6.Describe the detailed operation flow process of expanding peripherals structure in application system among the figure in detail, a real application system also can comprise the workflow that other is relevant certainly.Step 601, application system starts; Step 602, the reading terminals configuration file; Step 603 according to the parameter of terminal configuration file, loads final drive, its initial work of Xingqi of going forward side by side; Step 604, the operation business application; Step 605 is called the peripheral hardware driving interface, if successfully enter step 606, otherwise enters step 616, carries out error handling processing; Step 606 drives searching and the corresponding logic peripheral hardware of logic peripheral hardware sign the set from the peripheral hardware that articulates the peripheral configuration file; Step 607 has judged whether corresponding configuration, has then to enter step 108, otherwise enters step 616, carries out error handling processing; Step 608 loads and articulates the peripheral hardware driving; Step 609, initialization articulate peripheral hardware and drive; Step 610, system call articulate the macro instruction of driver and handle, and transmit macro instruction and relevant parameter; Step 611 articulates the physics peripheral hardware instruction that the peripheral hardware driver finishes the function request with the pairing physical equipment of macro instruction and sends the physics peripheral hardware to by the physics Peripheral Interface after the final drive interface initialization (serial ports, parallel port etc.); Step 612, business application are carried out other service logic; Step 613, whether application system withdraws from, if do not withdraw from then enter step 404, otherwise enters step 614; Step 614 is called and is articulated peripheral hardware driving release final drive interface and peripheral hardware driving interface, with free system resources; Step 615, system withdraws from.
Every type logical device correspondence to articulate the function that peripheral hardware drive to require realizes be consistent, and must be consistent, so just can shield business application and develop difference between use and the different peripheral hardware.
Different physical equipments has different peripheral hardware instructions, in order to realize identical logical device function request, is to drive realization with the different peripheral hardwares that articulates in system.
The use of new model equipment only is the exploitation that drives of new physical equipment and the change of configuration, and the macro instruction function request that business application is sent is had no effect.
The increase of newtype equipment is the increase of a logic peripheral hardware to system software, the macroinstruction set that definition is relevant, and the logical device ID that definition is relevant writes the corresponding driving program and just can be increased in the system.Business application is also had no effect.
Below with bank's front end system of a simplification as model, set up a front end applications system of bank that uses the expanding peripherals architecture.
At first define the logical device of front end applications system.According to the demand of this banking, in the front end applications system of this bank, support the magnetic stripe read-write of bankbook or card, and need access to your password device input user's password of user.Therefore, can define this system and use two logic peripheral hardwares: logic magnetic stripe read write line and logic password keypad, the sign in system is respectively MSFRW and PINKEY.The actual physical device configuration parameter of these two logical device correspondences is as shown in the table.
Table 3 logic is made as the configuration file of password keypad and magnetic stripe read write line outward
The logic peripheral hardware Interface type (0 string/1 also) Integer Baud rate Integer Data bit (Byte) Position of rest (Byte) Connector Integer Check bit (Byte) Overtime (second) Integer Peripheral hardware drives String
Password keypad (PINKEY) 0 9600 8 1 11 0 10 PinKeyDrv
Magnetic stripe read write line (MSFRW) 0 9600 8 1 12 0 10 MsfRWDrv
The definition of macroinstruction set.In the magnetic stripe read write line of reality, its instruction is very abundant, the instruction of each producer (table 4 is certain producer's model magnetic stripe read write line command set sample) also inequality, but function basically identical all.
Table 4 read command
Order Function Data are returned form
ESC] Read the 2nd magnetic track ESC?s?TK2data?FS
ESC?T] Read the 3rd magnetic track ESC?s?A?TK3data?FS
ESC?B] Read the 2-3 magnetic track ESC?s?TK2data?A?TK3data?FS
If the read track data are made mistakes, then return DEL (7f)
Table 5 write order
Order Function
ESC?t?TK2data?GS?ESC\ Read the 2nd magnetic track
ESC?t?A?TK3data?GS?ESC\ Read the 3rd magnetic track
ESC?t?TK2data?A?TK3data?GS?ESC\ Read the 2-3 magnetic track
Read-write operation state echo command: ESC j
Table 6 status code
Magnetic track The return state sign indicating number
The 2nd magnetic track ESC?r?p/q
The 3rd magnetic track ESC?T?r?p/q
The 2-3 magnetic track ESC?B?r?p/q
Annotate: last p of return code represents success, and q represents failure; ESC j order can be followed after read/write command and be sent, if no read/write operation, this order is invalid.
Hot reset order: ESC 0
General magnetic stripe read write line has following function: read 2 magnetic tracks, read 3 magnetic tracks, read the 2-3 magnetic track, write 2 magnetic tracks, write 3 magnetic tracks, write the 2-3 magnetic track.Data layout to magnetic stripe on the business also is no more than this scope, the macroinstruction set that therefore can define logic magnetic stripe read write line is corresponding with physical function, and its macroinstruction set is { read 2 magnetic tracks, read 3 magnetic tracks, read the 2-3 magnetic track, write 2 magnetic tracks, write 3 magnetic tracks, write the 2-3 magnetic track }.Similarly to the password keypad, can define its macroinstruction set and be { input password, again input password }.
This bank's front end system is that business application defines following business application development interface:
Interface name (logical device sign, macro instruction, parameter)---rreturn value is represented successfully to fail;
Business application is by this business application development interface, logical device identify, certain macro instruction of logical device and parameter that macro instruction needs be as the parameter of this business application development interface, the actual physical device that just can using system disposes.
The total interface that is provided as preceding step 4 is provided for writing of peripheral hardware driver in this application front end system of bank.The driver of terminal is that write parallel port or USB interface etc. according to the serial ports of the terminal of reality, and the related function interface in the performing step 4 is used to realize that writing of macro instruction function request physics peripheral hardware driver also is that equipment according to reality is write.
Above certain producer's password keypad hardware instruction set as shown in the table:
Certain producer's password keypad hardware instruction set of table 4
Just part instruction Functional description
ESC?I Green light is bright, and " you are good for voice one! Please input password ", allow input, send system by packing behind " affirmation " key
ESC?E Green light is bright, and voice two " are please imported once " again, allows input, send system by packing behind " affirmation " key
X88 (representing 16 system bytes 88) Warning light goes out, and forbids input
This producer's keypad driving interface is defined as follows:
Initialization (final drive function pointer structure, connectivity port, baud rate, data bit, position of rest, parity checking sign, overtime), wherein in initialization, preserve the final drive function pointer, preserve the connectivity port, preserve baud rate, preserve data bit, preserve position of rest, preserve the parity checking sign, preserve overtime;
Communication (macro instruction, input parameter buffer zone, input parameter length, output parameter buffer zone, output parameter data length buffer zone), wherein macro instruction is respectively the input password in communication interface, inputs two in password again.
Concrete physics peripheral hardware hardware instruction is in the input password macro instruction: call and open the serial ports function in the final drive interface, transmit relevant parameters such as baud rate; Call and write the serial ports function in the final drive interface, send voice one instruction (ESC I); Call final drive and read serial ports function in the interface, the input of reading the password keypad; Call and write the serial ports function in the final drive interface, send and close password keypad instruction (x88); Call and close the serial ports function in the final drive interface, close serial ports.
Inputing physics peripheral hardware hardware instruction concrete in the password macro instruction again is: call and open the serial ports function in the final drive interface, transmit relevant parameters such as baud rate; Call and write the serial ports function in the final drive interface, send voice two instructions (ESC E); Call and read serial ports function, the input of reading the password keypad in the final drive interface; Call and write the serial ports function in the final drive interface, send and close password keypad instruction (x88); Call and close the serial ports function in the final drive interface, close serial ports.
If make mistakes then return the code of makeing mistakes, otherwise the copying data of reading to the output parameter buffer zone, output parameter length is copied to output parameter data length buffer zone.
Discharge (), discharging resource interface does not have special parameter in this example, because do not apply for special resource, not as special cleaning work.
Two special driving interface also are provided in addition, obtain and articulate peripheral hardware and drive version number and obtain the peripheral hardware information that articulates, wherein:
Obtain and articulate peripheral hardware driving version number's (edition data buffer zone), copy physics peripheral hardware hardware driving instruction version number is to the edition data buffer zone.
Obtain the peripheral hardware information that articulates (information data buffer zone), copy physics peripheral hardware hardware information is to the information data buffer zone.
Specifying these two drivers that articulate peripheral hardware password keypad respectively is PinKeyDrv, and magnetic stripe read write line driver is MsfRSDrv.At this moment, one is used the front end applications system of bank of expanding peripherals structure just to set up.
How introduce it below operates.In this system, there be situation, the driver of logic magnetic stripe read write line and the driver of logic password keypad of configuration file configuration peripheral hardware in system.Application system is loaded into the driver of these peripheral hardwares in the system according to configuration.As the business procedure development interface that a business application provides by this system, " input password " macro instruction just can access to your password the input cryptographic function of keypad as parameter.
If the new model password keypad devices that has another one producer to provide, in order in this bank's front end system, to use, only need write corresponding password keypad devices driver called after OPinKeyDrv, in the configuration file of this front end applications system of bank, the driving of password keypad is revised as new device drives OPinKeyDrv, bank's front end system does not need to revise, business application does not need to make an amendment yet, but can use the new model password keypad devices of other producer.If the equipment of new model has new function, we only need the macro instruction of the new function of definition, add the realization of new functional macroinstruction at driver, use new macro instruction in business procedure, so just can use new peripheral functionality, front end applications system of bank does not need to revise fully.Expansion equipment structural system seems masterly especially for the use of different peripheral hardware connected modes, and only parameters such as the connection type of the configuration file of needs modification application system, connected mode get final product.
Because the needs of business development, we need use deposit book printers in system.In bank's front end system, we need define logic deposit book printers, and define its PRT that is designated, the macroinstruction set of corresponding definition logic deposit book printers, and develop handbook according to the deposit book printers that reality is used and write the physics peripheral hardware hardware drive program of the function of finishing macro instruction.Like this, just can in business procedure, deposit book printers have been used.And front end applications system of bank does not need to change, and has just increased the configuration of deposit book printers in configuration file.
Fig. 7 is this bank's front end applications system physical connection diagram.Front end applications system of bank moves on unix server, and driver is also placed in unix server and operation in the above.
The system construction drawing that Fig. 8 moves on the far-end unix server for Fig. 7 application system.As shown in the figure, in application system, read configuration file, the configuring condition file that in this configuration file, has terminal among the figure, application system is called the final drive program by the final drive development interface that peripheral hardware drives development interface, business software drives development interface to peripheral hardware and sends the request of macro instruction function, comprise logic peripheral hardware sign and relevant parameters information in this function request, peripheral hardware driving development interface sends to certain with the request of macro instruction function and articulates peripheral hardware driving development interface accordingly, this articulates, and peripheral hardware driving development interface analyzes and the logic peripheral hardware of the use that requires, search and the corresponding physics peripheral hardware driving of logic peripheral hardware by the configuration file unit by the peripheral hardware matching unit, the macro instruction compilation unit is searched the corresponding physics peripheral hardware driving command of finishing this macro instruction function according to physics peripheral hardware and macro instruction, send this physics peripheral hardware driving command to terminal, terminal is again according to the regulation of physics Peripheral Interface, send the physics peripheral hardware to according to serial ports or parallel port or USB interface rule, to finish the function request of business software.
Beneficial effect of the present invention is, has shielded business application and has used peripheral hardware and the specifically influence of peripheral hardware difference, brings great convenience for simultaneously the maintenance and expansion of application system, realizes seamless being linked in the system of the same type peripheral hardware of different vendor.The peripheral hardware of standard is handled macroinstruction set, and unified USBDI is the expansion of peripheral hardware, and the use of newtype equipment provides one conveniently to insert approach.
Above embodiment only is used to illustrate the present invention, but not is used to limit the present invention.

Claims (14)

1. the method for an expanding peripherals is characterized in that may further comprise the steps:
Application system loads the step of final drive by the final drive development interface;
Business software sends the step of macro instruction function request by articulating peripheral hardware driving development interface to the logic peripheral hardware;
Adopt with the described peripheral hardware that articulates and drive the peripheral hardware matching unit that development interface is connected,, search the step of determining with the corresponding physics peripheral hardware driving of described logic peripheral hardware according to the macro instruction function request of business software;
Peripheral hardware drives the physics peripheral hardware instruction of finishing macro instruction of calling storage, finishes the step of function request with the operating physical peripheral hardware.
2. the method for a kind of expanding peripherals according to claim 1 is characterized in that, comprises that also application system is by reading the step that a configuration file loads final drive in the step of application system by final drive development interface loading final drive.
3. the method for a kind of expanding peripherals according to claim 2 is characterized in that, described configuration file comprises terminal name and final drive program field.
4. the method for a kind of expanding peripherals according to claim 1, it is characterized in that, articulating of the macro instruction function request of peripheral hardware driving development interface according to business software, search in the step of determining to drive and also comprise, load the step that drives with the corresponding physics peripheral hardware of described logic peripheral hardware according to a configuration file with the corresponding physics peripheral hardware of described logic peripheral hardware.
5. the method for a kind of expanding peripherals according to claim 4 is characterized in that, described configuration file comprises interface type, baud rate, data bit, position of rest, connector, check bit, overtime, peripheral hardware driver field.
6. the method for a kind of expanding peripherals according to claim 1 is characterized in that, also comprises after the operating physical peripheral hardware is finished the step of function request, discharges final drive development interface resource and articulate peripheral hardware to drive the development interface resource.
7. the method for a kind of expanding peripherals according to claim 1 is characterized in that, application system and business software drive development interface and final drive development interface, articulate peripheral hardware driving development interface Data transmission by peripheral hardware.
8. the system of an expanding peripherals is characterized in that,
The final drive development interface, application system loads final drive by the final drive development interface;
Articulate peripheral hardware and drive development interface, the final drive development interface is used to receive business software macro instruction function request msg, analyzes the logic peripheral hardware of function request correspondence;
The peripheral hardware matching unit is connected with the described peripheral hardware driving development interface that articulates, and is used to search the pairing physics peripheral hardware of described logic peripheral hardware and drives;
The macro instruction compilation unit is connected with described peripheral hardware matching unit, is used for searching the physics peripheral hardware driving command collection of finishing the request of described macro instruction function in the described corresponding physical peripheral hardware driving that finds out;
The physics Peripheral Interface, an end is connected with described macro instruction compilation unit, and the other end is connected with the physics peripheral hardware, receives the physics peripheral hardware driving command of macro instruction compilation unit, sends the function request that the physics peripheral hardware makes it to finish business software to.
9. the system of a kind of expanding peripherals according to claim 8, it is characterized in that also comprising a configuration file unit, described configuration file unit is connected with described final drive development interface, described configuration file stores the terminal configuration file in the unit, according to described terminal configuration file load final drive.
10. the system of a kind of expanding peripherals according to claim 9 is characterized in that, described terminal configuration file comprises terminal name and final drive program field.
11. the system of a kind of expanding peripherals according to claim 9, it is characterized in that, described configuration file unit is connected with described peripheral hardware matching unit, store in the described configuration file unit and articulate the peripheral configuration file, described peripheral hardware matching unit is searched in the configuration file unit with described logic peripheral hardware corresponding physical peripheral hardware and is driven.
12. the system of a kind of expanding peripherals according to claim 11 is characterized in that, the described peripheral configuration file that articulates comprises interface type, baud rate, data bit, position of rest, connector, check bit, overtime, peripheral hardware driver field.
13. the system of a kind of expanding peripherals according to claim 8 is characterized in that, described physics Peripheral Interface comprises: serial line interface, parallel interface, USB interface, network interface.
14. the system of a kind of expanding peripherals according to claim 8 is characterized in that also comprising that a peripheral hardware drives development interface, is used to receive the data-signal of application system and business software, sends the final drive development interface to and articulate peripheral hardware to drive development interface.
CNB2005101025473A 2005-09-08 2005-09-08 Method and system for expanding peripherals Active CN100367253C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005101025473A CN100367253C (en) 2005-09-08 2005-09-08 Method and system for expanding peripherals

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005101025473A CN100367253C (en) 2005-09-08 2005-09-08 Method and system for expanding peripherals

Publications (2)

Publication Number Publication Date
CN1737779A CN1737779A (en) 2006-02-22
CN100367253C true CN100367253C (en) 2008-02-06

Family

ID=36080580

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005101025473A Active CN100367253C (en) 2005-09-08 2005-09-08 Method and system for expanding peripherals

Country Status (1)

Country Link
CN (1) CN100367253C (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011073822A1 (en) * 2009-12-16 2011-06-23 Koninklijke Philips Electronics N.V. Universal medical device driver adapter
CN102289416B (en) * 2011-07-12 2015-03-04 信雅达系统工程股份有限公司 Image collection method based on virtual hardware equipment
CN103257894B (en) * 2012-02-20 2018-08-10 联想(北京)有限公司 A kind of method and electric terminal of management program
CN102831707B (en) * 2012-08-09 2015-04-22 北京南天软件有限公司 Universal peripheral driving interface
CN103136583B (en) * 2013-03-07 2016-03-23 中国工商银行股份有限公司 A kind of online counting equipment and system
CN107491304B (en) * 2017-08-07 2021-04-09 浪潮金融信息技术有限公司 Method for realizing SIU driving function based on IPSM and IO control board
CN108255757A (en) * 2018-01-02 2018-07-06 中国工商银行股份有限公司 Concentration call method, device and the system of peripheral hardware
CN109032677A (en) * 2018-07-13 2018-12-18 中国建设银行股份有限公司 Bank counter peripheral equipment management method and device
CN110362354A (en) * 2019-07-18 2019-10-22 国网四川省电力公司 RFID code reader external interface unified driving management system and method
CN113190261B (en) * 2020-01-14 2024-03-29 深圳怡化电脑股份有限公司 Device driving configuration method, device driving method, device and terminal device
WO2021161523A1 (en) * 2020-02-14 2021-08-19 三菱電機株式会社 Drive control device and drive control system
CN113296747B (en) * 2021-07-27 2021-10-15 南京理控物联技术有限公司 Method for efficiently docking various mounting devices through software in intelligent lamp pole system
CN113918132A (en) * 2021-12-13 2022-01-11 珠海市新德汇信息技术有限公司 Equipment standardization management method, system, working method, device and storage medium
CN115277778B (en) * 2022-07-29 2023-09-15 平安科技(深圳)有限公司 Configuration method and device of Internet of things system, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1193774A (en) * 1997-03-17 1998-09-23 国际商业机器公司 Dynamic extension of static device drivers
US5910180A (en) * 1995-11-21 1999-06-08 Diamond Multimedia Systems, Inc. Context virtualizing device driver architecture
CN1424649A (en) * 2003-01-09 2003-06-18 清华大学 Robot controller with opening structure
CN1441338A (en) * 2002-02-27 2003-09-10 微软公司 Open type systemic structure flash storage driving program
CN1451119A (en) * 1999-12-30 2003-10-22 高通股份有限公司 Virtual device architecture for mobile telephones
CN1455331A (en) * 2002-04-23 2003-11-12 佳能株式会社 Apparatus driver capable of enlarging
US6694378B1 (en) * 1998-12-22 2004-02-17 Intel Corporation Extension of device driver objects
US20040085572A1 (en) * 2002-10-31 2004-05-06 Gomez Jorge M. Print driver for an extended printing device
CN1609829A (en) * 2003-10-24 2005-04-27 英业达股份有限公司 Plug-and-play method for USB equipment under linux operation system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5910180A (en) * 1995-11-21 1999-06-08 Diamond Multimedia Systems, Inc. Context virtualizing device driver architecture
CN1193774A (en) * 1997-03-17 1998-09-23 国际商业机器公司 Dynamic extension of static device drivers
US6694378B1 (en) * 1998-12-22 2004-02-17 Intel Corporation Extension of device driver objects
CN1451119A (en) * 1999-12-30 2003-10-22 高通股份有限公司 Virtual device architecture for mobile telephones
CN1441338A (en) * 2002-02-27 2003-09-10 微软公司 Open type systemic structure flash storage driving program
CN1455331A (en) * 2002-04-23 2003-11-12 佳能株式会社 Apparatus driver capable of enlarging
US20040085572A1 (en) * 2002-10-31 2004-05-06 Gomez Jorge M. Print driver for an extended printing device
CN1424649A (en) * 2003-01-09 2003-06-18 清华大学 Robot controller with opening structure
CN1609829A (en) * 2003-10-24 2005-04-27 英业达股份有限公司 Plug-and-play method for USB equipment under linux operation system

Also Published As

Publication number Publication date
CN1737779A (en) 2006-02-22

Similar Documents

Publication Publication Date Title
CN100367253C (en) Method and system for expanding peripherals
KR950009573B1 (en) Automatic device configuration for dockable portable computers
CN100568211C (en) Realize method and the device of a plurality of I2C of visit with programming device from device
CN100511156C (en) Apparatus for compulsively terminating thread blocked on input/output operation and method for the same
CN105051682B (en) software interface for hardware device
CN106462375B (en) Graphics pipeline status object and model
CN110515641A (en) The update method of server firmware, apparatus and system
CN103460188A (en) Technique for live analysis-based rematerialization to reduce register pressures and enhance parallelism
CN107590070B (en) Business process debugging method and device
CN1987797A (en) Method and system for avoiding software conflict
CN1650276B (en) ATA/SATA combined controller
JPH08314704A (en) Generation system of control program
US6658644B1 (en) Services-based architecture for a telecommunications enterprise
CN109426613A (en) The method and its computer system of tune-up data are retrieved in UEFI
CN101714124A (en) Memory protection method, information processing apparatus
CN102567268A (en) Detection method for USB to virtual serial port/MODEM
CN114089975A (en) Expansion method and device of computing software, nonvolatile storage medium and processor
CN100489777C (en) Intelligent platform management interface firmware architecture and method of building the same
CN102253845B (en) Server system
CN105229600B (en) Capability-based device driver frame
CN112415943A (en) IO port configuration device and method and PLC configuration software
CN114153477B (en) PCIE driving card firmware upgrading method, device, system, equipment and medium
CN101178653A (en) Embedded system and method supporting various processor
CN100561527C (en) Improved smart card system
CN100416512C (en) Embedded apparatus debugging method and debugging tool therefor

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