A kind of embedded device and data file downloading method thereof
Technical field
The present invention relates to special purpose computer apparatus field, relate in particular to a kind of embedded device and data file downloading method thereof.
Background technology
Embedded device is to be applied as object, take computer technology as basis, and software and hardware can cutting, adapt to the dedicated computing machine equipment that application system is strict with function, reliability, cost, volume, power consumption.Embedded device generally comprises hardware and software two parts, and hardware comprises processor/microprocessor, storer and external components etc.; Software section comprises operating system software (OS) (requiring in real time and multi-job operation) and application program, application program controlling running and the behavior of system, and operating system software is controlling the reciprocation of application program and hardware, for realizing the functions such as control, supervision or management to miscellaneous equipment.The feature of embedded device is: high reliability; The in the situation that of rugged environment or power-off suddenly, equipment still can normally be worked.The software of embedded device is generally all solidificated in programmable read only memory, that is to say the storage of software requirement solid state, rather than is stored in the carriers such as disk.As shown in Figure 1, the download of embedded device is that the data file by being stored on outer computer, imports in embedded device by Peripheral Interface and the outer computer communication of embedded device at present.
At present, there is following shortcoming and defect in prior art embedded device:
1, prior art embedded device, all by communicating by letter with outer computer, downloads to the file destination on outer computer in the programmable read only memory of embedded device, cannot in outer computer situation, download and upgrade not having;
2, the speed of download of existing embedded device is limited by the Peripheral Interface transmitting data file speed that outer computer connects, and speed of download is slower.
3, existing embedded device cannot be controlled download, and upstream digital publishing rights cannot ensure, because download data files needs be connected with outer computer, susceptible viral and assault, make the software of embedded device easily be cracked or abuse.
Summary of the invention
The characteristic that the present invention mainly utilizes little lightweight, the easy movement of storage card volume, can encrypt, storage card is connected with embedded device, a kind of new embedded device and data file downloading method thereof are provided, in order to solve prior art embedded device speed of download slow, download uneasy congruent problem.
For achieving the above object, the present invention adopts following technical scheme:
A kind of embedded device, can between mode of operation and downloading mode, switch according to need of work, described embedded device comprises processor, programmable read only memory, buffer memory and Peripheral Interface, described processor respectively and programmable read only memory, buffer memory and Peripheral Interface connect, in downloading mode for the treatment of download data files, in mode of operation for controlling built-in equipment operation, described programmable read only memory is used for storing download data files, described buffer memory is for deposit processor desired data file temporarily, described Peripheral Interface in downloading mode for connecting outer computer, wherein, described embedded device is also provided with storage card, described storage card is connected with processor, at storage card described in downloading mode, by processor, to embedded device, import download data files.
As a further improvement on the present invention, described processor also comprises I/O port, and described storage card is connected with processor by the I/O port of processor.
As a further improvement on the present invention, described storage card is to plug storage card.
As a further improvement on the present invention, described storage card is can encryption safe storage card.
As a further improvement on the present invention, described storage card comprises CF card, or mmc card, or SD card, or memory stick, or XD image card, or SM card.
As a further improvement on the present invention, described embedded device, when downloading mode, is first connected storage card separately with outer computer, it is characterized in that, described data file downloading method comprises the steps:
The first step: utilize outer computer write key, download data files size, download time enciphered message and write download data files in storage card, and by physical sector, enciphered message and download data files are deposited respectively.;
Second step: the processor of storage card and embedded device is connected;
The 3rd step: processor imports to the enciphered message storing in storage card in buffer memory;
The 4th step: processor reads enciphered message in buffering, judges that whether enciphered message is correct, if incorrect, exits downloading mode, if correctly, continues step 5;
The 5th step: processor is divided into bag by the download file storing in storage card and is loaded into buffer memory, then the downloading data bag in buffer memory is imported in programmable read only memory; Repeatedly carry out until All Files all imports in programmable read only memory.
As a further improvement on the present invention, the described first step also comprises the steps:
Step 1a: said write enciphered message comprises: have the key of closed security zone, add encrypted frame head file in download data files.
As a further improvement on the present invention, described encrypted frame head file comprises: download data files size information, download time information.
As a further improvement on the present invention, described the 4th step also comprises the steps:
Step 4a: processor judgement key, and download data files size information in decrypt encrypted information, judge whether correctly, if incorrect, to exit downloading mode, if correctly, continue step 4b;
Step 4b: in the enciphered message after processor judgement deciphering, whether download time surpasses the download time upper limit, if surpass the upper limit, exits downloading mode, if the upper limit of being no more than continues step 5.
As a further improvement on the present invention, after described the 5th step completes, also comprise the steps:
The 6th step: after having downloaded, the download time that processor is revised storage card frame head file automatically adds 1, and according to secret key encryption.
For prior art shortcoming 1, the present invention does not need embedded device to be connected with outer computer, but utilizes storage card directly to connect embedded device, has solved the shortcoming of the too busy to get away outer computer of embedded device download data files.
For prior art shortcoming 2, storage card is directly connected with processor by the I/O port of processor, without Peripheral Interface, avoided the slow impact of Peripheral Interface transmission speed, it utilizes embedded device internal bus, has reduced transmission link, has greatly improved data file speed of download.
For prior art shortcoming 3, the present invention utilizes the storage card can encryption feature, by key storage in encrypting region, the frame head fileinfo of the data file that need are downloaded is encrypted: comprise and need download data files size, download time, data file description etc., by enciphered message with need download data files to write the region, physical sector of storage card appointment.When embedded device download data files, first can read key and frame head file encryption information, as key or frame head file encryption information is incorrect directly exits download, if correctly, carry out secure download, download time after download completes in renewal header file encryption information, encrypt again, solve cryptography issue.Because frame head file encryption information is present in embedded device master routine with buffer memory form, generally more difficult tracking cracks, and key is present in storage card encrypted area, and data are stored in physical sector mode, effectively prevented disabled user's copy download card, the security that has improved embedded device.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the connection diagram that prior art embedded device utilizes outer computer download data files;
Fig. 2 is the hardware structure figure of embedded device of the present invention;
Fig. 3 is embedded device data file downloading method process flow diagram of the present invention.
Embodiment
Embedded device of the present invention hardware structure as shown in Figure 2, comprise processor 1, buffer memory 2 programmable read only memory 3, Peripheral Interface 4 and storage card 5, embedded device can switch according to need of work between mode of operation and downloading mode, processor 1 respectively with programmable read only memory 3, buffer memory 2, Peripheral Interface 4 and storage card 5 connect, processor 1 in downloading mode for the treatment of download data files, in mode of operation for controlling built-in equipment operation, programmable read only memory 3 is for storing download data files, buffer memory 2 is for deposit processor desired data file temporarily, Peripheral Interface 4 in downloading mode for connecting outer computer, storage card 5 imports download data files by processor 1 to embedded device at downloading mode.
Embedded device download data files of the present invention does not need to connect outer computer by Peripheral Interface 4, but directly utilize storage card 5 removable, can plug, can write the feature of enciphered message, first storage card 5 is connected with outer computer, download data files in outer computer is imported to storage card 5, and utilize outer computer to write enciphered message in storage card 5, disconnect again the connection of storage card 5 and outer computer, then will store the storage card 5 of download data files and enciphered message and the processor 1 of embedded device is connected, by processor 1, judge that whether key and frame head enciphered message in storage card be correct, as incorrect, directly exit downloading mode, as correctly secure download data file to embedded device, embedded device data file downloading method of the present invention as shown in Figure 3,
Concrete download step is as follows:
The first step: utilize outer computer write key, download data files size, download time enciphered message and write download data files in storage card, and by physical sector, enciphered message and download data files are deposited respectively.;
Second step: the processor of storage card and embedded device is connected;
The 3rd step: processor imports to the enciphered message storing in storage card in buffer memory;
The 4th step: processor reads enciphered message in buffering, judges that whether enciphered message is correct, if incorrect, exits downloading mode, if correctly, continues step 5;
The 5th step: processor is divided into bag by the download file storing in storage card and is loaded into buffer memory, then the downloading data bag in buffer memory is imported in programmable read only memory; Repeatedly carry out until All Files all imports in programmable read only memory.
The described first step also comprises the steps:
Step 1a: said write enciphered message comprises: have the key of closed security zone, add encrypted frame head file in download data files.
Described encrypted frame head file comprises: download data files size information, download time information.
Described the 4th step also comprises the steps:
Step 4a: processor judgement key, and download data files size information in decrypt encrypted information, judge whether correctly, if incorrect, to exit downloading mode, if correctly, continue step 4b;
Step 4b: in the enciphered message after processor judgement deciphering, whether download time surpasses the download time upper limit, if surpass the upper limit, exits downloading mode, if the upper limit of being no more than continues step 5.
After described the 5th step completes, also comprise the steps:
The 6th step: after having downloaded, the download time that processor is revised storage card frame head file automatically adds 1, and according to secret key encryption.
The present invention does not need embedded device to be connected with outer computer, but utilizes storage card 5 directly to connect the processor 1 of embedded device, has solved the shortcoming of the too busy to get away outer computer of embedded device download data files.
Because storage card 5 is directly connected with processor 1 by I/O port, without Peripheral Interface, avoided the slow impact of Peripheral Interface transmission speed, its transmitting data file directly utilizes embedded device internal bus, reduce transmission link, greatly improved data file speed of download.
The present invention also utilizes the storage card can encryption feature, key storage is encrypted to region in storage card, the frame head fileinfo of the data file that need are downloaded is encrypted, write storage card, when embedded device download data files, first can read key and frame head file encryption information, determine whether legal download; Because frame head file encryption information is present in embedded device master routine with buffer memory form, generally more difficult tracking cracks, and because key is present in storage card encrypted area, data are stored in physical sector mode, have effectively prevented the security that disabled user's copy download card has improved embedded device.
As another specific embodiment of the present invention, embedded device of the present invention can be according to the connected mode of specific works environment change storage card and embedded device.Such as, when holding the work space of embedded device, have in limited time, be not enough to arrange storage card on embedded device, the variable storage card of the present invention is circumscribed, that is to say, when above-mentioned embedded device needs download data files or ROMPaq, the processor of circumscribed card storage card and embedded device can be connected, carry out same method for down loading and the step of the present invention, can realize function of the present invention and beneficial effect equally.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion by the described protection domain with claim.