Based on upgrade method and the system of the embedded device firmware of ActiveX
Technical field
The present invention relates to embedded device firmware upgrade field, particularly relate to the upgrade method based on the embedded device firmware of ActiveX and system.
Background technology
Along with the development of electronic information technology, embedded device has been widely applied to the every field of daily life.Because embedded device firmware itself exists the defect and the more and more diversified functional requirement of user needing to repair, embedded device needs constantly its firmware of upgrading.Upgrade method conventional in prior art be embedded device manufacturer to each user specific upgrade software and a firmware upgrade bag, utilize upgrade software to carry out firmware upgrade operation.Often carry a series of product type in embedded device, the firmware upgrade bag that the embedded device of each product type is upgraded required is at every turn not identical, causes firmware upgrade version information to be difficult to determine.When embedded device is sold to final user, for huge customer group, when having firmware updating to upgrade at every turn, embedded device manufacturer need notify that each final user carries out firmware upgrade, and send upgrade software and firmware upgrade bag, cause manufacturer to be difficult to the firmware upgrade of the embedded device safeguarding numerous client.In addition, if embedded device leaves the computing machine installing upgrade software, just cannot carry out firmware upgrade operation, the firmware upgrade of embedded device is restricted.Generally speaking, there is firmware upgrade operation complexity and the problem of firmware upgrade version management complexity in the firmware upgrade technology of current routine techniques.
Along with the development of Internet technology is with universal, the chance of the resource that people access on Internet gets more and more, and proposes higher requirement to web application exploitation, and particularly share related resource on internet, ActiveX control technology is arisen at the historic moment.ActiveX control also claims OLE control or OCX control, is some component softwares for Internet application and development or object, can be inserted in Web page or other application programs.ActiveX control technology provides a kind of mechanism that control can be embedded in Web page, and response is made to event, adopt ActiveX control technology that the hardware interface of computing machine and Internet interface are united two into one, eliminate the difference of various resource between local resource and Internet resources.
Summary of the invention
The technical problem to be solved in the present invention is and the problem of firmware upgrade version management complexity complicated for firmware upgrade operation, provide a kind of firmware upgrade operation simple and firmware upgrade version management easily based on upgrade method and the system of the embedded device firmware of ActiveX.
The technical solution adopted for the present invention to solve the technical problems is:
The invention provides the upgrade method of the embedded device firmware based on ActiveX, comprise the steps:
Whether computer auto-detection is provided with the supporting ActiveX control of the embedded device that is connected with described computing machine, if then wait-receiving mode triggers the trigger pip of ActiveX control; Then prompting downloads and installs the code signature certificate for identifying ActiveX control source and developer's information if not, after recognizing the success of described code signature certificate install, ActiveX control is installed in prompting, and waits for the trigger pip for controlling ActiveX control operation that user triggers;
Computing machine receives the trigger pip for controlling ActiveX control operation that user triggers, the information list being connected to the external equipment of computing machine is obtained by ActiveX control, from described information list, embedded device is found again by query manipulation, read the facility information of this embedded device, described facility information comprises the first type information and first version information; And record the routing information of described embedded device, utilize described routing information to set up communication port between described ActiveX control and described embedded device, make embedded device enter the upgrade mode with ActiveX control information interaction;
ActiveX control receives the selection information from user, and described selection information comprises Second-Type information and second edition information; The facility information of the embedded device selection information received found with ActiveX control carries out contrast and mates; If the first type information is consistent with the second type information and second edition information is greater than first version information time, then computer for controlling is to web server requests firmware upgrade bag;
The described firmware upgrade Packet forwarding from the webserver that receives to web server requests firmware upgrade bag, and is given described embedded device by ActiveX control computer for controlling;
After described embedded device receives described firmware upgrade bag, whether automatic detection is encrypted firmware AKU, if be then decrypted process to described firmware upgrade bag, perform and store described firmware upgrade bag after decryption processing; Then directly perform and store described firmware upgrade bag if not.
The present invention also provides the upgrade method of the embedded device firmware based on ActiveX, comprises the steps:
Computing machine receives the trigger pip for controlling ActiveX control operation that user triggers, and makes the embedded device be connected with computing machine enter the upgrade mode with ActiveX control information interaction;
The described firmware upgrade Packet forwarding from the webserver that receives to web server requests firmware upgrade bag, and is given described embedded device by ActiveX control computer for controlling;
Embedded device receives, performs and store described firmware upgrade bag.
Preferably, what described computing machine received that user triggers also comprised before controlling trigger pip that ActiveX control runs: whether computer auto-detection is provided with the supporting ActiveX control of the embedded device that is connected with described computing machine, if then wait-receiving mode triggers the trigger pip of ActiveX control; Then prompting downloads and installs the code signature certificate for identifying ActiveX control source and developer's information if not, after recognizing the success of described code signature certificate install, ActiveX control is installed in prompting, and waits for the trigger pip for controlling ActiveX control operation that user triggers.
Preferably, described computing machine receives the trigger pip triggering Active control, the embedded device be connected with computing machine is entered comprise with the step of the upgrade mode of ActiveX control information interaction: computing machine receive that user triggers for controlling the trigger pip that ActiveX control runs, the information list being connected to the external equipment of computing machine is obtained by ActiveX control, from described information list, embedded device is found again by query manipulation, read the facility information of this embedded device, described facility information comprises the first type information and first version information, and record the routing information of described embedded device, utilize described routing information to set up communication port between described ActiveX control and described embedded device, make embedded device enter the upgrade mode with ActiveX control information interaction.
Preferably, also comprised before web server requests firmware upgrade bag at described ActiveX control computer for controlling: ActiveX control receives the selection information from user, described selection information comprises Second-Type information and second edition information; The facility information of the embedded device selection information received found with ActiveX control carries out contrast and mates; If the first type information is consistent with the second type information and second edition information is greater than first version information time, then computer for controlling is to web server requests firmware upgrade bag.
Preferably, described embedded device receives, perform and the step storing described firmware upgrade bag comprises: after described embedded device receives described firmware upgrade bag, whether automatic detection is encrypted firmware AKU, if be then decrypted process to described firmware upgrade bag, perform after decryption processing and store described firmware upgrade bag; Then directly perform and store described firmware upgrade bag if not.
The present invention also provides the upgrade-system of the embedded device firmware based on ActiveX, comprising:
Detect trigger element: whether the ActiveX control that the embedded device that is connected with described computing machine is supporting is installed for making computer auto-detection, if then wait-receiving mode triggers the trigger pip of ActiveX control; Then prompting downloads and installs the code signature certificate for identifying ActiveX control source and developer's information if not, after recognizing the success of described code signature certificate install, ActiveX control is installed in prompting, and waits for the trigger pip for controlling ActiveX control operation that user triggers;
Trigger upgrade unit: for the trigger pip for controlling ActiveX control operation making computing machine receive user's triggering, the information list being connected to the external equipment of computing machine is obtained by ActiveX control, from described information list, embedded device is found again by query manipulation, read the facility information of this embedded device, described facility information comprises the first type information and first version information; And record the routing information of described embedded device, utilize described routing information to set up communication port between described ActiveX control and described embedded device, make embedded device enter the upgrade mode with ActiveX control information interaction;
Relatively processing unit: for making ActiveX control receive selection information from user, described selection information comprises Second-Type information and second edition information; The facility information of the embedded device selection information received found with ActiveX control carries out contrast and mates; If the first type information is consistent with the second type information and second edition information is greater than first version information time, then computer for controlling is to web server requests firmware upgrade bag; Otherwise point out not match information, repetitive operation;
Firmware transmission unit: for making ActiveX control computer for controlling to web server requests firmware upgrade bag, and give described embedded device by the described firmware upgrade Packet forwarding from the webserver that receives;
Firmware upgrade unit: after receiving described firmware upgrade bag for making embedded device, whether automatic detection is encrypted firmware AKU, if be then decrypted process to described firmware upgrade bag, perform and store described firmware upgrade bag after decryption processing; Then directly perform and store described firmware upgrade bag if not.
Preferably, described embedded device is connected to described computing machine by USB line or RS232 line.
Preferably, described firmware upgrade unit comprises upgrading load-on module, memory module and decryption processing module, and described upgrading load-on module communicates with described decryption processing module with described memory module respectively and is connected.
The present invention compared with prior art tool has the following advantages: the upgrade method of the embedded device firmware based on ActiveX provided by the present invention and system, can realize quickly and easily upgrading embedded device, specific upgrade software is provided to client without the need to manufacturer, only embedded device need to be connected on computing machine, and to be performed to web server requests download firmware AKU by ActiveX control.
Accompanying drawing explanation
Below in conjunction with drawings and Examples, the invention will be further described, in accompanying drawing:
Fig. 1 is the process flow diagram of the upgrade method of the embedded device firmware that the present invention is based on ActiveX.
Fig. 2 is the structural representation of the upgrade-system of the embedded device firmware that the present invention is based on ActiveX.
Embodiment
In order to there be understanding clearly to technical characteristic of the present invention, object and effect, now contrast accompanying drawing and describe the specific embodiment of the present invention in detail.
Based on a upgrade method for the embedded device firmware of ActiveX, comprise the steps:
After computing machine is opened, by USB line or RS232 line, embedded device is connected on computing machine, opens web browser and the access upgrading page.Whether computer auto-detection is provided with the supporting ActiveX control of the embedded device that is connected with computing machine, if be provided with ActiveX control, then wait-receiving mode user trigger for controlling the trigger pip that ActiveX control runs; If do not install ActiveX control, then prompting downloads and installs the code signature certificate for identifying ActiveX control source and developer's information, this code signature certificate is in order to ensure that ActiveX control is not maliciously tampered, if when computing machine does not recognize the code signature certificate of AcitveX control, can think that ActiveX control is that illegal program is tackled, therefore before installation ActiveX control, code signature certificate is first installed.Computing machine, after recognizing the success of code signature certificate install, points out user installation ActiveX control, and waits for the trigger pip for controlling ActiveX control operation that user triggers.
Computing machine receives the trigger pip for controlling ActiveX control operation that user triggers, the facility information being connected to the external equipment of computing machine is obtained by ActiveX control, this external equipment being connected to computing machine can be keyboard, mouse, sound equipment and the embedded device being built-in with embedded software, as mobile terminals such as intercoms.ActiveX control obtains the information list being connected to the external equipment of computing machine; From above-mentioned information list, embedded device to be upgraded is searched again by query manipulation, and read the facility information of this embedded device, this facility information comprises the first type information and first version information, and record the routing information of this embedded device, utilize the routing information of this embedded device to set up communication port between ActiveX control and embedded device, make embedded device enter the upgrade mode with ActiveX control information interaction.
Specifically, ActiveX control obtains the device identification number being connected to the external equipment of computing machine by USB line or RS232 line, this external equipment being connected to computing machine is USB interface or the RS232 interface device identification number that correspondence is different respectively, Windows system can be able to be differentiated to distinguish different types of external equipment by device identification number, device identification number as RS232 interface is { 4d36e978-e325-11ce-bfc1-08002be10318}, the device identification number of USB device is { 745a17a0-74d3-11d0-b6fe-00a0c90f57da}, external equipment in the present embodiment is USB device, then by calling WindowsAPI (application programming interfaces) function HidD_GetHidGuid() obtain an aforesaid device identification number, again the device identification number got is passed to api function SetupDiGetClassDevs() enumerate the information list of the external equipment of all access computing machines, for all external equipments enumerated again by Using API Function SetupDiEnumDeviceInterfaces() obtain the brief information of external equipment one by one, as device address etc., and the brief information got by Using API Function SetupDiGetDeviceInterfaceDetail() in addition expansion obtain the details of external equipment, to get the detailed path information of the external equipment in information, extract routing information and record.Routing information is passed to api function CreateFile() open embedded device; And by Using API Function HidD_GetAttributes() obtain the attribute information of this embedded device, the supplier ID(VID according in attribute information), whether product ID (PID) inquiry be embedded device required to be upgraded; In this way then stop search equipment, as otherwise continue to search, until the complete all equipment enumerated of all inquiries.The routing information recorded in the process of searching embedded device, and utilize api function CreateFile() open embedded device, to read the facility information of this embedded device, this facility information comprises the first type information and first version information.Specifically, utilize the routing information of the embedded device recorded to set up read handle and write handle, wherein, read handle for creating function reading ReadFiles() to carry out information interaction, write handle for creating write function WriteFile() to carry out information interaction, to set up the communication port between ActiveX control and embedded device, embedded device is made to enter the upgrade mode with ActiveX control information interaction.As by calling ReadFiles() function reads the facility information such as the first type information and first version information of embedded device, as Scanner_MS3.1, wherein the first type information is Scanner_MS, first version information is 3.1, if the selection information that the facility information read and user input is correct after comparing, utilizes this to read handle and write handle and set up communication port between ActiveX control and embedded device, embedded device is made to enter the upgrade mode with ActiveX control information interaction, specifically, ActiveX control is by call function WriteFile() write makes embedded device enter the information 0x01 of upgrade mode, 0xFF, 0xFF, embedded device call function ReadFiles() read information 0x01,0xFF, 0xFF, make embedded device enter upgrade mode.
After user's selection information of embedded device upgraded version that input selection is connected with computing machine on computers, ActiveX control receives the selection information from user, and this selection information comprises Second-Type information and second edition information; The facility information of the embedded device selection information received found with ActiveX control carries out contrast and mates; If the first type information is consistent with the second type information and second edition information is greater than first version information time, then computer for controlling is to web server requests firmware upgrade bag.Specifically, if input selection information is Scanner_MS3.1 or Scanner_2.1 i.e. its second type information to user is in a computer Scanner_MS, second edition information is 3.1 or 2.1, be Scanner_MS by itself and the first type information of embedded device inquired, first version information be 3.1 facility information carry out contrast coupling, first version information is not more than due to second edition information, therefore computing machine is not to web server requests firmware upgrade bag, reresent user and re-enter selection information, again perform contrast matching operation.If the selection information that user inputs in a computer is Scanner_MS4.1, namely its its second type information is Scanner_MS, and second edition information is 4.1, and after contrast coupling, ActiveX control computer for controlling is to web server requests firmware upgrade bag.If user in a computer input selection information is Scanner_XP3.1, namely its second type information is Scanner_XP, second edition information is 3.1, due to the second type information and the first type information inconsistent, computing machine is not to web server requests firmware upgrade bag, reresent user and re-enter selection information, again perform contrast matching operation.
ActiveX control computer for controlling to web server requests firmware upgrade bag, and by this firmware upgrade Packet forwarding from the webserver of receiving to embedded device.Specifically, ActiveX control Using API Function URLDownloadToFile() download firmware upgrade bag from the webserver, this firmware upgrade bag is that user inputs the selection information of mating with the facility information of embedded device, in a computer as the Scanner_MS4.1 in the present embodiment.Again the firmware upgrade Packet forwarding from the webserver received is given the embedded device be connected with computing machine, by firmware upgrade Packet forwarding to embedded device before by Using API Function fopen() open firmware file, Using API Function fread(again) obtain the coded format of this firmware upgrade bag, the attribute informations such as firmware size, as firmware upgrade bag is called Sys_App.DAT, size is 204800B(0x32000B), then the attribute information of firmware file is: character string " DAT ", 16 mechanism data: 0x32000B, computing machine reads the packet that size is 32 bytes at every turn, last packet to gather together enough 32 bytes less than the benefit 0 of 32 bytes.Again by write function WriteFile() this firmware upgrade bag is sent to embedded device.
After embedded device receives the attribute information of firmware upgrade bag, there is provided the memory capacity corresponding to firmware size to receive firmware upgrade bag, whether embedded device detects this firmware upgrade bag automatically after receiving firmware upgrade bag be encrypted firmware AKU, if be then decrypted process to this firmware upgrade bag, perform after decryption processing and store this firmware upgrade bag; Then directly perform and store this firmware upgrade bag if not.
The upgrade method of the embedded device firmware based on ActiveX provided by the present invention can realize quickly and easily upgrading embedded device, specific upgrade software is provided to client without the need to manufacturer, only embedded device need to be connected on computing machine, and to be performed to web server requests download firmware AKU by ActiveX control.
Based on a upgrade-system for the embedded device firmware of ActiveX, form primarily of embedded device, cyber-net server, specifically comprise:
Detect trigger element: whether be provided with the ActiveX control that the embedded device that is connected with computing machine is supporting for making computer auto-detection, this embedded device is connected to computing machine by USB line or RS232 line.If detect and be provided with ActiveX control, then the trigger pip for controlling ActiveX control operation of wait-receiving mode user triggering; If do not install ActiveX control, then prompting downloads and installs the code signature certificate for identifying ActiveX control source and developer's information, this code signature certificate is in order to ensure that ActiveX control is not maliciously tampered, if when computing machine does not recognize the code signature certificate of AcitveX control, can think that ActiveX control is that illegal program is tackled, therefore before installation ActiveX control, code signature certificate is first installed.Computing machine, after recognizing the success of code signature certificate install, points out user installation ActiveX control, and waits for the trigger pip for controlling ActiveX control operation that user triggers.
Trigger upgrade unit: for the trigger pip for controlling ActiveX control operation making computing machine receive user's triggering, the facility information being connected to the external equipment of computing machine is obtained by ActiveX control, this external equipment being connected to computing machine can be keyboard, mouse, sound equipment and be built-in with the embedded device of embedded software, ActiveX control obtains the information list being connected to the external equipment of computing machine, from described information list, embedded device is found again by query manipulation, read the facility information of this embedded device, described facility information comprises the first type information and first version information.And record the routing information of described embedded device, utilize described routing information to set up communication port between described ActiveX control and described embedded device, make embedded device enter the upgrade mode with ActiveX control information interaction.
Relatively processing unit: for making ActiveX control receive selection information from user, selection information comprise Second-Type information and second edition information; The facility information of the embedded device selection information received found with ActiveX control carries out contrast and mates; If the first type information is consistent with the second type information and second edition information is greater than first version information time, then computer for controlling is to web server requests firmware upgrade bag; Otherwise point out not match information, repetitive operation;
Firmware transmission unit: for making ActiveX control computer for controlling to web server requests firmware upgrade bag, and by this firmware upgrade Packet forwarding from the webserver of receiving to embedded device;
Firmware upgrade unit: after receiving described firmware upgrade bag for making embedded device, whether automatic detection is encrypted firmware AKU, if be then decrypted process to firmware upgrade bag, performs and storing firmware AKU after decryption processing; Then directly perform if not and storing firmware AKU.This firmware upgrade unit comprises upgrading load-on module, memory module and decryption processing module, and this upgrading load-on module communicates with decryption processing module with memory module respectively and is connected.
The present invention is described by several specific embodiment, it will be appreciated by those skilled in the art that, without departing from the present invention, can also carry out various conversion and be equal to substituting to the present invention.In addition, for particular condition or concrete condition, various amendment can be made to the present invention, and not depart from the scope of the present invention.Therefore, the present invention is not limited to disclosed specific embodiment, and should comprise the whole embodiments fallen within the scope of the claims in the present invention.