A kind of card reader with data compression function
Technical field
The present invention relates to a kind of card reader, be specifically related to a kind of card reader with data compression/decompression contracting function.
Background technology
Storage card can transmit and preserve various forms of mass data very easily, therefore, is widely used, and such as, video, image, data file and other kinds of information can be saved in storage card.
Along with the price of storage card is more and more lower, volume is more and more less, and the application that storage is relevant is benefited a lot of, and the application of such as card reader is more and more extensive.Nowadays before the capacity of storage card was much larger than 5 years, even if the storage card of identical capacity can be produced before 5 years, before cost now is also far below 5 years.And this advantage of storage card is embodying the most further.
In storage card claimed information safety it is critical that, even if can not accomplish to prevent to reduce the risk that information is stolen completely the most as far as possible.But using the card reader of prior art, the stolen phenomenon of identity information happens occasionally.In storage card, store sensitive information the most also bring catastrophic risk.
Meanwhile, using the card reader of prior art, when information is transferred to main frame from storage card, such as information is transferred to PC from portable memory apparatus, certain time to be spent.Only this point, uses storage card to bring inconvenience to user the most to a certain extent.Therefore, the card reader of prior art only reads that the information of storage card is intact is transferred to main frame, has given play to the performance of existing storage card the most completely.
Therefore, for drawbacks described above present in currently available technology, it is necessary to study in fact, to provide a kind of scheme, to solve defect present in prior art, thus improves performance and the safety of storage card further.
Summary of the invention
In order to overcome the defect of above-mentioned prior art, the invention provides a kind of card reader at least including a data compressing module, so that storage device has more superior performance and higher safety.
For solving the problem that prior art exists, the technical scheme is that
A kind of card reader, including interface controller, storage device interface and data processing module, wherein,
Described interface controller is connected with external host, for receiving from main frame or sending information to main frame;
Described storage device interface is connected with storage device, for receiving from storage device or sending information to storage device;
Described data processing module is connected with described interface controller and storage device interface, including the compression module for being compressed information with for the decompression module decompressing information;
When described card reader receives from the information that main frame is sent, described interface controller receives this information and sends that information to data processing module, described data processing module starts compression module therein and carries out Information Compression, then by storage device interface, the information after compression is sent to storage device;
When described card reader sends information to main frame, described storage device interface obtains information from storage device and sends that information to data processing module, described data processing module starts decompression module therein and carries out information decompression, then by interface controller, the information after decompression is sent to main frame.
Preferably, when the information that main frame is sent to card reader is the most compressed information, described data processing module detects this situation, will not perform squeeze operation;
When the information uncompressed that card reader obtains from storage device, described data processing module detects this situation, will not perform decompression operations.
Preferably, also include microcontroller, described microcontroller is connected with data processing module, interface controller and storage device interface, and the information controlling described interface controller and storage device interface receives or sends, and controls described data processing module execution Information Compression or decompression.
Preferably, when external host is usb host, described interface controller is USB controller.
Preferably, when storage device is SD card, described storage device interface is SD HPI.
Preferably, when external host is SATA host, described interface controller is SATA controller.
Preferably, when storage device is eMMC card, described storage device interface is eMMC HPI.
Preferably, described data processing module is connected with more than one storage device interface, and any one storage device interface is connected from different storage devices.
Preferably, this card reader includes more than one data processing module, and multiple described data processing modules can carry out data compression or decompression simultaneously.
Preferably, any one described data processing module is connected with more than one storage device interface, and described storage device interface is eMMC HPI.
Compared with prior art, beneficial effects of the present invention is as follows: had the card reader of data compression/decompression contracting module by employing, is greatly improved the storage performance of existing storage card, also improves the safety of storage information simultaneously.
Accompanying drawing explanation
Fig. 1 is the theory diagram of card reader embodiment one of the present invention;
Fig. 2 is the theory diagram of card reader embodiment two of the present invention;
Fig. 3 is the theory diagram of card reader embodiment three of the present invention;
Fig. 4 is the theory diagram of card reader embodiment four of the present invention.
Detailed description of the invention
In order to make the purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
On the contrary, the present invention contains any replacement made in the spirit and scope of the present invention, amendment, equivalent method and scheme being defined by the claims.Further, in order to make the public that the present invention to be had a better understanding, in below the details of the present invention being described, detailed describe some specific detail sections.The description not having these detail sections for a person skilled in the art can also understand the present invention completely.
See Fig. 1, it show the theory diagram of card reader embodiment one of the present invention, including microcontroller 10, interface controller 11, data processing module (data compression/decompression contracting module) 12, storage device interface 13, read only memory ROM 14 and random access memory ram 15.
Microcontroller 10 is connected with ROM14, RAM15, interface controller 11, data compression/decompression contracting module 12, storage device interface 13, and thus, microcontroller 10 controls coupled modules.Interface controller 11 is generally used for carrying out information (data) with external host and communicates, and under the control of microcontroller 10, realizes the information between card reader and main frame by interface controller 11 and transmits.
Storage device interface 13 is generally used for carrying out information (data) with storage device and communicates.Under the control of microprocessor 10, realize the information between card reader and storage device by storage device interface 13 and transmit.
Data compression/decompression contracting module 12 is connected with interface controller 11 and storage device interface 13 respectively, performs data compression or decompression under the control of microcontroller 10.When card reader Receiving Host sends, by interface controller 11, the information come, data compression/decompression contracting module 12 performs squeeze operation, then by storage device interface 13, the information after compression is sent to storage device;When card reader receive storage device send, by storage device interface 13, the information come time, data compression/decompression contracting module 12 performs decompression operation, then by interface controller 11, the information after decompression is sent to main frame.
When the information that main frame is sent to card reader is the most compressed information, described data compression/decompression contracting module 12 detects this situation, and no longer performs squeeze operation;
When card reader information uncompressed from storage device, described data compression/decompression contracting module 12 detects this situation, and no longer performs decompression operations.
In all embodiments of the invention, main frame is mutually compatible with external interfaces such as USB, SATA and PCIe, but is not limited to above-mentioned interface.Card reader is connected with main frame by external interface.
ROM14 with RAM15 is connected with microcontroller 10, and ROM14 is generally used for preserving the program (software/firmware) that microprocessor 10 needs to perform, and RAM15 is generally used for preserving data and/or the program that microcontroller 10 will perform.Microcontroller 10 performs the code (also referred to as program) being stored in ROM14 and/or RAM15.
In a kind of detailed description of the invention of card reader of the present invention, card reader is integrated on a single integrated circuit (IC);Or each functional module of card reader can be realized jointly by multiple IC and/or multiple printed circuit board (PCB) (PCB);In the preferred embodiment of the present invention, card reader is realized by monolithic PCB;In other embodiments of the present invention, card reader portion or repertoire module can be by realizations in software and/or firmware.
The work process of card reader embodiment shown in Fig. 1 one is as follows: under the control of microcontroller 10, card reader (also referred to as memory card reader) receives the information sent from main frame by interface controller 11, data compression/decompression contracting module 12 performs squeeze operation, then the information after compression being sent to storage device interface 13, under the control of microprocessor 10, storage device interface 13 transmits this information to storage device.Storage device is generally storage card, but and is confined to this.Equally, card reader passes through storage device interface 13 when storage device obtains information, under the control of microcontroller 10, data compression/decompression contracting module 12 receives the information sended over from storage device interface 13 and performs decompression operation, then by interface controller 11 will decompress after information be sent to main frame.
Data compression/decompression contracting module 12 can use compression algorithm/decompression information that many is now known that.Conventional compression/decompression algorithm is LZR algorithm and lzw algorithm, but is not limited thereto.
Seeing Fig. 2, show the theory diagram of card reader embodiment two of the present invention, card reader is connected with usb host 2 and SD card 3 respectively.Card reader in embodiment two is compared with the embodiment one shown in Fig. 1, and principle is identical, and simply interface controller 11 is replaced by USB controller 24, and storage device interface 13 is replaced by SD HPI 26.Wherein, USB controller 24 is connected with usb host 2, and SD HPI 26 is connected with SD card 3.Therefore, card reader is by transmitting between USB controller 24 and usb host 2 and reception information, by transmitting and reception information between SD HPI 26 and SD card 3.Data communication between card reader and usb host 2 is followed the data communication between USB standard, and SD card 3 and is followed SD standard.
Card reader embodiment shown in Fig. 2 two and the embodiment one in figure one, principle is identical, specific works process is as follows: the information coming from USB controller 24 is sent to data compression/decompression contracting module 12 and carries out data compression by card reader, then the information after compression is sent to SD HPI 26 from data compression/decompression contracting module 12, then by SD HPI 26, the information of reception is sent to SD card 3 and preserves.Same, the information coming from SD card 3 is transferred to SD HPI 26, then the information of reception is sent to data compression/decompression contracting module 12 and decompresses by SD HPI 26, then the information of decompression is sent to USB controller 24 and transmits it to usb host 2.Information if from SD card 3 was uncompressed, and after data compression/decompression contracting module 12 reception information, will not perform decompression operation, and directly by USB controller 24, this information will be sent to usb host 2.Same, the information received from usb host 2 is the most compressed, after data compression/decompression contracting module 12 reception information, will not perform squeeze operation, and directly send compressed information to SD card 3.
SD card is a kind of portable storage card, generally in the communication of equipment room, for preservation and/or the transmission of information.Such as, SD card 3 can preserve backup information in order to repair the current information damaged due to fault.When SD card 3 is connected with card reader, is saved in the backup information on SD card 3 and will be transferred to data compression/decompression contracting module 12 by SD HPI 26, this premise be this information be compression information.Data compression/decompression contracting module 12 decompresses information, and then decompression information be transferred to USB controller 24, and USB controller 24 is eventually transferred to usb host 2 decompression information, thus repairs original information.
Embodiment two Fig. 2 shown in is exemplified below and invents the technique effect that other embodiments are brought, assume that data transfer rate under SATA host-host protocol is 250 Mbytes of (MB)/seconds (s), transfer rate under SD card is 50MB/s, when using two pieces of SD cards to be connected with card controller engine, when not carrying out data compression, transfer rate is 100MB/s effectively.It is further assumed that average data compression ratio is 0.5, after data are compressed, then effective message transmission rate is 100MB/s ÷ 0.5=200MB/s.Therefore, after using card reader embodiment of the present invention, the performance of respective stored card is greatly improved.
Seeing Fig. 3, show the theory diagram of card reader embodiment three of the present invention, card reader is connected with SATA host 34 and eMMC card 36.In embodiment three, eMMC card 36 includes two eMMC cards, respectively eMMC card 38 and eMMC card 40, it is to be appreciated that use two eMMC cards to be intended only as an example, can use any number of eMMC card in reality.
The card reader of embodiment three is compared with the embodiment two shown in Fig. 2, principle is identical, SATA controller 42 is simply used to replace USB controller 24, one or more eMMC HPI 44 and 46 is used to replace SD HPI 26, one eMMC HPI connects an eMMC card, therefore, the quantity of eMMC HPI is the same with the quantity of the eMMC card used.Only following SATA2.0 standard with SATA controller 42 at this to illustrate for example, the SATA standard using other version is equally applicable.
As follows in the work process of card reader embodiment shown in Fig. 3 three: card reader is by sending between SATA controller 42 and SATA host 34 and reception information;Communicate between SATA host 34 with SATA controller 42 and follow SATA standard.Under the control of microprocessor 10, SATA controller 42 send information to data compression/decompression contracting module 12, and as the case may be, data compression/decompression contracting module 12 is compressed information and passed through eMMC HPI 44 or 46 and be delivered to eMMC card 36.Same, under the control of microprocessor 10, card reader receives information by eMMC HPI 44 and 46 from eMMC card 36, as the case may be, the information received is decompressed by data compression/decompression contracting module 12, and under the control of microprocessor 10, by SATA controller 42, the information of decompression is sent to SATA host 34.
Using two eMMC cards in embodiment three, data compression/decompression contracting module 12 sends information or from eMMC card 38 reception information by eMMC HPI 44 to eMMC card 38, and this information is carried out data compression or decompression.Equally, it is also possible to send information or from eMMC card 40 reception information by eMMC HPI 46 to eMMC card 40, and this information is carried out data compression or decompression.
Although here it should also be noted that only with single SD card in the embodiment two shown in Fig. 2, but reality being equally useful multiple SD card.Use the principle of multiple eMMC card according to Fig. 3 illustrated embodiment three, can deduce and use multiple SD card to be accomplished by using multiple SD HPI in embodiment two.
See Fig. 4, it show as the theory diagram of card reader embodiment four in the present invention, its principle is similar to the embodiment three shown in Fig. 3, simply uses multiple data compression/decompression contracting module in embodiment four, and any one data compression/decompression contracting module is connected with two eMMC HPIs.Such as, as the embodiment three shown in Fig. 3, data compression/decompression contracting module 12 is connected with eMMC card 36;And another data compression/decompression contracting module 72 is connected with eMMC card 84 by two eMMC HPIs, HPI is respectively eMMC HPI 68 and 70, and eMMC card 84 comprises eMMC card 64 and 66.Thus allow two data compression/de-compression engine parallel runnings.Can carry out the function of data compression/decompression contracting in synchronization each data compression/decompression contracting module, this makes card reader performance significantly promote.Certainly, so can be correspondingly improved on cost.
In card reader embodiment four shown in Fig. 4, a data compression/de-compression module is only connected with two eMMC HPIs, and we are it is contemplated that a data compression/de-compression module can be connected with the eMMC HPI of any suitable number certainly.Additionally, embodiment four there are two data compression/de-compression modules can run simultaneously, equally use the data compression/decompression contracting module of any suitable number.By using multiple data compression/decompression contracting modules, card reader performance is significantly improved.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all any amendment, equivalent and improvement etc. made within the spirit and principles in the present invention, should be included within the scope of the present invention.