CN104571962B - The implementation method of firmware in a kind of USBKEY equipment of suitable batch production - Google Patents

The implementation method of firmware in a kind of USBKEY equipment of suitable batch production Download PDF

Info

Publication number
CN104571962B
CN104571962B CN201410854502.0A CN201410854502A CN104571962B CN 104571962 B CN104571962 B CN 104571962B CN 201410854502 A CN201410854502 A CN 201410854502A CN 104571962 B CN104571962 B CN 104571962B
Authority
CN
China
Prior art keywords
equipment
firmware
usbkey
agreement
udk
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
CN201410854502.0A
Other languages
Chinese (zh)
Other versions
CN104571962A (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.)
Dynamicode Co Ltd
Original Assignee
Dynamicode Co Ltd
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 Dynamicode Co Ltd filed Critical Dynamicode Co Ltd
Priority to CN201410854502.0A priority Critical patent/CN104571962B/en
Publication of CN104571962A publication Critical patent/CN104571962A/en
Application granted granted Critical
Publication of CN104571962B publication Critical patent/CN104571962B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/38Universal adapter
    • G06F2213/3854Control is performed at the peripheral side

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Systems (AREA)
  • Stored Programmes (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a kind of implementation method of firmware in USBKEY equipment of suitable batch production, this method is previously written the response message for enumerating response message and device protocol of the fixation of different agreement.In the enumeration request stage, PC can send out enumeration request order, and firmware decomposes request command, according to different requests, enumerations information fixed in advance, then be returned to PC.The information that PC can just return according to USB firmwares, corresponding handle is carried out to the USB device:If returning to UDK fixation enumerations information, equipment is just identified as UDK equipment, if returning to CCID fixes enumerations information, equipment is just identified as CCID equipment.Into after relevant device, entry communication stage, every kind of agreement does not have fixed form, according to the order of agreement, does corresponding processing, returns to corresponding data.Using the firmware design method of this programme, production link can be simplified, USBKEY production efficiency is greatly improved.

Description

The implementation method of firmware in a kind of USBKEY equipment of suitable batch production
Technical field
The present invention relates to a kind of USBKEY technologies, and in particular to a kind of USBKEY firmware techniques.
Background technology
USB Key are a kind of hardware devices of USB interface.Its built-in single-chip microcomputer or intelligent card chip, there is certain storage Space, the private key and digital certificate of user can be stored, be realized using the public key algorithm built in USB Key to user identity Certification.Because private key for user is stored in coded lock, make all read in any way in theory, therefore ensure that user recognizes The security of card.
Because USBKEY has obtained a wide range of applications in security fields, so USBKEY production firm is providing production During product, the product for being supplied to customer quantity very big at the appointed time is generally required, this just needs the production effect for improving USBKEY Rate.
But because different customer requirements is inconsistent, for example require that the communications protocol of USBKEY bottoms has plenty of CCID associations View, has plenty of UDK agreements, or other agreements, and the tool of production species of preset data is various when causing to produce, bad dimension Shield, USBKEY production efficiency is reduced on the contrary.
An other problem is that current PC ends only have UDK agreements to support port binding function, can not powered off In the case of give the specific multiple port transmission program data of HUB, to be powered off in the case of other agreements after plug identification again Data can be sent to multiple ports, if the quantity of USBKEY productions is big, and also needs to constantly power-off and upper electricity, this will Strong influence efficiency.
The content of the invention
The problem of in the presence of existing USBKEY production processes, it is an object of the invention to provide one kind to be adapted to batch The implementation method of firmware in the USBKEY equipment of production, USBKEY production efficiency can greatly be improved.
In order to achieve the above object, the present invention adopts the following technical scheme that:
The implementation method of firmware, methods described comprise the following steps in a kind of USBKEY equipment of suitable batch production:
(1) in the firmware program of USBKEY equipment, the enumerating for fixation for being previously written different agreement and sets response message The response message of standby communication protocol;
(2) in the enumeration request stage, PC can send out enumeration request order, and firmware decomposes request command, please according to different Ask, fixed in advance is enumerated response message, then be returned to PC;
(3) information that PC returns according to USB firmwares is handled accordingly:If return to UDK fixation enumerations information, equipment Just it is identified as UDK equipment;If returning to CCID fixes enumerations information, equipment is just identified as CCID equipment;
(4) after setting into relevant device, in the entry communication stage, according to the communication format of corresponding agreement, located accordingly Reason, and return to corresponding data.
In a preferred scheme, the specific implementation process of methods described is as follows:
(1) the fixation enumerations information of associated communication agreement and corresponding is set first in the firmware program of USBKEY equipment Communications protocol;
(2) during USBKEY equipment first powers on, PC can send enumeration request information, and firmware is enumerated into single UDK agreements, PC ends, which will identify that, carrys out the agreement, special production port the Bind tool is recycled, to corresponding port USBKEY sends special prefab data, after related data write-in, then writes the special flag bit of user communication agreement;
(3) USBKEY device powers downs are restarted, and judge that what be enumerated sets according to flag bit when firmware is restarted Standby type, then returns to corresponding enumerations information so that USBKEY equipment forms corresponding communications protocol equipment.
Further, in the step (2) in the special flag bit of write-in user communication agreement, by USBKEY equipment Firmware program call FLASH read/write function, write corresponding data on the address determined in USB device built-in FLASH.
Firmware implementation method inside USBKEY provided by the invention, i.e., it can uniformly utilize UDK agreements in the production phase Carry out prefab data operation;The CCID communications protocol required for client can be become in service stage, complete normal user's work( Energy;Using the firmware design method of this programme, production link can be simplified, USBKEY production efficiency is greatly improved.
Brief description of the drawings
Fig. 1 is the realization principle schematic diagram of firmware in USBKEY in the present invention;
Fig. 2 is the specific process chart in the present invention.
Embodiment
In order that the technical means, the inventive features, the objects and the advantages of the present invention are easy to understand, tie below Conjunction is specifically illustrating, and the present invention is expanded on further.
The present invention can realize the enumerations information of the agreements such as UDK agreements, CCID and corresponding communication association first in firmware program The handling process of view, response message and equipment are enumerated by the fixation in USB firmware program, being previously written different agreement The response message of agreement.
In the enumeration request stage, PC can send out enumeration request order, and firmware decomposes request command, according to different requests, Enumerations information fixed in advance, then it is returned to PC.
The information that PC can just return according to USB firmwares, corresponding handle is carried out to the USB device:If return to UDK fixation Enumerations information, equipment are just identified as UDK equipment, if returning to CCID fixes enumerations information, equipment is just identified as CCID and set It is standby.
Into after relevant device, entry communication stage, every kind of agreement does not have fixed form, according to the order of agreement, Corresponding processing is done, returns to corresponding data.
Based on above-mentioned principle, concrete scheme of the invention is as follows:
Referring to Fig. 1, it show in this programme the realization principle schematic diagram of firmware in USBKEY.As seen from the figure, it is solid at this The processing of two kinds of agreements of UDK communications protocol and CCID communications protocol and mutual switching are realized in part program.Whole process is divided into Three phases:Before production, production when and production after the completion of.
Before manufacture, the complete process of two kinds of usb protocols is realized in firmware program:CCID enumerate terminal point information and CCID passage processing, the UDK passage for enumerating terminal point information and UDK processing.
In the production phase, when agreement does not have before switching, USBKEY equipment acquiescence is UDK agreements, and firmware can only connect The data that UDK end points is sent are received, so during USBKEY equipment first powers on, PC can send enumeration request information, Firmware decomposes request command, and because USBKEY equipment acquiescence is UDK agreements, therefore firmware enumerates into single UDK agreements.PC ends phase The port answered, which will identify that, carrys out the agreement, and PC ends will utilize special production port the Bind tool (i.e. the tool of production), pass through UDK End points sends special prefab data (such as password or certificate) to the USBKEY of corresponding port;Firmware receives PC ends and sent Data after, USBKEY COS systems will be called to carry out the read-write of data, after the completion of prefab data read-write, then write user The special flag bit of communications protocol (i.e. corresponding FLASH certain bits), for representing the agreement to be switched to (i.e. next time CCID protocol).
In the special flag bit of write-in user communication agreement, firmware program calls FLASH read/write function, is set in USB Corresponding flag bit data are write on the address determined in standby built-in FLASH, if writing data 1, then the number on the address According to being exactly 1;2 are write, data are exactly 2 on the address.Wherein, data 0:The equipment for representing single UDK;Data 1:Represent CCID The equipment of agreement;Data 2:CCID+UDK equipment complex.
After the completion of production phase, after USBKEY is re-powered, USBKEY first detect whether be USB acquiescence operating protocol (such as single UDK agreements);If it is not, then detection flag bit, according to the flag bit of production write-in, is switched to the agreement of user job (i.e. CCID protocol), USBKEY will enumerate into CCID protocol.Now, the USBKEY equipment is identified as CCID equipment by PC ends, Communicated using CCID passages and USBKEY, according to receiving APDU orders, COS processing, the flow of return CCID data it is all and Renew, now UDK passages just no longer receive prefab data.
The process is in specific implementation, and after writing flag bit in FLASH, USB device needs plug again, again on After electricity, when PC sends respective request, according to the FLASH write before flag bit, the facility information after PC switchings is returned to :
If 1, data are enumerated in CCID fixation and return to PC, the equipment that such PC just treats as USB device CCID. If being cut into CCID protocol, fixed CCID protocol information is just returned to PC, equipment is just identified as CCID equipment naturally.Cause Not return UDK facility information, USB device would not also be treated as UDK equipment by PC.
When realize USBKEY internal firmwares based on such scheme, it can either be carried out in the production phase using UDK agreements Preset data operates, and so can effectively avoid using the different tools of production according to different agreements, cause tool of production kind Class is various, bad the problem of safeguarding reduction efficiency;It can also can become needed for client in USBKEY service stages simultaneously CCID communications protocol, normal user function is completed, so can effectively avoid USBKEY from constantly powering off in process of production Again the problem of plug identification influences efficiency.
Except realizing CCID communications protocol, it can also equally realize that other communications protocol are fixed by such scheme, specifically Realization principle and scheme it is same as described above, be not repeated here herein.
Referring to Fig. 2, it show such scheme in the specific implementation, the main working process figure of USBKEY firmwares.By scheming Understand, whole process flow is as follows:
1st, USBKEY equipment carries out the initialization of related device first since principal function main () entrance,
2nd, the switching mark of usb protocol is read, is ready to enumerate processing.
The appropriate address data in FLASH are read first, the address is not write before manufacture, and it is acquiescence such as to read out Value 0, expression are single UDK equipment, then PC first can send enumerations information request to end points is enumerated, after USB device receives, The fixed data (such as figure left side) for there was only UDK information will be returned to PC, USB device has then just been treated as UDK equipment by PC.This The identification of equipment just completes when individual.
3rd, accordingly, into while (1) major cycle process, the data of various applications are handled.
4th, what is received first is the interruption for enumerating end points, and after receiving enumeration request, firmware is read according in step (2) Protocol switching indexed variable occurrence, do corresponding answer treatment:If the value of protocol switching indexed variable points to CCID associations View, then return to CCID enumerations informations;If the value of protocol switching indexed variable points to UDK agreements, UDK enumerations informations are returned.
5th, USBKEY equipment enters read equipment during, according to the enumerations information of return, device enumeration into phase The protocol devices answered:If enumerating into UDK agreement, equipment is received by UDK end points reads UDK protocol massages data, and from Middle function decomposition into analytic function goes out APDU data, recalls COS systems and is handled, and response data is returned to by UDK passages again;
If enumerating into CCID agreement, equipment is received by CCID end points and reads CCID protocol message data, and therefrom Function decomposition into analytic function goes out APDU data, recalls COS systems and is handled, and response data is returned to by CCID passages again.By This completes the handling process of a data.
Relevant device is completed not into rear based on such scheme, you can enter the communication stage, PC is sent to UDK end points UDK protocol data, after equipment receives, corresponding UDK agreements are handled, return to PC processing data.In processing most Afterwards, if sending the special instruction of handoff protocol, after equipment receives, determination address that will be to FLASH, switching value, table are write The secondary agreement switched under showing, for example 1 is write, next power-off is meant that, after reinserting, becomes CCID protocol.
Before powering off again, CCID protocol processes flow code can't perform, because current or single UDK association View, after re-powering, workflow graph in execution, because protocol switching value has changed, then in device enumeration, equipment can judge This value (the figure left side) will return to CCID fix information, so, equipment has reformed into setting for CCID if CCID value Standby rather than UDK equipment.
From the foregoing, it will be observed that in production, only use and enumerate end points and UDK Path end points, CCID flow will not be gone to.
It has been produced that, after re-powering, switch to CCID, just only used and enumerate end points and CCID Path end points without using UDK Path end points.
The general principle and principal character and advantages of the present invention of the present invention has been shown and described above.The technology of the industry Personnel are it should be appreciated that the present invention is not limited to the above embodiments, and the simply explanation described in above-described embodiment and specification is originally The principle of invention, without departing from the spirit and scope of the present invention, various changes and modifications of the present invention are possible, these changes Change and improvement all fall within the protetion scope of the claimed invention.The claimed scope of the invention by appended claims and its Equivalent thereof.

Claims (3)

1. the implementation method of firmware in a kind of USBKEY equipment of suitable batch production, it is characterised in that the implementation method exists The handling process of UDK agreements, the enumerations information of CCID protocol and corresponding communications protocol is realized in firmware program first, by In USB firmware program, the response message for enumerating response message and device protocol of the fixation of different agreement is previously written, it is described Method comprises the following steps:
(1) in the firmware program of USBKEY equipment, be previously written different agreement fixation enumerate response message and equipment is led to Believe the response message of agreement;
(2) in the enumeration request stage, PC can send out enumeration request order, and firmware decomposes request command, according to different requests, Fixed in advance enumerates response message, then is returned to PC;
(3) information that PC returns according to USB firmwares is handled accordingly:If return UDK fixation enumerations information, equipment just by It is identified as UDK equipment;If returning to CCID fixes enumerations information, equipment is just identified as CCID equipment;
(4) after setting into relevant device, in the entry communication stage, according to the communication format of corresponding agreement, handled accordingly, and Return to corresponding data.
2. the implementation method of firmware, its feature in a kind of USBKEY equipment of suitable batch production according to claim 1 It is, the specific implementation process of methods described is as follows:
(1) the fixation enumerations information of associated communication agreement and corresponding communication are set first in the firmware program of USBKEY equipment Agreement;
(2) during USBKEY equipment first powers on, PC can send enumeration request information, and firmware is enumerated into single UDK agreements, PC ends, which will identify that, carrys out the agreement, special production port the Bind tool is recycled, to corresponding port USBKEY sends special prefab data, after related data write-in, then writes the special flag bit of user communication agreement;
(3) USBKEY device powers downs are restarted, the equipment class that should be enumerated according to flag bit judgement when firmware is restarted Type, then corresponding enumerations information is returned so that USBKEY equipment forms corresponding communications protocol equipment.
3. the implementation method of firmware, its feature in a kind of USBKEY equipment of suitable batch production according to claim 2 It is, in the step (2) in the special flag bit of write-in user communication agreement, is adjusted by the firmware program in USBKEY equipment With FLASH read/write function, corresponding data are write on the address determined in USB device built-in FLASH.
CN201410854502.0A 2014-12-31 2014-12-31 The implementation method of firmware in a kind of USBKEY equipment of suitable batch production Active CN104571962B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410854502.0A CN104571962B (en) 2014-12-31 2014-12-31 The implementation method of firmware in a kind of USBKEY equipment of suitable batch production

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410854502.0A CN104571962B (en) 2014-12-31 2014-12-31 The implementation method of firmware in a kind of USBKEY equipment of suitable batch production

Publications (2)

Publication Number Publication Date
CN104571962A CN104571962A (en) 2015-04-29
CN104571962B true CN104571962B (en) 2017-11-17

Family

ID=53088147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410854502.0A Active CN104571962B (en) 2014-12-31 2014-12-31 The implementation method of firmware in a kind of USBKEY equipment of suitable batch production

Country Status (1)

Country Link
CN (1) CN104571962B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255648B (en) * 2016-12-28 2021-07-20 航天信息股份有限公司 Production test method and system of electronic key USBKey
CN108877188B (en) * 2018-05-17 2020-10-16 济南诚博信息科技有限公司 Environment-friendly data concurrent acquisition and multi-network publishing method and device
CN113221073B (en) * 2021-07-08 2021-09-14 飞天诚信科技股份有限公司 Implementation method and device for increasing number of PIV application support certificates

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266590A (en) * 2008-04-22 2008-09-17 北京飞天诚信科技有限公司 Method and system for dynamically switching equipment arrangement
CN101872334A (en) * 2010-05-26 2010-10-27 北京飞天诚信科技有限公司 Compound type usb equipment and implementation method thereof
CN102043751A (en) * 2010-06-29 2011-05-04 北京飞天诚信科技有限公司 Method for identifying host operation system by using USB equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2969335B1 (en) * 2010-12-17 2013-07-05 Oberthur Technologies SAFETY EQUIPMENT MODULE AND PROCESSING METHOD IN SUCH A MODULE

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266590A (en) * 2008-04-22 2008-09-17 北京飞天诚信科技有限公司 Method and system for dynamically switching equipment arrangement
CN101872334A (en) * 2010-05-26 2010-10-27 北京飞天诚信科技有限公司 Compound type usb equipment and implementation method thereof
CN102043751A (en) * 2010-06-29 2011-05-04 北京飞天诚信科技有限公司 Method for identifying host operation system by using USB equipment

Also Published As

Publication number Publication date
CN104571962A (en) 2015-04-29

Similar Documents

Publication Publication Date Title
US10128910B2 (en) Mobile device with near field communication function
CN104571962B (en) The implementation method of firmware in a kind of USBKEY equipment of suitable batch production
RU2011149084A (en) INFORMATION PROCESSING DEVICE, INFORMATION PROCESSING METHOD, INFORMATION PROCESSING PROGRAM AND SYSTEM
CN105893097A (en) Method and device for processing option information of BIOS (basic input output system)
CN104516921A (en) Automatic response method and device
CN109241357A (en) Chain structure model and its construction method, system and terminal device
CN107247695A (en) Coding rule generation method, system and storage device
WO2020000657A1 (en) Method and apparatus for establishing operation and maintenance monitoring connection, terminal device, and medium
CN103984540A (en) Method and device for generating hardware interface running program
WO2012083632A1 (en) Method and system for controlling access to radio frequency identification tag
CN104578418B (en) Configuration method and system of automatic power distribution equipment based on 101 protocols, and equipment
CN110880965A (en) Outgoing electronic document encryption method, system, terminal and storage medium
CN101398884B (en) Smart card reader and its use method
CN110061988A (en) Method for authenticating, embedded device, service server and the storage medium of embedded device
CN103902496A (en) Device and method for USB KEY protocol conversion
CN107885674B (en) Bluetooth device simulator, working method thereof and Bluetooth device operating system
CN106227681B (en) A kind of dual port RAM access method of novel anti-collision
CN204667553U (en) A kind of ATM affaris safety trade system
CN114116699A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN201820240U (en) Three-in-one card reader
CN205247472U (en) Electron key system based on dual processor
CN202003392U (en) Intelligent chip and intelligent debit card
CN110288316A (en) The method and terminal device of transforming plant primary equipment work card arrangement
CN104182366A (en) Method for processing information and electronic devices
CN105592032A (en) Internet-based security information interaction method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant